結果

問題 No.1338 Giant Class
ユーザー rlangevinrlangevin
提出日時 2023-01-09 20:55:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 1,504 ms
コンパイル使用メモリ 86,624 KB
実行使用メモリ 85,868 KB
最終ジャッジ日時 2023-08-22 20:53:13
合計ジャッジ時間 5,840 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,912 KB
testcase_01 AC 74 ms
71,052 KB
testcase_02 AC 135 ms
77,384 KB
testcase_03 AC 75 ms
71,092 KB
testcase_04 AC 75 ms
71,232 KB
testcase_05 AC 77 ms
71,260 KB
testcase_06 AC 138 ms
84,212 KB
testcase_07 AC 156 ms
84,952 KB
testcase_08 AC 135 ms
83,284 KB
testcase_09 AC 135 ms
82,348 KB
testcase_10 AC 168 ms
85,868 KB
testcase_11 AC 94 ms
76,872 KB
testcase_12 AC 148 ms
81,760 KB
testcase_13 AC 127 ms
83,428 KB
testcase_14 AC 102 ms
77,972 KB
testcase_15 AC 106 ms
79,268 KB
testcase_16 AC 94 ms
76,232 KB
testcase_17 AC 129 ms
83,172 KB
testcase_18 AC 100 ms
77,796 KB
testcase_19 AC 107 ms
79,760 KB
testcase_20 AC 162 ms
85,472 KB
testcase_21 AC 167 ms
85,640 KB
testcase_22 AC 164 ms
85,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

H, W, Q = map(int, readline().split())
D = dict()
ans = H * W
for _ in range(Q):
    y, x = map(int, readline().split())
    if x not in D:
        ans -= H + 1 - y
        D[x] = y
    else:
        if y < D[x]:
            ans -= D[x] - y
            D[x] = y
    print(ans)
0