結果
問題 | No.2240 WAC |
ユーザー | GlinTFraulein |
提出日時 | 2023-03-10 23:10:05 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,070 bytes |
コンパイル時間 | 4,107 ms |
コンパイル使用メモリ | 265,260 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-18 05:20:08 |
合計ジャッジ時間 | 7,451 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,940 KB |
testcase_04 | AC | 1 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 1 ms
6,940 KB |
testcase_08 | AC | 2 ms
6,940 KB |
testcase_09 | AC | 2 ms
6,944 KB |
testcase_10 | AC | 12 ms
6,940 KB |
testcase_11 | AC | 11 ms
6,944 KB |
testcase_12 | AC | 9 ms
6,944 KB |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | AC | 14 ms
6,940 KB |
testcase_17 | RE | - |
testcase_18 | AC | 4 ms
6,944 KB |
testcase_19 | AC | 5 ms
6,940 KB |
testcase_20 | RE | - |
testcase_21 | AC | 7 ms
6,944 KB |
testcase_22 | AC | 7 ms
6,944 KB |
testcase_23 | AC | 6 ms
6,940 KB |
testcase_24 | AC | 9 ms
6,940 KB |
testcase_25 | AC | 10 ms
6,940 KB |
testcase_26 | RE | - |
testcase_27 | RE | - |
testcase_28 | AC | 6 ms
6,940 KB |
testcase_29 | AC | 3 ms
6,940 KB |
testcase_30 | RE | - |
testcase_31 | RE | - |
testcase_32 | AC | 4 ms
6,944 KB |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | AC | 11 ms
6,940 KB |
testcase_37 | RE | - |
testcase_38 | AC | 6 ms
6,940 KB |
testcase_39 | AC | 14 ms
6,944 KB |
testcase_40 | RE | - |
testcase_41 | AC | 9 ms
6,940 KB |
testcase_42 | AC | 8 ms
6,944 KB |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:46:25: warning: ignoring return value of 'std::vector<bool, _Alloc>::reference std::vector<bool, _Alloc>::operator[](size_type) [with _Alloc = std::allocator<bool>; reference = std::vector<bool>::reference; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 46 | used[posa.back()]; | ^ In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/vector:65, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/functional:62, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:71, from main.cpp:1: /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_bvector.h:1035:7: note: declared here 1035 | operator[](size_type __n) | ^~~~~~~~
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> #define elif else if #define ll long long #define vll vector<long long> #define vec vector #define embk emplace_back #define rep(i, n) for (int i = 0; i < n; i++) #define rep3(i, n, k) for (int i = k; i < n; i++) #define all(a) a.begin(), a.end() using namespace std; using namespace atcoder; const ll INF = 1LL << 60; const ll mod = 998244353; int main() { ll n, m; cin >> n >> m; string s; cin >> s; ll ss = s.size(); vec<bool> used(ss); deque<ll> posa; ll count = 0; rep(i, ss) { if (s[ss-i-1] == 'A') { count++; posa.push_back(ss-i-1); } elif (s[ss-i-1] == 'W') { count--; used[posa.front()] = 1; posa.pop_front(); if (count < 0) { cout << "No" << endl; return 0; } } } rep(i, ss) { if (s[i] == 'C') { if (posa.back() < i) { used[posa.back()]; posa.pop_back(); } else { cout << "No" << endl; return 0; } } } cout << "Yes" << endl; }