結果
問題 |
No.2373 wa, wo, n
|
ユーザー |
|
提出日時 | 2023-07-07 22:41:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 364 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 82,132 KB |
実行使用メモリ | 260,592 KB |
最終ジャッジ日時 | 2024-07-21 18:57:02 |
合計ジャッジ時間 | 7,231 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 OLE * 1 |
other | AC * 5 WA * 5 OLE * 1 -- * 28 |
ソースコード
n=int(input()) s=list(input())[::-1] cnt=10**6 while 1<len(s): cnt-=1 if cnt==0:exit(print("No")) x="".join(s[-2:])[::-1] if x=="??": s.pop() elif x=="wa" or x=="wo" or x=="w?" or x=="?a" or x=="?o" or x=="?n": s.pop() s.pop() elif x[0]=="n": s.pop() print(s,x) if s==[] or s==["?"] or s==["n"]: print("Yes") else: print("No")