結果

問題 No.60 魔法少女
ユーザー roiti46roiti46
提出日時 2015-02-18 02:58:47
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 555 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 6,744 KB
実行使用メモリ 67,216 KB
最終ジャッジ日時 2023-09-06 01:56:00
合計ジャッジ時間 10,054 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 639 ms
67,216 KB
testcase_01 AC 636 ms
21,684 KB
testcase_02 AC 637 ms
21,900 KB
testcase_03 AC 648 ms
27,784 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,raw_input().split())
M = [[0]*1001 for i in xrange(1001)]
for loop in xrange(N):
    x,y,hp = map(int,raw_input().split())
    x += 500; y += 500
    M[y][x] = hp

A = [[0]*1002 for i in xrange(1002)]
for loop in xrange(K):
    ax,ay,w,h,d = map(int,raw_input().split())
    ax += 500; ay += 500
    for y in xrange(ay,min(1001,ay+h+1)):
        A[y][ax] += d
        A[y][min(1001,ax+w+2)] -= d
ans = 0
for y in xrange(1001):
    for x in xrange(1001):
        if x > 0: A[y][x] += A[y][x-1]
        ans += max(0, M[y][x]-A[y][x])
print ans
0