結果

問題 No.1338 Giant Class
ユーザー yakeshibayakeshiba
提出日時 2021-06-07 00:47:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 398 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 457 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 86,536 KB
最終ジャッジ日時 2023-08-15 14:49:33
合計ジャッジ時間 9,932 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,412 KB
testcase_01 AC 93 ms
71,508 KB
testcase_02 AC 341 ms
77,772 KB
testcase_03 AC 96 ms
71,404 KB
testcase_04 AC 99 ms
72,024 KB
testcase_05 AC 106 ms
76,336 KB
testcase_06 AC 293 ms
84,360 KB
testcase_07 AC 361 ms
85,780 KB
testcase_08 AC 284 ms
84,264 KB
testcase_09 AC 274 ms
83,576 KB
testcase_10 AC 398 ms
86,536 KB
testcase_11 AC 156 ms
78,280 KB
testcase_12 AC 320 ms
82,944 KB
testcase_13 AC 278 ms
83,352 KB
testcase_14 AC 167 ms
79,268 KB
testcase_15 AC 187 ms
80,572 KB
testcase_16 AC 150 ms
78,040 KB
testcase_17 AC 275 ms
84,292 KB
testcase_18 AC 171 ms
79,252 KB
testcase_19 AC 197 ms
80,828 KB
testcase_20 AC 397 ms
86,348 KB
testcase_21 AC 388 ms
86,332 KB
testcase_22 AC 387 ms
86,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

h, w, q = map(int,input().split())
occupied = defaultdict(lambda: h)
ans = h*w
for _ in range(q):
    y, x = map(lambda x:int(x)-1,input().split())
    if y < occupied[x]:
        ans -= abs(occupied[x]-y)
        occupied[x] = y
    print(ans)
    
0