結果

問題 No.1338 Giant Class
ユーザー prussian_coderprussian_coder
提出日時 2022-06-18 20:12:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 355 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 85,836 KB
最終ジャッジ日時 2024-04-18 17:48:50
合計ジャッジ時間 7,093 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,456 KB
testcase_01 AC 33 ms
51,456 KB
testcase_02 AC 290 ms
76,416 KB
testcase_03 AC 37 ms
52,480 KB
testcase_04 AC 39 ms
52,992 KB
testcase_05 AC 49 ms
59,520 KB
testcase_06 AC 229 ms
82,348 KB
testcase_07 AC 288 ms
85,576 KB
testcase_08 AC 242 ms
82,460 KB
testcase_09 AC 220 ms
82,816 KB
testcase_10 AC 355 ms
85,836 KB
testcase_11 AC 105 ms
76,544 KB
testcase_12 AC 284 ms
81,288 KB
testcase_13 AC 236 ms
82,736 KB
testcase_14 AC 121 ms
77,316 KB
testcase_15 AC 138 ms
78,864 KB
testcase_16 AC 90 ms
76,288 KB
testcase_17 AC 236 ms
82,944 KB
testcase_18 AC 123 ms
77,312 KB
testcase_19 AC 145 ms
79,184 KB
testcase_20 AC 333 ms
85,364 KB
testcase_21 AC 325 ms
85,220 KB
testcase_22 AC 334 ms
85,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,Q=map(int,input().split())
ans=H*W
d=dict()
for i in range(Q):
	a,b=map(int,input().split())
	if not b in d:
		d[b]=a
		ans-=H-a+1
	else:
		if d[b]>a:
			ans-=d[b]-a
			d[b]=a
	print(ans)		
0