結果

問題 No.1338 Giant Class
ユーザー aqua_tenhouaqua_tenhou
提出日時 2021-01-15 21:43:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 624 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 21,384 KB
最終ジャッジ日時 2023-08-17 16:32:47
合計ジャッジ時間 8,684 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,836 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 578 ms
7,836 KB
testcase_03 AC 15 ms
7,796 KB
testcase_04 AC 17 ms
7,832 KB
testcase_05 AC 17 ms
7,892 KB
testcase_06 AC 386 ms
14,616 KB
testcase_07 AC 561 ms
21,308 KB
testcase_08 AC 371 ms
14,660 KB
testcase_09 AC 356 ms
14,540 KB
testcase_10 AC 614 ms
21,308 KB
testcase_11 AC 69 ms
8,936 KB
testcase_12 AC 453 ms
14,708 KB
testcase_13 AC 359 ms
14,564 KB
testcase_14 AC 105 ms
9,756 KB
testcase_15 AC 152 ms
11,276 KB
testcase_16 AC 64 ms
8,952 KB
testcase_17 AC 366 ms
14,652 KB
testcase_18 AC 107 ms
9,644 KB
testcase_19 AC 181 ms
11,248 KB
testcase_20 AC 624 ms
21,384 KB
testcase_21 AC 616 ms
21,352 KB
testcase_22 AC 603 ms
21,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,q = map(int,input().split())

dic = {}

ans = h*w
for i in range(q):
    y,x = map(int,input().split())
    
    if x in dic:
        if y < dic[x]:
            ans -= dic[x] - y
            dic[x] = y
    else:
        ans -= h+1 - y
        dic[x] = y
        
    print(ans)

0