結果

問題 No.1338 Giant Class
ユーザー 👑 H20H20
提出日時 2021-01-15 21:56:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 85,596 KB
最終ジャッジ日時 2024-05-04 23:38:48
合計ジャッジ時間 6,042 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,248 KB
testcase_01 AC 37 ms
54,144 KB
testcase_02 AC 269 ms
76,620 KB
testcase_03 AC 39 ms
54,272 KB
testcase_04 AC 46 ms
54,912 KB
testcase_05 AC 47 ms
60,928 KB
testcase_06 AC 238 ms
83,060 KB
testcase_07 AC 289 ms
84,232 KB
testcase_08 AC 221 ms
83,272 KB
testcase_09 AC 207 ms
83,108 KB
testcase_10 AC 317 ms
85,232 KB
testcase_11 AC 94 ms
77,032 KB
testcase_12 AC 243 ms
81,232 KB
testcase_13 AC 219 ms
83,120 KB
testcase_14 AC 112 ms
77,696 KB
testcase_15 AC 135 ms
79,232 KB
testcase_16 AC 92 ms
76,952 KB
testcase_17 AC 216 ms
83,016 KB
testcase_18 AC 109 ms
77,916 KB
testcase_19 AC 145 ms
80,032 KB
testcase_20 AC 319 ms
84,728 KB
testcase_21 AC 330 ms
85,588 KB
testcase_22 AC 325 ms
85,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
H,W,Q = map(int, input().split())
d = defaultdict(lambda: H)
ans = H*W
for i in range(Q):
    Y,X = map(int, input().split())
    if d[X]>=Y:
        ans -= d[X]-Y+1
        d[X]= Y-1
    print(ans)
0