結果
| 問題 |
No.1021 Children in Classrooms
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2020-04-10 21:36:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 2,000 ms |
| コード長 | 586 bytes |
| コンパイル時間 | 1,789 ms |
| コンパイル使用メモリ | 172,688 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 19:29:18 |
| 合計ジャッジ時間 | 3,431 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
deque<int> deq(n);
for (auto&& e : deq) {
cin >> e;
}
string s;
cin >> s;
for (char c : s) {
if (c == 'L') {
deq[1] += deq[0];
deq.pop_front();
deq.push_back(0);
} else {
deq[n - 2] += deq[n - 1];
deq.pop_back();
deq.push_front(0);
}
}
for (int i = 0; i < n; ++i) {
cout << deq[i] << " \n"[i == n - 1];
}
}
risujiroh