結果

問題 No.1338 Giant Class
ユーザー brthyyjpbrthyyjp
提出日時 2021-01-15 21:47:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 1,766 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 87,216 KB
最終ジャッジ日時 2023-08-17 16:41:52
合計ジャッジ時間 5,608 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,616 KB
testcase_01 AC 100 ms
71,668 KB
testcase_02 AC 151 ms
77,568 KB
testcase_03 AC 96 ms
71,680 KB
testcase_04 AC 96 ms
71,800 KB
testcase_05 AC 98 ms
71,748 KB
testcase_06 AC 152 ms
84,252 KB
testcase_07 AC 174 ms
87,128 KB
testcase_08 AC 156 ms
84,204 KB
testcase_09 AC 158 ms
84,068 KB
testcase_10 AC 189 ms
87,216 KB
testcase_11 AC 120 ms
78,012 KB
testcase_12 AC 169 ms
84,172 KB
testcase_13 AC 148 ms
83,064 KB
testcase_14 AC 122 ms
78,436 KB
testcase_15 AC 128 ms
79,900 KB
testcase_16 AC 119 ms
77,820 KB
testcase_17 AC 150 ms
84,128 KB
testcase_18 AC 122 ms
78,728 KB
testcase_19 AC 130 ms
80,568 KB
testcase_20 AC 181 ms
87,088 KB
testcase_21 AC 182 ms
87,168 KB
testcase_22 AC 176 ms
87,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import io, os
input = sys.stdin.buffer.readline

h,w,q = map(int,input().split())
ans = h*w
from collections import defaultdict
d = defaultdict(lambda:h+1)
for i in range(q):
    y, x = map(int, input().split())
    if y <= d[x]:
        ans -= d[x]-y
        d[x] = y
    print(ans)
0