結果

問題 No.60 魔法少女
ユーザー szkhtsszkhts
提出日時 2024-04-14 08:05:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 644 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 30,888 KB
最終ジャッジ日時 2024-04-14 08:05:58
合計ジャッジ時間 8,132 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 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, input().split())

x = []
y = []
hp = []
for i in range(n):
    xi, yi, hpi = map(int, input().split())
    x.append(xi)
    y.append(yi)
    hp.append(hpi)

ax = []
ay = []
w = []
h = []
d = []
for i in range(k):
    axi, ayi, wi, hi, di = map(int, input().split())
    ax.append(axi)
    ay.append(ayi)
    w.append(wi)
    h.append(hi)
    d.append(di)
    
for i in range(k):
    for j in range(n):
        if (ax[i] <= x[j] <= (ax[i] + w[i])) and (ay[i] <= y[j] <= (ay[i] + h[i])):
            hp[j] -= d[i]
            if hp[j] < 0:
                hp[j] = 0
ans = 0
for i in range(n):
    ans += hp[i]
         
print(ans)
0