結果
| 問題 |
No.606 カラフルタイル
|
| コンテスト | |
| ユーザー |
bachoppi
|
| 提出日時 | 2020-08-18 13:52:10 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,264 bytes |
| コンパイル時間 | 3,699 ms |
| コンパイル使用メモリ | 147,740 KB |
| 最終ジャッジ日時 | 2025-01-13 03:04:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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(){
int n, h, q; cin >> n >> h >> q;
pair<char, pair<int, int>>P[q];
rep(i, q){
char c; int 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;
}
}
bachoppi