結果

問題 No.1338 Giant Class
ユーザー KudeKude
提出日時 2021-01-15 21:46:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 356 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 85,844 KB
最終ジャッジ日時 2024-05-04 23:18:26
合計ジャッジ時間 6,561 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,504 KB
testcase_01 AC 40 ms
53,632 KB
testcase_02 AC 282 ms
76,800 KB
testcase_03 AC 42 ms
54,016 KB
testcase_04 AC 43 ms
55,040 KB
testcase_05 AC 52 ms
61,312 KB
testcase_06 AC 242 ms
83,304 KB
testcase_07 AC 337 ms
84,028 KB
testcase_08 AC 256 ms
83,688 KB
testcase_09 AC 247 ms
83,072 KB
testcase_10 AC 352 ms
85,032 KB
testcase_11 AC 104 ms
76,928 KB
testcase_12 AC 252 ms
81,484 KB
testcase_13 AC 241 ms
83,200 KB
testcase_14 AC 135 ms
77,696 KB
testcase_15 AC 155 ms
79,232 KB
testcase_16 AC 119 ms
76,928 KB
testcase_17 AC 256 ms
82,944 KB
testcase_18 AC 134 ms
77,696 KB
testcase_19 AC 167 ms
80,384 KB
testcase_20 AC 356 ms
85,720 KB
testcase_21 AC 346 ms
85,844 KB
testcase_22 AC 325 ms
85,248 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