結果

問題 No.1338 Giant Class
ユーザー Kiri8128Kiri8128
提出日時 2021-01-15 23:14:12
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 722 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 21,840 KB
最終ジャッジ日時 2023-08-17 18:24:40
合計ジャッジ時間 9,669 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,584 KB
testcase_01 AC 19 ms
8,460 KB
testcase_02 AC 631 ms
8,568 KB
testcase_03 AC 19 ms
8,608 KB
testcase_04 AC 21 ms
8,500 KB
testcase_05 AC 21 ms
8,608 KB
testcase_06 AC 449 ms
14,920 KB
testcase_07 AC 646 ms
21,840 KB
testcase_08 AC 417 ms
15,100 KB
testcase_09 AC 393 ms
15,088 KB
testcase_10 AC 707 ms
21,728 KB
testcase_11 AC 87 ms
9,352 KB
testcase_12 AC 506 ms
14,992 KB
testcase_13 AC 412 ms
15,084 KB
testcase_14 AC 125 ms
10,232 KB
testcase_15 AC 176 ms
11,752 KB
testcase_16 AC 70 ms
9,240 KB
testcase_17 AC 420 ms
15,084 KB
testcase_18 AC 121 ms
10,136 KB
testcase_19 AC 202 ms
11,760 KB
testcase_20 AC 716 ms
21,660 KB
testcase_21 AC 711 ms
21,700 KB
testcase_22 AC 722 ms
21,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
D = defaultdict(int)
H, W, Q = map(int, input().split())
s = H * W
for _ in range(Q):
    i, j = map(int, input().split())
    i, j = H - i + 1, j - 1
    if i > D[j]:
        s -= i - D[j]
        D[j] = i
    print(s)
0