結果

問題 No.1338 Giant Class
ユーザー KudeKude
提出日時 2021-01-15 21:46:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 417 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 87,404 KB
最終ジャッジ日時 2023-08-17 16:40:03
合計ジャッジ時間 7,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,552 KB
testcase_01 AC 97 ms
71,424 KB
testcase_02 AC 358 ms
77,968 KB
testcase_03 AC 99 ms
71,548 KB
testcase_04 AC 104 ms
72,168 KB
testcase_05 AC 109 ms
76,092 KB
testcase_06 AC 304 ms
84,304 KB
testcase_07 AC 377 ms
86,748 KB
testcase_08 AC 292 ms
85,576 KB
testcase_09 AC 287 ms
84,108 KB
testcase_10 AC 407 ms
87,268 KB
testcase_11 AC 162 ms
78,320 KB
testcase_12 AC 328 ms
82,976 KB
testcase_13 AC 288 ms
83,508 KB
testcase_14 AC 176 ms
78,880 KB
testcase_15 AC 196 ms
80,448 KB
testcase_16 AC 156 ms
77,836 KB
testcase_17 AC 286 ms
84,432 KB
testcase_18 AC 175 ms
79,076 KB
testcase_19 AC 210 ms
80,780 KB
testcase_20 AC 403 ms
87,404 KB
testcase_21 AC 404 ms
87,284 KB
testcase_22 AC 417 ms
87,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
h, w, q = map(int, input().split())
now = h * w
d = defaultdict(lambda: h)
for _ in range(q):
    i, j = map(int, input().split())
    i -= 1
    j -= 1
    if i < d[j]:
        now -= d[j] - i
        d[j] = i
    print(now)
0