結果
| 問題 |
No.606 カラフルタイル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-06 21:30:13 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 861 bytes |
| コンパイル時間 | 161 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 43,280 KB |
| 最終ジャッジ日時 | 2024-11-29 01:18:15 |
| 合計ジャッジ時間 | 27,801 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 8 TLE * 8 |
ソースコード
from collections import defaultdict
def main():
N, K, Q = map(int, input().split())
ABC = (tuple(input().split()) for _ in [0] * Q)
tile_r = defaultdict(int)
tile_c = defaultdict(int)
for a, b, c in ABC:
b = int(b)
c = int(c)
if a == 'R':
tile_r[b] = [c, N]
for i in tile_c.keys():
tile_c[i][1] -= 1
elif a == 'C':
tile_c[b] = [c, N]
for i in tile_r.keys():
tile_r[i][1] -= 1
color = defaultdict(int)
grey = N ** 2
for i, j in tile_c.values():
color[i] += j
if i > 1:
grey -= j
for i, j in tile_r.values():
color[i] += j
if i > 1:
grey -= j
print(grey)
for i in range(2, K + 1):
cnt = color.get(i, 0) + 1
print(color[i])
main()