結果

問題 No.1338 Giant Class
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-01-15 21:40:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 364 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 88,032 KB
最終ジャッジ日時 2023-08-17 16:27:01
合計ジャッジ時間 7,080 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,372 KB
testcase_01 AC 68 ms
71,412 KB
testcase_02 AC 303 ms
78,784 KB
testcase_03 AC 71 ms
71,168 KB
testcase_04 AC 73 ms
71,384 KB
testcase_05 AC 77 ms
75,460 KB
testcase_06 AC 255 ms
84,996 KB
testcase_07 AC 322 ms
86,208 KB
testcase_08 AC 250 ms
85,108 KB
testcase_09 AC 256 ms
84,572 KB
testcase_10 AC 349 ms
87,912 KB
testcase_11 AC 126 ms
78,800 KB
testcase_12 AC 292 ms
83,352 KB
testcase_13 AC 240 ms
84,688 KB
testcase_14 AC 137 ms
79,592 KB
testcase_15 AC 155 ms
81,108 KB
testcase_16 AC 123 ms
78,532 KB
testcase_17 AC 241 ms
84,688 KB
testcase_18 AC 134 ms
79,712 KB
testcase_19 AC 166 ms
81,708 KB
testcase_20 AC 356 ms
88,032 KB
testcase_21 AC 355 ms
87,980 KB
testcase_22 AC 364 ms
87,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, q = map(int, input().split())
d = dict()
ans = h * w
for _ in range(q):
    y, x = map(int, input().split())
    try:
        ans -= max(0, (h - y + 1) - d[x])
        d[x] = max(d[x], (h - y + 1))
    except:
        ans -= (h - y + 1)
        d[x] = (h - y + 1)
    print(ans)
0