結果

問題 No.1338 Giant Class
ユーザー roarisroaris
提出日時 2021-05-25 14:41:00
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 192 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 87,428 KB
最終ジャッジ日時 2023-08-04 03:35:27
合計ジャッジ時間 8,338 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,728 KB
testcase_01 AC 90 ms
71,632 KB
testcase_02 AC 150 ms
77,980 KB
testcase_03 AC 92 ms
71,436 KB
testcase_04 AC 101 ms
71,624 KB
testcase_05 AC 104 ms
72,264 KB
testcase_06 AC 154 ms
84,468 KB
testcase_07 AC 176 ms
87,428 KB
testcase_08 AC 155 ms
84,224 KB
testcase_09 AC 154 ms
84,592 KB
testcase_10 AC 192 ms
87,428 KB
testcase_11 AC 115 ms
78,156 KB
testcase_12 AC 170 ms
82,752 KB
testcase_13 AC 145 ms
84,976 KB
testcase_14 AC 112 ms
78,988 KB
testcase_15 AC 121 ms
80,376 KB
testcase_16 AC 110 ms
77,884 KB
testcase_17 AC 145 ms
85,140 KB
testcase_18 AC 113 ms
79,012 KB
testcase_19 AC 122 ms
80,252 KB
testcase_20 AC 181 ms
87,068 KB
testcase_21 AC 178 ms
86,796 KB
testcase_22 AC 177 ms
86,904 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