結果

問題 No.1338 Giant Class
ユーザー 炭酸水炭酸水
提出日時 2022-05-19 20:17:41
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 673 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 11,888 KB
実行使用メモリ 23,328 KB
最終ジャッジ日時 2023-10-19 04:19:59
合計ジャッジ時間 9,849 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,148 KB
testcase_01 AC 30 ms
10,148 KB
testcase_02 AC 610 ms
10,184 KB
testcase_03 AC 31 ms
10,148 KB
testcase_04 AC 31 ms
10,148 KB
testcase_05 AC 34 ms
10,148 KB
testcase_06 AC 421 ms
16,600 KB
testcase_07 AC 607 ms
23,328 KB
testcase_08 AC 399 ms
16,588 KB
testcase_09 AC 373 ms
16,588 KB
testcase_10 AC 669 ms
23,328 KB
testcase_11 AC 88 ms
10,876 KB
testcase_12 AC 486 ms
16,588 KB
testcase_13 AC 391 ms
16,588 KB
testcase_14 AC 126 ms
11,768 KB
testcase_15 AC 184 ms
13,352 KB
testcase_16 AC 77 ms
10,876 KB
testcase_17 AC 393 ms
16,588 KB
testcase_18 AC 123 ms
11,664 KB
testcase_19 AC 197 ms
13,352 KB
testcase_20 AC 673 ms
23,328 KB
testcase_21 AC 670 ms
23,328 KB
testcase_22 AC 672 ms
23,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, q = map(int, input().split())
a = {}

ans = h * w
for _ in range(q):
    y, x = map(int, input().split())
    if a.get(x, -1) == -1:
        a[x] = y
        ans -= h - y + 1
    else:
        if a[x] > y:
            ans -= a[x] - y
            a[x] = y
    print(ans)
0