結果

問題 No.1338 Giant Class
ユーザー H3PO4H3PO4
提出日時 2021-01-15 21:45:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 726 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 21,860 KB
最終ジャッジ日時 2023-08-17 16:38:07
合計ジャッジ時間 9,807 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,500 KB
testcase_01 AC 18 ms
8,596 KB
testcase_02 AC 665 ms
8,556 KB
testcase_03 AC 19 ms
8,616 KB
testcase_04 AC 20 ms
8,496 KB
testcase_05 AC 21 ms
8,568 KB
testcase_06 AC 458 ms
15,064 KB
testcase_07 AC 672 ms
21,776 KB
testcase_08 AC 466 ms
14,904 KB
testcase_09 AC 411 ms
15,136 KB
testcase_10 AC 720 ms
21,788 KB
testcase_11 AC 84 ms
9,252 KB
testcase_12 AC 530 ms
14,936 KB
testcase_13 AC 425 ms
14,948 KB
testcase_14 AC 130 ms
10,112 KB
testcase_15 AC 179 ms
11,840 KB
testcase_16 AC 74 ms
9,260 KB
testcase_17 AC 423 ms
15,108 KB
testcase_18 AC 124 ms
10,136 KB
testcase_19 AC 211 ms
11,668 KB
testcase_20 AC 719 ms
21,788 KB
testcase_21 AC 725 ms
21,844 KB
testcase_22 AC 726 ms
21,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

H, W, Q = map(int, input().split())
col = defaultdict(lambda: H)
cur = H * W

for _ in range(Q):
    Y, X = (int(x) - 1 for x in input().split())
    if col[X] > Y:
        cur -= col[X] - Y
        col[X] = Y
    print(cur)
0