結果

問題 No.606 カラフルタイル
ユーザー tempura_pptempura_pp
提出日時 2018-06-05 19:56:45
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 931 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 82,780 KB
実行使用メモリ 6,668 KB
最終ジャッジ日時 2023-09-12 22:33:28
合計ジャッジ時間 3,534 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 6 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 41 ms
5,684 KB
testcase_17 AC 197 ms
6,564 KB
testcase_18 AC 49 ms
5,788 KB
testcase_19 AC 49 ms
5,804 KB
testcase_20 AC 193 ms
6,668 KB
testcase_21 AC 51 ms
5,892 KB
testcase_22 AC 51 ms
5,888 KB
testcase_23 AC 76 ms
5,972 KB
testcase_24 AC 150 ms
6,300 KB
testcase_25 AC 191 ms
5,848 KB
testcase_26 AC 188 ms
6,608 KB
testcase_27 AC 187 ms
6,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef long long ll;
typedef pair<int,int> pint;
const ll mod= 998244353;
const int inf=1e9+7;
const ll  longinf = 1LL<<60;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};

bool used[2][101010];
ll ans[101010];
int main(){
  ll n;cin>>n;
  ll k,q;
  cin>>k>>q;
  ll a[q],b[q],c[q];
  rep(i,q){
    char x;cin>>x;
    a[i]=(x=='C');
    cin>>b[i]>>c[i];
    c[i]--;
    }
  reverse(a,a+q);
  reverse(b,b+q);
  reverse(c,c+q);
  ll x[2];
  x[0]=n,x[1]=n;
  ans[0]=n*n;
  rep(i,q){
    if(used[a[i]][b[i]])continue;
    used[a[i]][b[i]]=1;
    ans[c[i]]+=x[a[i]];
    ans[0]-=x[a[i]];
    x[1-a[i]]--;
    }
  rep(i,k)cout<<ans[i]<<endl;
    
  return 0;
  }
0