結果

問題 No.606 カラフルタイル
ユーザー konsin_tokagekonsin_tokage
提出日時 2018-06-05 22:59:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 446 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 49,576 KB
最終ジャッジ日時 2023-09-12 22:37:03
合計ジャッジ時間 6,524 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 14 ms
7,764 KB
testcase_02 AC 15 ms
7,840 KB
testcase_03 AC 15 ms
7,832 KB
testcase_04 AC 14 ms
7,764 KB
testcase_05 AC 15 ms
7,828 KB
testcase_06 AC 15 ms
7,952 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 15 ms
7,828 KB
testcase_09 AC 15 ms
7,764 KB
testcase_10 AC 16 ms
7,844 KB
testcase_11 AC 15 ms
7,812 KB
testcase_12 AC 16 ms
7,908 KB
testcase_13 AC 43 ms
9,896 KB
testcase_14 AC 15 ms
7,828 KB
testcase_15 AC 18 ms
8,432 KB
testcase_16 AC 303 ms
31,636 KB
testcase_17 AC 426 ms
49,424 KB
testcase_18 AC 343 ms
39,528 KB
testcase_19 AC 331 ms
38,612 KB
testcase_20 AC 446 ms
47,616 KB
testcase_21 AC 344 ms
38,628 KB
testcase_22 AC 345 ms
38,728 KB
testcase_23 AC 363 ms
42,252 KB
testcase_24 AC 412 ms
43,652 KB
testcase_25 AC 374 ms
38,804 KB
testcase_26 AC 425 ms
49,576 KB
testcase_27 AC 421 ms
49,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k, q = map(int, input().split())
s = [input().split() for _ in range(q)]
r = [0]*k
x, y = set(), set()
for a, b, c in s[::-1]:
    b, c = int(b), int(c)
    if a == 'C':
        s, t = x, y
    else:
        s, t = y, x
    if b in t:
        continue
    t.add(b)
    r[c-1] += n-len(s)
r[0] += n*n-sum(r)
for i in r:
    print(i)
0