結果

問題 No.1338 Giant Class
ユーザー shotoyooshotoyoo
提出日時 2021-01-15 21:49:32
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 95,320 KB
最終ジャッジ日時 2023-08-17 16:45:40
合計ジャッジ時間 4,799 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,348 KB
testcase_01 AC 75 ms
71,340 KB
testcase_02 AC 122 ms
84,676 KB
testcase_03 AC 73 ms
71,400 KB
testcase_04 AC 73 ms
71,316 KB
testcase_05 AC 73 ms
71,284 KB
testcase_06 AC 125 ms
88,080 KB
testcase_07 AC 144 ms
91,292 KB
testcase_08 AC 124 ms
88,148 KB
testcase_09 AC 122 ms
87,976 KB
testcase_10 AC 153 ms
91,688 KB
testcase_11 AC 84 ms
77,152 KB
testcase_12 AC 129 ms
86,624 KB
testcase_13 AC 121 ms
88,392 KB
testcase_14 AC 94 ms
79,076 KB
testcase_15 AC 97 ms
81,392 KB
testcase_16 AC 86 ms
77,352 KB
testcase_17 AC 123 ms
88,496 KB
testcase_18 AC 93 ms
79,316 KB
testcase_19 AC 101 ms
82,360 KB
testcase_20 AC 152 ms
95,320 KB
testcase_21 AC 153 ms
95,320 KB
testcase_22 AC 151 ms
95,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
_print = lambda *x: print(*x, file=sys.stderr)

h,w,q = list(map(int, input().split()))
d = {}
ans = 0
res = []
for i in range(q):
    y,x = map(int, input().split())
    if x in d:
        if d[x]>y:
            ans += (d[x]-y)
            d[x] = y
    else:
        ans += h - (y-1)
        d[x] = y
    res.append(h*w-ans)
write("\n".join(map(str, res)))
0