結果

問題 No.3709 Unknown Treasure
コンテスト
ユーザー kidodesu
提出日時 2026-09-11 21:26:02
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 241 ms / 2,000 ms
+ 159µs
コード長 412 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 71 ms
コンパイル使用メモリ 80,512 KB
実行使用メモリ 115,840 KB
最終ジャッジ日時 2026-09-11 21:26:30
合計ジャッジ時間 5,831 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

h, w, n = list(map(int, input().split()))
A = [[0 for _ in range(w+2)] for _ in range(h+2)]
for _ in range(n):
    y0, x0, y1, x1 = list(map(lambda x: int(x)-1, input().split()))
    A[y0][x0] += 1
    A[y0][x1+1] -= 1
    A[y1+1][x0] -= 1
    A[y1+1][x1+1] += 1

ans = 0
for y in range(h):
    for x in range(w):
        A[y][x] += A[y-1][x] + A[y][x-1] - A[y-1][x-1]
        if not A[y][x]: ans += 1
print(ans)
0