結果
問題 |
No.606 カラフルタイル
|
ユーザー |
![]() |
提出日時 | 2017-11-28 15:29:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 77 ms / 2,000 ms |
コード長 | 704 bytes |
コンパイル時間 | 1,341 ms |
コンパイル使用メモリ | 167,060 KB |
実行使用メモリ | 8,192 KB |
最終ジャッジ日時 | 2024-11-27 13:03:42 |
合計ジャッジ時間 | 3,271 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long signed int LL; #define incID(i, l, r) for(int i = (l) ; i < (r); i++) #define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--) #define inc(i, n) incID(i, 0, n) #define dec(i, n) decID(i, 0, n) // ---- ---- const int M = 100000; LL n, k, q, a[M], b[M], c[M], f[2][M], ans[M]; int main() { cin >> n >> k >> q; inc(i, q) { string s; cin >> s >> b[i] >> c[i]; a[i] = (s == "R" ? 0 : 1); b[i]--; c[i]--; } LL r[2] = { n, n }; dec(i, q) { if(f[a[i]][b[i]] == 0) { ans[c[i]] += r[1 - a[i]]; f[a[i]][b[i]] = 1; r[a[i]]--; } } ans[0] += r[0] * r[1]; inc(i, k) { cout << ans[i] << "\n"; } return 0; }