結果

問題 No.60 魔法少女
ユーザー Kude
提出日時 2020-09-07 09:34:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 3,083 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 122,816 KB
最終ジャッジ日時 2024-11-29 10:19:37
合計ジャッジ時間 30,283 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:2: SyntaxWarning: invalid decimal literal
  s=[[0]*M*4for _ in[0]*M*4]

ソースコード

diff #

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