結果
問題 | No.1021 Children in Classrooms |
ユーザー | morimario |
提出日時 | 2020-04-10 22:39:43 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,472 bytes |
コンパイル時間 | 2,046 ms |
コンパイル使用メモリ | 190,424 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 21:18:04 |
合計ジャッジ時間 | 3,987 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 3 ms
5,376 KB |
testcase_04 | AC | 3 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 3 ms
5,376 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 78 ms
5,376 KB |
testcase_10 | AC | 77 ms
5,376 KB |
testcase_11 | AC | 77 ms
5,376 KB |
testcase_12 | AC | 77 ms
5,376 KB |
testcase_13 | AC | 77 ms
5,376 KB |
testcase_14 | AC | 76 ms
5,376 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 83 ms
5,376 KB |
testcase_19 | WA | - |
ソースコード
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep0(N) for (int COUNTER = 0; COUNTER < (int)(N); COUNTER++) #define rep(i, N) for (int i = 0; i < (int)(N); i++) #define rep1(i, N) for (int i = 0; i < (int)(N); i++) #define rep2(i, START, GOAL) for (int i = (int)(START); i < (int)(GOAL); i++) #define rep3(i, START, GOAL) for (int i = (int)(START); i > (int)(GOAL); i--) #define ALL(CONTAINER) CONTAINER.begin(), CONTAINER.end() #define rALL(CONTAINER) CONTAINER.rbegin(), CONTAINER.rend() #define from1(CONTAINER) CONTAINER.begin() + 1, CONTAINER.end() #define rfrom1(CONTAINER) CONTAINER.rbegin(), CONTAINER.rend() - 1 #define output(X) cout << X << "\n" #define dberr(X) cerr << X << " " #define dberrl(X) cerr << X << "\n" #define db(X) cerr << #X << ":" << (X) << " " #define dbl(X) cerr << #X << ":" << (X) << "\n" #define db2(X, Y) cerr << #X << ":" << (X) << ", " << #Y << ":" << (Y) << " " #define db2l(X, Y) cerr << #X << ":" << (X) << ", " << #Y << ":" << (Y) << "\n" #define dbl2(X, Y) cerr << #X << ":" << (X) << "\n" << #Y << ":" << (Y) << "\n" #define db3(X, Y, Z) cerr << #X << ":" << (X) << ", " << #Y << ":" << (Y) << " " << #Z << ":" << (Z) << " " #define db3l(X, Y, Z) cerr << #X << ":" << (X) << ", " << #Y << ":" << (Y) << ", " << #Z << ":" << (Z) << "\n" #define dbl3(X, Y, Z) cerr << #X << ":" << (X) << "\n" << #Y << ":" << (Y) << "\n" << #Z << ":" << (Z) << "\n" #define dbp(PAIR) cerr << #PAIR << ":(" << PAIR.first << ", " << PAIR.second << ") " #define dbpl(PAIR) cerr << #PAIR << ":(" << PAIR.first << ", " << PAIR.second << ")\n" #define dbt3(TUPLE3) cerr << #TUPLE3 << ":(" << get<0>(TUPLE3) << ", " << get<1>(TUPLE3) << ", " << get<2>(TUPLE3) << ") " #define dbt3l(TUPLE3) cerr << #TUPLE3 << ":(" << get<0>(TUPLE3) << ", " << get<1>(TUPLE3) << ", " << get<2>(TUPLE3) << ")\n" #define dbt4(TUPLE4) cerr << #TUPLE4 << ":(" << get<0>(TUPLE4) << ", " << get<1>(TUPLE4) << ", " << get<2>(TUPLE4) << ", " << get<3>(TUPLE4) << ") " #define dbt4l(TUPLE4) cerr << #TUPLE4 << ":(" << get<0>(TUPLE4) << ", " << get<1>(TUPLE4) << ", " << get<2>(TUPLE4) << ", " << get<3>(TUPLE4) << ")\n" #define dbv(VEC) cerr << #VEC << ":{ "; for (auto ELEM : VEC) cerr << ELEM << ", "; cerr << "}\n" #define dbvp(VP) cerr << #VP << ":{ "; for (auto PAIR : VP) cerr << "(" << PAIR.first << ", " << PAIR.second << "), "; cerr << "}\n" #define dbvv(VV) cerr << #VV << ":{\n"; for (auto VEC : VV) { cerr << "{ "; for (auto ELEM : VEC) cerr << ELEM << ", "; cerr << "},\n"; } cerr << "}\n" #define dbvvp(VVP) cerr << #VVP <<":{\n"; for (auto VP : VVP) { cerr << "{ "; for (auto PAIR : VP) { cerr << "(" << PAIR.first << ", " << PAIR.second << "), "; } cerr << "},\n"; } cerr << "}\n"; #define dbm(MAP) cerr << #MAP << ":{ "; for (auto PAIR : MAP) cerr << "(" << PAIR.first << ", " << PAIR.second << "), "; cerr << "}\n" #define YN(f) cout << (f ? "YES" : "NO") << "\n" #define Yn(f) cout << (f ? "Yes" : "No") << "\n" #define yn(f) cout << (f ? "yes" : "no") << "\n" using ll = long long; using vi = vector<int>; using vl = vector<ll>; using vd = vector<double>; using vs = vector<string>; using vb = vector<bool>; using vvi = vector<vi>; using vvl = vector<vl>; using vvd = vector<vd>; using vvb = vector<vb>; using pii = pair<int, int>; using pil = pair<int, ll> ; using pli = pair<ll, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using vpii = vector<pii>; using vpll = vector<pll>; using vpdd = vector<pdd>; using ti3 = tuple<int, int, int>; using tl3 = tuple<ll, ll, ll>; using td3 = tuple<double, double, double>; using ti4 = tuple<int, int, int, int>; using tl4 = tuple<ll, ll, ll, ll>; using td4 = tuple<double, double, double, double>; using mii = map<int, int>; using mil = map<int, ll>; using mli = map<ll, int>; using mll = map<ll, ll>; using si = set<int>; using sl = set<ll>; // db int main() { int N, M; cin >> N >> M; vi a(N + 1); rep2(i, 1, N + 1) cin >> a[i]; string s; cin >> s; int d = 0, l = 0, r = 0; for (char c : s) { if (c == 'R') d++; else d--; l = min(l, d); r = max(r, d); // db(c); db3l(d, l, r); } d = min(max(d, -(N - 1)), N - 1); l = min(-l, N - 1); r = min(r, N - 1); // db3l(d, l, r); // dbv(a); rep2(i, 1, l + 1) { a[i + 1] += a[i]; a[i] = 0; } // dbv(a); rep3(i, N, N - r) { a[i - 1] += a[i]; a[i] = 0; } // dbv(a); rep2(i, 1, N + 1) { if (i - 1) cout << " "; if (1 <= i - d and i - d <= N) cout << a[i - d]; else cout << 0; } cout << endl; }