結果

問題 No.1338 Giant Class
ユーザー U S
提出日時 2021-01-15 22:20:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 337 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 86,680 KB
最終ジャッジ日時 2024-11-26 16:01:43
合計ジャッジ時間 6,422 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys
# input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
import math
import bisect
from copy import deepcopy as dc
from itertools import accumulate
from collections import Counter, defaultdict, deque
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1

h,w,q = mp()
d = defaultdict(lambda :h+1)
ans = h*w
for _ in range(q):
    y,x = mp()
    if d[x] > y:
        ans -= d[x]-y
        d[x] = y
    print(ans)

0