結果

問題 No.2373 wa, wo, n
ユーザー dangodango
提出日時 2023-07-08 08:20:51
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 720 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 265,744 KB
最終ジャッジ日時 2023-09-29 09:36:47
合計ジャッジ時間 13,675 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,280 KB
testcase_01 AC 70 ms
71,340 KB
testcase_02 AC 70 ms
71,412 KB
testcase_03 AC 69 ms
71,112 KB
testcase_04 AC 71 ms
71,356 KB
testcase_05 AC 70 ms
71,028 KB
testcase_06 AC 70 ms
71,272 KB
testcase_07 AC 68 ms
71,256 KB
testcase_08 RE -
testcase_09 AC 70 ms
71,276 KB
testcase_10 AC 69 ms
71,272 KB
testcase_11 AC 69 ms
71,408 KB
testcase_12 AC 69 ms
71,160 KB
testcase_13 AC 67 ms
71,504 KB
testcase_14 AC 1,248 ms
260,196 KB
testcase_15 AC 124 ms
77,764 KB
testcase_16 AC 1,527 ms
261,324 KB
testcase_17 AC 180 ms
77,860 KB
testcase_18 AC 94 ms
77,044 KB
testcase_19 AC 71 ms
71,320 KB
testcase_20 AC 73 ms
75,632 KB
testcase_21 AC 70 ms
71,328 KB
testcase_22 AC 70 ms
71,288 KB
testcase_23 AC 73 ms
73,440 KB
testcase_24 AC 69 ms
71,232 KB
testcase_25 AC 70 ms
71,436 KB
testcase_26 AC 71 ms
71,240 KB
testcase_27 AC 70 ms
71,084 KB
testcase_28 AC 70 ms
71,568 KB
testcase_29 AC 71 ms
71,280 KB
testcase_30 AC 67 ms
71,296 KB
testcase_31 AC 69 ms
71,276 KB
testcase_32 TLE -
testcase_33 AC 80 ms
79,256 KB
testcase_34 TLE -
testcase_35 AC 72 ms
71,504 KB
testcase_36 AC 1,705 ms
261,732 KB
testcase_37 AC 1,431 ms
261,044 KB
testcase_38 AC 1,450 ms
261,132 KB
testcase_39 TLE -
testcase_40 AC 1,756 ms
261,832 KB
testcase_41 AC 1,741 ms
264,252 KB
testcase_42 AC 1,405 ms
261,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(N, S):
    candidate = ["wa", "wo", "n"]
    while True:
        if len(S) == 0:
            break
        if S[0] == '?' and len(S) == 1:
            S = []
            break
        if S[0] == '?' and S[1] == '?':
            S = S[1:]
            continue
        match = False
        for cc in candidate:
            match = True
            for i in range(len(cc)):
                if S[i] != '?' and S[i] != cc[i]:
                    match = False
                    break
            if match:
                S = S[len(cc):]
                break
        if not match:
            break
    if len(S) == 0:
        print("Yes")
    else:
        print("No")
N = int(input())
S = input()
solve(N, S)
0