結果

問題 No.1338 Giant Class
ユーザー persimmon-persimmon
提出日時 2021-02-12 10:02:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 195 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 81,980 KB
実行使用メモリ 98,316 KB
最終ジャッジ日時 2024-07-19 04:30:05
合計ジャッジ時間 4,640 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,q=map(int,input().split())
yx=[list(map(int,input().split())) for _ in range(q)]
now=h*w
d={}
for y,x in yx:
  if x in d:
    if d[x]<y:
      pass
    else:
      now-=d[x]-y
      d[x]=y
  else:
    d[x]=y
    now-=h-y+1
  print(now)

0