結果
| 問題 |
No.2373 wa, wo, n
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-19 22:18:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 622 bytes |
| コンパイル時間 | 370 ms |
| コンパイル使用メモリ | 82,392 KB |
| 実行使用メモリ | 71,680 KB |
| 最終ジャッジ日時 | 2024-09-30 05:49:02 |
| 合計ジャッジ時間 | 3,219 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 WA * 13 |
ソースコード
N = int(input())
S = input()
S = list(S)
n = len(S)
i = 0
# ?は任意の文字を表す
while i < n:
if i == n - 1:
if S[i] != "?" and S[i] != "n":
print("No")
exit()
else:
break
if (
S[i] == "w"
and S[i + 1] == "o"
or S[i] == "?"
and S[i + 1] == "o"
or S[i] == "w"
and S[i + 1] == "?"
or S[i] == "?"
and S[i + 1] == "?"
):
i += 2
elif S[i] == "w" and S[i + 1] == "a":
i += 2
elif S[i] == "n":
i += 1
else:
print("No")
exit()
print("Yes")