結果

問題 No.606 カラフルタイル
ユーザー brthyyjpbrthyyjp
提出日時 2021-03-08 00:40:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 111,896 KB
最終ジャッジ日時 2024-04-17 16:46:14
合計ジャッジ時間 4,113 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,224 KB
testcase_01 AC 31 ms
51,968 KB
testcase_02 AC 30 ms
51,840 KB
testcase_03 AC 30 ms
52,480 KB
testcase_04 AC 29 ms
52,480 KB
testcase_05 AC 30 ms
51,712 KB
testcase_06 AC 29 ms
51,712 KB
testcase_07 AC 30 ms
52,480 KB
testcase_08 AC 30 ms
51,712 KB
testcase_09 AC 30 ms
51,968 KB
testcase_10 AC 34 ms
51,968 KB
testcase_11 AC 30 ms
51,712 KB
testcase_12 AC 31 ms
52,608 KB
testcase_13 AC 64 ms
77,824 KB
testcase_14 AC 31 ms
52,352 KB
testcase_15 AC 44 ms
62,464 KB
testcase_16 AC 124 ms
92,312 KB
testcase_17 AC 159 ms
111,896 KB
testcase_18 AC 135 ms
105,808 KB
testcase_19 AC 135 ms
102,052 KB
testcase_20 AC 167 ms
107,924 KB
testcase_21 AC 137 ms
100,936 KB
testcase_22 AC 141 ms
100,644 KB
testcase_23 AC 150 ms
103,348 KB
testcase_24 AC 143 ms
99,684 KB
testcase_25 AC 131 ms
91,216 KB
testcase_26 AC 144 ms
105,064 KB
testcase_27 AC 157 ms
111,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k, q = map(int, input().split())
Q = []
for i in range(q):
    a, b, c = map(str, input().split())
    b, c = int(b), int(c)
    b, c = b-1, c-1
    Q.append((a, b, c))

Q.reverse()
usedR = set()
usedC = set()
C = [0]*k
for a, b, c in Q:
    if a == 'R':
        if b not in usedR:
            C[c] += n-len(usedC)
        usedR.add(b)
    else:
        if b not in usedC:
            C[c] += n-len(usedR)
        usedC.add(b)
C[0] += n**2-sum(C)
print(*C, sep='\n')
0