結果

問題 No.606 カラフルタイル
ユーザー bachoppibachoppi
提出日時 2020-08-18 13:59:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,260 bytes
コンパイル時間 1,124 ms
コンパイル使用メモリ 120,820 KB
実行使用メモリ 6,964 KB
最終ジャッジ日時 2024-04-20 07:32:02
合計ジャッジ時間 3,752 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 3 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 7 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 55 ms
6,912 KB
testcase_19 WA -
testcase_20 AC 200 ms
6,912 KB
testcase_21 WA -
testcase_22 AC 56 ms
6,912 KB
testcase_23 WA -
testcase_24 AC 157 ms
6,784 KB
testcase_25 AC 194 ms
6,784 KB
testcase_26 AC 193 ms
6,964 KB
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }
}
    
0