結果
| 問題 | No.606 カラフルタイル | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-12-06 21:13:36 | 
| 言語 | Python2 (2.7.18) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 418 ms / 2,000 ms | 
| コード長 | 621 bytes | 
| コンパイル時間 | 1,077 ms | 
| コンパイル使用メモリ | 7,076 KB | 
| 実行使用メモリ | 33,652 KB | 
| 最終ジャッジ日時 | 2024-11-29 01:17:29 | 
| 合計ジャッジ時間 | 7,150 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 | 
ソースコード
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
n, C, Q = map(int, raw_input().split())
seenR = [False] * n
seenC = [False] * n
r_inc, c_inc = n, n
cnt = [0] * C
Qs = []
for _ in xrange(Q):
    a, b, c = raw_input().split()
    b = int(b) - 1
    c = int(c) - 1
    Qs.append([a, b, c])
Qs.reverse()
for a, b, c in Qs:
    if a == 'R':
        if not seenR[b]:
            seenR[b] = True
            cnt[c] += r_inc
            c_inc -= 1
    else:
        if not seenC[b]:
            seenC[b] = True
            cnt[c] += c_inc
            r_inc -= 1
cnt[0] = n * n - sum(cnt[1:])
print '\n'.join(map(str, cnt))
            
            
            
        