結果

問題 No.606 カラフルタイル
ユーザー yuppe19 😺yuppe19 😺
提出日時 2017-12-06 21:13:36
言語 Python2
(2.7.18)
結果
AC  
実行時間 355 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 1,091 ms
コンパイル使用メモリ 6,536 KB
実行使用メモリ 33,372 KB
最終ジャッジ日時 2023-08-19 09:52:55
合計ジャッジ時間 6,592 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
5,988 KB
testcase_01 AC 10 ms
5,936 KB
testcase_02 AC 11 ms
7,252 KB
testcase_03 AC 10 ms
6,016 KB
testcase_04 AC 9 ms
5,812 KB
testcase_05 AC 9 ms
5,968 KB
testcase_06 AC 10 ms
5,848 KB
testcase_07 AC 9 ms
5,976 KB
testcase_08 AC 10 ms
5,852 KB
testcase_09 AC 10 ms
5,928 KB
testcase_10 AC 9 ms
6,008 KB
testcase_11 AC 10 ms
5,932 KB
testcase_12 AC 10 ms
5,944 KB
testcase_13 AC 35 ms
6,920 KB
testcase_14 AC 13 ms
7,356 KB
testcase_15 AC 13 ms
5,944 KB
testcase_16 AC 278 ms
17,572 KB
testcase_17 AC 331 ms
32,564 KB
testcase_18 AC 307 ms
20,812 KB
testcase_19 AC 306 ms
20,432 KB
testcase_20 AC 354 ms
29,732 KB
testcase_21 AC 311 ms
21,520 KB
testcase_22 AC 334 ms
21,584 KB
testcase_23 AC 310 ms
25,108 KB
testcase_24 AC 333 ms
28,228 KB
testcase_25 AC 316 ms
25,560 KB
testcase_26 AC 355 ms
33,372 KB
testcase_27 AC 341 ms
33,188 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