結果

問題 No.1338 Giant Class
ユーザー ygd.ygd.
提出日時 2021-01-15 21:45:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 87,448 KB
最終ジャッジ日時 2023-08-17 16:39:06
合計ジャッジ時間 7,551 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,256 KB
testcase_01 AC 74 ms
70,980 KB
testcase_02 AC 359 ms
77,300 KB
testcase_03 AC 76 ms
71,224 KB
testcase_04 AC 79 ms
71,144 KB
testcase_05 AC 85 ms
75,148 KB
testcase_06 AC 277 ms
84,700 KB
testcase_07 AC 347 ms
85,556 KB
testcase_08 AC 269 ms
84,356 KB
testcase_09 AC 264 ms
84,056 KB
testcase_10 AC 379 ms
87,440 KB
testcase_11 AC 138 ms
78,564 KB
testcase_12 AC 304 ms
82,576 KB
testcase_13 AC 262 ms
84,696 KB
testcase_14 AC 154 ms
79,408 KB
testcase_15 AC 173 ms
80,604 KB
testcase_16 AC 136 ms
78,536 KB
testcase_17 AC 266 ms
84,704 KB
testcase_18 AC 152 ms
79,572 KB
testcase_19 AC 182 ms
81,604 KB
testcase_20 AC 377 ms
87,424 KB
testcase_21 AC 372 ms
87,260 KB
testcase_22 AC 378 ms
87,448 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 not in dic:
        dic[x] = y
        dame = H + 1 - y
    else:
        if y > dic[x]:
            dame = 0
        else:
            dame = dic[x] - y
            dic[x] = min(dic[x],y)
    ans -= dame
    print(ans)
0