結果

問題 No.1338 Giant Class
ユーザー Akijin_007Akijin_007
提出日時 2023-05-11 19:31:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 231 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 100,060 KB
最終ジャッジ日時 2023-08-18 11:29:26
合計ジャッジ時間 7,833 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,384 KB
testcase_01 AC 73 ms
71,408 KB
testcase_02 AC 213 ms
88,252 KB
testcase_03 AC 75 ms
71,352 KB
testcase_04 AC 77 ms
71,516 KB
testcase_05 AC 83 ms
75,376 KB
testcase_06 AC 187 ms
92,648 KB
testcase_07 AC 220 ms
99,920 KB
testcase_08 AC 181 ms
92,876 KB
testcase_09 AC 182 ms
91,564 KB
testcase_10 AC 231 ms
99,084 KB
testcase_11 AC 119 ms
78,524 KB
testcase_12 AC 197 ms
92,692 KB
testcase_13 AC 177 ms
91,544 KB
testcase_14 AC 128 ms
80,196 KB
testcase_15 AC 137 ms
82,540 KB
testcase_16 AC 118 ms
78,060 KB
testcase_17 AC 176 ms
92,656 KB
testcase_18 AC 127 ms
80,212 KB
testcase_19 AC 140 ms
82,832 KB
testcase_20 AC 229 ms
100,060 KB
testcase_21 AC 227 ms
99,988 KB
testcase_22 AC 229 ms
100,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

H, W, Q = map(int, input().split())

z = [0] * Q
for i in range(Q):
    z[i] = list(map(int, input().split()))


ans = H*W
d = dict()

for i in range(Q):
    y, x = z[i]
    if x not in d:
        ans -= H - y + 1
        d[x] = y
    else:
        ans -= d[x] - min(d[x], y)
        d[x] = min(d[x], y)

    print(ans)

0