結果
問題 | No.60 魔法少女 |
ユーザー | mkawa2 |
提出日時 | 2020-01-09 12:35:08 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 842 ms / 5,000 ms |
コード長 | 983 bytes |
コンパイル時間 | 497 ms |
コンパイル使用メモリ | 10,972 KB |
実行使用メモリ | 68,464 KB |
最終ジャッジ日時 | 2023-08-15 01:14:21 |
合計ジャッジ時間 | 9,044 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 200 ms
15,944 KB |
testcase_01 | AC | 198 ms
15,988 KB |
testcase_02 | AC | 197 ms
15,852 KB |
testcase_03 | AC | 220 ms
23,868 KB |
testcase_04 | AC | 607 ms
50,964 KB |
testcase_05 | AC | 620 ms
67,548 KB |
testcase_06 | AC | 828 ms
67,224 KB |
testcase_07 | AC | 697 ms
62,048 KB |
testcase_08 | AC | 564 ms
58,956 KB |
testcase_09 | AC | 435 ms
51,816 KB |
testcase_10 | AC | 795 ms
67,524 KB |
testcase_11 | AC | 310 ms
51,892 KB |
testcase_12 | AC | 527 ms
62,112 KB |
testcase_13 | AC | 842 ms
68,464 KB |
ソースコード
import sys sys.setrecursionlimit(10 ** 6) p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def main(): n, k = MI() ene = [LI() for _ in range(n)] t = [[0] * 1001 for _ in range(1001)] for _ in range(k): j, i, w, h, d = MI() i, j = i + 500, j + 500 t[i][j] += d if i + h + 1 <= 1000 and j + w + 1 <= 1000: t[i + h + 1][j + w + 1] += d if i + h + 1 <= 1000: t[i + h + 1][j] -= d if j + w + 1 <= 1000: t[i][j + w + 1] -= d # p2D(t) for i in range(1001): ti = t[i] for j in range(1, 1001): ti[j] += ti[j - 1] for j in range(1001): for i in range(1, 1001): t[i][j] += t[i - 1][j] # p2D(t) ans = 0 for j, i, hp in ene: i, j = i + 500, j + 500 damage = t[i][j] if hp - damage > 0: ans += hp - damage print(ans) main()