結果

問題 No.1338 Giant Class
ユーザー mkawa2mkawa2
提出日時 2021-01-16 02:19:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 892 bytes
コンパイル時間 993 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 21,516 KB
最終ジャッジ日時 2023-08-17 20:19:43
合計ジャッジ時間 4,839 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 197 ms
8,268 KB
testcase_03 AC 16 ms
7,796 KB
testcase_04 AC 17 ms
7,704 KB
testcase_05 AC 17 ms
8,280 KB
testcase_06 AC 153 ms
14,848 KB
testcase_07 AC 216 ms
21,516 KB
testcase_08 AC 143 ms
14,840 KB
testcase_09 AC 135 ms
14,680 KB
testcase_10 AC 230 ms
21,416 KB
testcase_11 AC 35 ms
9,144 KB
testcase_12 AC 177 ms
14,756 KB
testcase_13 AC 141 ms
14,684 KB
testcase_14 AC 48 ms
9,768 KB
testcase_15 AC 66 ms
11,448 KB
testcase_16 AC 33 ms
9,088 KB
testcase_17 AC 138 ms
14,712 KB
testcase_18 AC 48 ms
9,792 KB
testcase_19 AC 75 ms
11,548 KB
testcase_20 AC 242 ms
21,488 KB
testcase_21 AC 235 ms
21,424 KB
testcase_22 AC 238 ms
21,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def MI(): return map(int, sys.stdin.buffer.readline().split())
def MI1(): return map(int1, sys.stdin.buffer.readline().split())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
inf = 10**19
# md = 998244353
md = 10**9+7

h,w,q=MI()
top={}
ans=h*w
for _ in range(q):
    i,j=MI()
    if j in top:
        if i<top[j]:
            ans+=-top[j]+i
            top[j]=i
    else:
        ans-=h-i+1
        top[j]=i
    print(ans)
0