結果

問題 No.60 魔法少女
ユーザー dangodango
提出日時 2023-07-09 20:52:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 445 ms / 5,000 ms
コード長 424 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 125,308 KB
最終ジャッジ日時 2023-10-01 00:48:43
合計ジャッジ時間 6,152 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
111,420 KB
testcase_01 AC 153 ms
111,608 KB
testcase_02 AC 155 ms
111,656 KB
testcase_03 AC 152 ms
111,568 KB
testcase_04 AC 322 ms
115,660 KB
testcase_05 AC 347 ms
123,828 KB
testcase_06 AC 432 ms
124,084 KB
testcase_07 AC 372 ms
121,024 KB
testcase_08 AC 317 ms
119,320 KB
testcase_09 AC 258 ms
115,140 KB
testcase_10 AC 420 ms
124,100 KB
testcase_11 AC 225 ms
115,044 KB
testcase_12 AC 307 ms
120,532 KB
testcase_13 AC 445 ms
125,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = [[0] * 2096 for _ in [0] * 2096]
n, k = map(int, input().split())
E = [list(map(int, input().split())) for _ in [0] * n]
for i in[-524] * k:
  x, y, w, h, d = map(int, input().split())
  for j in[0, 5, 9, 524]:
    s[x + j % -3 * ~w][y + j % -5 * ~h] += d * (-1)**j
while i < 524:
  s[i][j] += s[i-1][j] + s[i][j-1] - s[i-1][j-1]
  i += j > 524
  j += 1 - (j > 524) * 1048
print(sum(max(h - s[x][y], 0)for x, y, h in E))
0