結果

問題 No.606 カラフルタイル
ユーザー Kutimoti_TKutimoti_T
提出日時 2018-06-05 19:18:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 1,313 ms
コンパイル使用メモリ 148,436 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-12 22:30:50
合計ジャッジ時間 4,966 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,388 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,384 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 5 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 40 ms
4,380 KB
testcase_17 AC 190 ms
4,504 KB
testcase_18 WA -
testcase_19 AC 47 ms
4,380 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 187 ms
4,384 KB
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)

int N,K,Q;

int main(){
  cin >> N >> K >> Q;
  vector<char> A(Q);
  vector<int> B(Q),C(Q);
  vector<int> ans(K + 1,0);
  int r = N;
  int c = N;
  rep(i,0,Q - 1) cin >> A[i] >> B[i] >> C[i];
  bitset<101010> rb = 0,cb = 0;
  for(int i = Q - 1;i >= 0;i--){
    if(A[i] == 'R'){
      if(rb[B[i]]) continue;
      rb[B[i]] = 1;
      ans[C[i]]+=c;
      r--;
    }
    else{
      if(cb[B[i]]) continue;
      cb[B[i]] = 1;
      ans[C[i]]+=r;
      c--;
    }
  }

  rep(i,1,K){
    cout << ans[i] << endl;
  }
}
0