結果

問題 No.1338 Giant Class
ユーザー ryuusagiryuusagi
提出日時 2021-01-15 22:04:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 351 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 87,412 KB
最終ジャッジ日時 2023-08-17 17:11:50
合計ジャッジ時間 6,932 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,024 KB
testcase_01 AC 69 ms
70,996 KB
testcase_02 AC 303 ms
77,084 KB
testcase_03 AC 70 ms
70,964 KB
testcase_04 AC 72 ms
71,232 KB
testcase_05 AC 77 ms
74,920 KB
testcase_06 AC 256 ms
84,484 KB
testcase_07 AC 321 ms
85,688 KB
testcase_08 AC 251 ms
84,452 KB
testcase_09 AC 233 ms
83,896 KB
testcase_10 AC 351 ms
87,348 KB
testcase_11 AC 121 ms
78,388 KB
testcase_12 AC 274 ms
82,584 KB
testcase_13 AC 243 ms
84,460 KB
testcase_14 AC 137 ms
79,352 KB
testcase_15 AC 155 ms
80,672 KB
testcase_16 AC 122 ms
78,116 KB
testcase_17 AC 244 ms
84,636 KB
testcase_18 AC 140 ms
79,512 KB
testcase_19 AC 163 ms
81,716 KB
testcase_20 AC 338 ms
87,412 KB
testcase_21 AC 340 ms
87,148 KB
testcase_22 AC 339 ms
87,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,q = map(int, input().split())
d={}
a=w*h
for _ in range(q):
    y, x = map(int, input().split())
    if x not in d:
        d[x]=y
        a=a-(h-d[x])-1
    elif y<d[x]:
        a=a-(d[x]-y)
        d[x]=y
    print(a)
0