結果

問題 No.606 カラフルタイル
ユーザー yuppe19 😺yuppe19 😺
提出日時 2017-12-06 21:13:36
言語 Python2
(2.7.18)
結果
AC  
実行時間 409 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 33,780 KB
最終ジャッジ日時 2024-05-06 17:07:12
合計ジャッジ時間 6,239 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,272 KB
testcase_01 AC 11 ms
6,144 KB
testcase_02 AC 16 ms
7,808 KB
testcase_03 AC 12 ms
6,144 KB
testcase_04 AC 11 ms
6,272 KB
testcase_05 AC 12 ms
6,144 KB
testcase_06 AC 11 ms
6,144 KB
testcase_07 AC 11 ms
6,272 KB
testcase_08 AC 11 ms
6,144 KB
testcase_09 AC 11 ms
6,272 KB
testcase_10 AC 11 ms
6,016 KB
testcase_11 AC 12 ms
6,400 KB
testcase_12 AC 12 ms
6,144 KB
testcase_13 AC 41 ms
7,296 KB
testcase_14 AC 14 ms
7,808 KB
testcase_15 AC 15 ms
6,400 KB
testcase_16 AC 318 ms
18,176 KB
testcase_17 AC 400 ms
32,984 KB
testcase_18 AC 352 ms
21,120 KB
testcase_19 AC 343 ms
20,736 KB
testcase_20 AC 409 ms
30,384 KB
testcase_21 AC 367 ms
22,016 KB
testcase_22 AC 362 ms
22,016 KB
testcase_23 AC 368 ms
25,472 KB
testcase_24 AC 398 ms
28,788 KB
testcase_25 AC 354 ms
26,204 KB
testcase_26 AC 394 ms
33,780 KB
testcase_27 AC 393 ms
33,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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))
0