結果
| 問題 |
No.2240 WAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-17 14:08:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 615 bytes |
| コンパイル時間 | 1,901 ms |
| コンパイル使用メモリ | 194,744 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-11-17 14:08:57 |
| 合計ジャッジ時間 | 3,625 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 43 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
long long N, M;
if (!(cin >> N >> M)) return 0;
string s; cin >> s;
long long w = 0, a = 0, wa = 0, ac = 0;
for (char c : s) {
if (c == 'W') w++;
else if (c == 'A') {
if (w > 0) { w--; wa++; }
else a++;
} else if (c == 'C') {
if (a > 0) { a--; ac++; }
else { cout << "NO\n"; return 0; }
}
}
if (wa == N && ac == M && w == 0 && a == 0) cout << "YES\n";
else cout << "NO\n";
return 0;
}