結果

問題 No.606 カラフルタイル
ユーザー 👑 rin204rin204
提出日時 2022-10-31 23:15:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 220 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 1,273 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 117,432 KB
最終ジャッジ日時 2023-09-22 20:11:29
合計ジャッジ時間 6,904 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,384 KB
testcase_01 AC 70 ms
71,260 KB
testcase_02 AC 73 ms
71,244 KB
testcase_03 AC 71 ms
71,132 KB
testcase_04 AC 71 ms
71,288 KB
testcase_05 AC 71 ms
71,548 KB
testcase_06 AC 69 ms
71,044 KB
testcase_07 AC 67 ms
71,044 KB
testcase_08 AC 69 ms
71,412 KB
testcase_09 AC 69 ms
71,360 KB
testcase_10 AC 70 ms
71,288 KB
testcase_11 AC 71 ms
71,132 KB
testcase_12 AC 71 ms
71,360 KB
testcase_13 AC 104 ms
79,768 KB
testcase_14 AC 70 ms
71,296 KB
testcase_15 AC 84 ms
75,624 KB
testcase_16 AC 180 ms
97,920 KB
testcase_17 AC 213 ms
117,376 KB
testcase_18 AC 191 ms
111,476 KB
testcase_19 AC 187 ms
107,132 KB
testcase_20 AC 220 ms
113,008 KB
testcase_21 AC 197 ms
107,600 KB
testcase_22 AC 194 ms
107,852 KB
testcase_23 AC 201 ms
105,856 KB
testcase_24 AC 212 ms
107,320 KB
testcase_25 AC 196 ms
102,040 KB
testcase_26 AC 209 ms
112,912 KB
testcase_27 AC 209 ms
117,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k, Q = map(int, input().split())
query = [input().split() for _ in range(Q)]

h = n
w = n
se_h = set()
se_w = set()
ans = [0] * k
for a, b, c in query[::-1]:
    b = int(b)
    c = int(c) - 1
    if a == "R":
        if b in se_h:
            continue
        se_h.add(b)
        h -= 1
        ans[c] += w
    else:
        if b in se_w:
            continue
        se_w.add(b)
        w -= 1
        ans[c] += h

ans[0] = n * n - sum(ans[1:])
print(*ans, sep="\n")

        
0