結果
問題 | No.606 カラフルタイル |
ユーザー |
![]() |
提出日時 | 2020-08-18 13:59:08 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,260 bytes |
コンパイル時間 | 3,486 ms |
コンパイル使用メモリ | 148,000 KB |
最終ジャッジ日時 | 2025-01-13 03:04:24 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 14 WA * 11 |
ソースコード
#include<iostream>#include<string>#include<algorithm>#include<vector>#include<iomanip>#include<math.h>#include<complex>#include<queue>#include<deque>#include<stack>#include<map>#include<set>#include<bitset>#include<functional>#include<assert.h>#include<numeric>using namespace std;#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )#define rep(i,n) REP(i,0,n)using ll = long long;const int inf=1e9+7;const ll longinf=1LL<<60 ;const ll mod=1e9+7 ;int main(){ll n, h, q; cin >> n >> h >> q;pair<char, pair<ll, ll>>P[q];rep(i, q){char c; ll a, b; cin >> c >> a >> b; a--; b--;P[i] = {c, {a, b}};}ll iro[101010] = {}; ll tate=0, yoko=0; bool tatecheck[101010], yokocheck[101010] = {};for(int i=q-1; i>=0; i--){if(P[i].first=='C' && !tatecheck[P[i].second.first]){tate++; iro[P[i].second.second]+=(n-yoko); tatecheck[P[i].second.first]=true;}else if(P[i].first=='R' && !yokocheck[P[i].second.first]){yoko++; iro[P[i].second.second]+=(n-tate); yokocheck[P[i].second.first]=true;}}ll sum = 0;for(int i=1; i<h; i++){sum+=iro[i];}//cout << sum << endl;rep(i, h){if(i==0) cout << (ll)n*n-sum << endl;else cout << iro[i] << endl;}}