結果

問題 No.60 魔法少女
ユーザー takakintakakin
提出日時 2020-07-09 21:33:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 113,024 KB
最終ジャッジ日時 2024-04-17 01:25:50
合計ジャッジ時間 32,362 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,219 ms
28,160 KB
testcase_01 AC 1,278 ms
28,160 KB
testcase_02 AC 1,233 ms
28,416 KB
testcase_03 AC 1,299 ms
40,320 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,k=map(int,input().split())
XY=[]
for _ in range(n):
  XY.append(tuple(map(int,input().split())))
T=[[0]*(1502) for _ in range(1502)]
for _ in range(k):
  ax,ay,w,h,d=map(int,input().split())
  ax+=500
  ay+=500
  T[ax][ay]+=d
  T[ax+w+1][ay]-=d
  T[ax][ay+h+1]-=d
  T[ax+w+1][ay+h+1]+=d
for i in range(1,1502):
  for j in range(1,1502):
    T[i][j]+=T[i][j-1]
for i in range(1,1502):
  for j in range(1,1502):
    T[j][i]+=T[j-1][i]
ans=0
for x,y,hp in XY:
  x+=500
  y+=500
  ans+=max(0,hp-T[x][y])
print(ans)
0