結果

問題 No.1338 Giant Class
ユーザー roarisroaris
提出日時 2021-05-25 14:41:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 85,504 KB
最終ジャッジ日時 2024-04-22 02:00:48
合計ジャッジ時間 4,690 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
54,248 KB
testcase_01 AC 37 ms
54,188 KB
testcase_02 AC 98 ms
76,604 KB
testcase_03 AC 37 ms
55,292 KB
testcase_04 AC 39 ms
54,700 KB
testcase_05 AC 38 ms
54,916 KB
testcase_06 AC 100 ms
83,056 KB
testcase_07 AC 124 ms
84,576 KB
testcase_08 AC 102 ms
82,432 KB
testcase_09 AC 100 ms
82,136 KB
testcase_10 AC 125 ms
85,384 KB
testcase_11 AC 58 ms
75,168 KB
testcase_12 AC 116 ms
81,052 KB
testcase_13 AC 96 ms
82,048 KB
testcase_14 AC 67 ms
77,360 KB
testcase_15 AC 72 ms
78,944 KB
testcase_16 AC 59 ms
74,024 KB
testcase_17 AC 96 ms
82,816 KB
testcase_18 AC 67 ms
77,396 KB
testcase_19 AC 72 ms
79,504 KB
testcase_20 AC 117 ms
85,504 KB
testcase_21 AC 119 ms
85,244 KB
testcase_22 AC 120 ms
85,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

H, W, Q = map(int, input().split())
ans = H*W
d = defaultdict(lambda: H+1)

for _ in range(Q):
    Y, X = map(int, input().split())
    
    if Y<d[X]:
        ans -= d[X]-Y
        d[X] = Y
    
    print(ans)
0