結果

問題 No.1338 Giant Class
ユーザー ayaoniayaoni
提出日時 2021-01-16 02:21:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 202 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 92,896 KB
最終ジャッジ日時 2023-08-17 20:21:55
合計ジャッジ時間 5,723 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,236 KB
testcase_01 AC 73 ms
71,492 KB
testcase_02 AC 152 ms
83,564 KB
testcase_03 AC 76 ms
71,468 KB
testcase_04 AC 78 ms
71,156 KB
testcase_05 AC 79 ms
71,304 KB
testcase_06 AC 157 ms
89,720 KB
testcase_07 AC 180 ms
91,564 KB
testcase_08 AC 152 ms
89,320 KB
testcase_09 AC 148 ms
89,164 KB
testcase_10 AC 190 ms
92,428 KB
testcase_11 AC 101 ms
78,052 KB
testcase_12 AC 170 ms
86,936 KB
testcase_13 AC 150 ms
88,012 KB
testcase_14 AC 103 ms
79,048 KB
testcase_15 AC 108 ms
80,168 KB
testcase_16 AC 102 ms
77,768 KB
testcase_17 AC 151 ms
87,892 KB
testcase_18 AC 109 ms
79,168 KB
testcase_19 AC 119 ms
81,024 KB
testcase_20 AC 201 ms
92,868 KB
testcase_21 AC 202 ms
92,820 KB
testcase_22 AC 200 ms
92,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


H,W,Q = MI()
YX = []
A = {}
for _ in range(Q):
    Y,X = MI()
    YX.append((Y,X))
    A[X] = H+1

ans = H*W
for i in range(Q):
    Y,X = YX[i]
    if A[X] > Y:
        ans -= A[X]-Y
        A[X] = Y
    print(ans)
0