結果

問題 No.1490 スライムと爆弾
ユーザー convexineqconvexineq
提出日時 2021-04-23 22:49:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 526 ms / 2,000 ms
コード長 668 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 123,928 KB
最終ジャッジ日時 2023-09-17 12:50:54
合計ジャッジ時間 9,145 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,192 KB
testcase_01 AC 74 ms
71,512 KB
testcase_02 AC 83 ms
76,080 KB
testcase_03 AC 79 ms
75,880 KB
testcase_04 AC 83 ms
75,844 KB
testcase_05 AC 81 ms
75,852 KB
testcase_06 AC 80 ms
75,920 KB
testcase_07 AC 81 ms
76,200 KB
testcase_08 AC 80 ms
75,844 KB
testcase_09 AC 82 ms
75,784 KB
testcase_10 AC 83 ms
76,448 KB
testcase_11 AC 81 ms
75,752 KB
testcase_12 AC 80 ms
75,752 KB
testcase_13 AC 295 ms
97,292 KB
testcase_14 AC 345 ms
108,064 KB
testcase_15 AC 283 ms
96,792 KB
testcase_16 AC 270 ms
95,284 KB
testcase_17 AC 242 ms
98,944 KB
testcase_18 AC 371 ms
108,368 KB
testcase_19 AC 346 ms
104,188 KB
testcase_20 AC 295 ms
96,692 KB
testcase_21 AC 261 ms
93,944 KB
testcase_22 AC 305 ms
98,964 KB
testcase_23 AC 72 ms
71,364 KB
testcase_24 AC 74 ms
71,460 KB
testcase_25 AC 514 ms
122,776 KB
testcase_26 AC 526 ms
122,904 KB
testcase_27 AC 511 ms
122,880 KB
testcase_28 AC 409 ms
109,624 KB
testcase_29 AC 408 ms
109,540 KB
testcase_30 AC 511 ms
123,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

h,w,n,m = map(int,readline().split())
tulra = [list(map(int,readline().split())) for _ in range(n)]

b = [[0]*(w+2) for _ in range(h+2)]
for _ in range(m):
    x,y,d,c = map(int,readline().split())
    lx,rx,ly,ry = max(1,x-d), min(h,x+d)+1, max(1,y-d), min(w,y+d)+1
    b[lx][ly] += c
    b[rx][ly] -= c
    b[lx][ry] -= c
    b[rx][ry] += c
for _ in range(2):
    for i in range(h+2):
        for j in range(w+1):
            b[i][j+1] += b[i][j]
    for j in range(w+2):
        for i in range(h+1):
            b[i+1][j] += b[i][j]

print(sum(int(a > b[t-1][l-1] - b[u][l-1] - b[t-1][r] + b[u][r]) for t,u,l,r,a in tulra))
0