結果
問題 | No.2240 WAC |
ユーザー |
|
提出日時 | 2023-03-10 21:46:48 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 195 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 76,544 KB |
最終ジャッジ日時 | 2024-09-18 04:03:10 |
合計ジャッジ時間 | 3,170 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 |
ソースコード
n,m=map(int,input().split())S=input()a_cnt=0for s in S:if s=="A":a_cnt+=1if s=="C":a_cnt-=1if a_cnt<0:print("No")exit()a_cnt=0for s in S[::-1]:if s=="A":a_cnt+=1if s=="W":a_cnt-=1if a_cnt<0:print("No")exit()print("Yes")