結果

問題 No.606 カラフルタイル
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-12-12 22:16:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 50,740 KB
最終ジャッジ日時 2023-09-28 15:55:01
合計ジャッジ時間 4,815 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,884 KB
testcase_01 AC 17 ms
7,864 KB
testcase_02 AC 18 ms
7,780 KB
testcase_03 AC 16 ms
7,920 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 17 ms
7,772 KB
testcase_06 AC 16 ms
7,788 KB
testcase_07 AC 17 ms
7,848 KB
testcase_08 AC 16 ms
7,768 KB
testcase_09 AC 17 ms
7,880 KB
testcase_10 AC 17 ms
7,768 KB
testcase_11 AC 16 ms
7,840 KB
testcase_12 AC 16 ms
7,860 KB
testcase_13 AC 26 ms
9,980 KB
testcase_14 AC 17 ms
7,788 KB
testcase_15 AC 17 ms
8,508 KB
testcase_16 AC 131 ms
31,712 KB
testcase_17 AC 223 ms
50,676 KB
testcase_18 AC 153 ms
39,504 KB
testcase_19 AC 152 ms
38,600 KB
testcase_20 AC 253 ms
48,560 KB
testcase_21 AC 169 ms
38,784 KB
testcase_22 AC 165 ms
38,652 KB
testcase_23 AC 197 ms
42,336 KB
testcase_24 AC 226 ms
44,724 KB
testcase_25 AC 193 ms
40,592 KB
testcase_26 AC 225 ms
50,528 KB
testcase_27 AC 225 ms
50,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
	import sys
	input = sys.stdin.readline
	N, C, q = map(int, input().split())
	gyo_cnt, ret_cnt = 0, 0
	gyo_visit, ret_visit = set(), set()
	Query = [input().split() for i in range(q)][::-1]
	ans = [0] * C
	for t, n, c in Query:
		n, c = int(n), int(c)
		n -= 1; c -= 1
		if t == "R":
			if n in gyo_visit: continue
			ans[c] += N - ret_cnt
			gyo_cnt += 1
			gyo_visit.add(n)
		else:
			if n in ret_visit: continue
			ans[c] += N - gyo_cnt
			ret_cnt += 1
			ret_visit.add(n)
	ans[0] = N ** 2 - sum(ans[1:])
	print(*ans, sep="\n")
if __name__ == '__main__':
	main()
	
0