結果
問題 | No.2373 wa, wo, n |
ユーザー |
![]() |
提出日時 | 2023-07-07 22:18:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 141 ms / 2,000 ms |
コード長 | 975 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-07-21 18:23:01 |
合計ジャッジ時間 | 3,867 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 39 |
ソースコード
N = int(input())S = input()ans = 'Yes'i = -1x = 0while i < N-1:i += 1s = S[i]if s == 'w':x = 0if i == N - 1:ans = 'No'breakif S[i+1] == 'o':continueelif S[i+1] == 'a':continueelif S[i+1] == '?':i += 1continueelse:ans = 'No'breakelif s == 'o':if i == 0:ans = 'No'breakif S[i-1] == 'w':x = 0continueelif S[i-1] == '?':if x:x = 0continueelse:ans = 'No'breakelse:ans = 'No'breakelif s == 'a':if i == 0:ans = 'No'breakif S[i-1] == 'w':continueelif S[i-1] == '?':if x:x = 0continueelse:ans = 'No'breakelse:ans = 'No'breakelif s == '?':x = 1continueelif s == 'n':x = 0continueelse:x = 0ans = 'No'continueprint(ans)