結果

問題 No.1338 Giant Class
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-02-12 10:02:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 223 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 100,120 KB
最終ジャッジ日時 2023-09-26 09:32:47
合計ジャッジ時間 6,737 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,276 KB
testcase_01 AC 69 ms
71,236 KB
testcase_02 AC 192 ms
88,208 KB
testcase_03 AC 71 ms
71,256 KB
testcase_04 AC 73 ms
71,364 KB
testcase_05 AC 77 ms
75,336 KB
testcase_06 AC 180 ms
92,652 KB
testcase_07 AC 209 ms
99,632 KB
testcase_08 AC 172 ms
92,792 KB
testcase_09 AC 171 ms
91,572 KB
testcase_10 AC 219 ms
97,632 KB
testcase_11 AC 112 ms
78,496 KB
testcase_12 AC 187 ms
92,616 KB
testcase_13 AC 170 ms
91,448 KB
testcase_14 AC 122 ms
80,324 KB
testcase_15 AC 129 ms
82,580 KB
testcase_16 AC 111 ms
78,012 KB
testcase_17 AC 170 ms
92,612 KB
testcase_18 AC 123 ms
80,612 KB
testcase_19 AC 133 ms
82,892 KB
testcase_20 AC 223 ms
100,120 KB
testcase_21 AC 222 ms
99,812 KB
testcase_22 AC 221 ms
99,944 KB
権限があれば一括ダウンロードができます

ソースコード

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