結果

問題 No.60 魔法少女
ユーザー TawaraTawara
提出日時 2015-12-12 23:40:37
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,537 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 6,524 KB
実行使用メモリ 55,476 KB
最終ジャッジ日時 2023-08-25 02:33:16
合計ジャッジ時間 15,413 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 410 ms
13,732 KB
testcase_01 AC 414 ms
13,904 KB
testcase_02 AC 409 ms
13,740 KB
testcase_03 AC 431 ms
19,768 KB
testcase_04 AC 1,033 ms
40,676 KB
testcase_05 AC 1,141 ms
54,364 KB
testcase_06 AC 1,482 ms
54,352 KB
testcase_07 AC 1,225 ms
49,996 KB
testcase_08 AC 963 ms
47,548 KB
testcase_09 AC 716 ms
41,284 KB
testcase_10 AC 1,440 ms
54,428 KB
testcase_11 AC 575 ms
41,312 KB
testcase_12 AC 928 ms
49,952 KB
testcase_13 AC 1,537 ms
55,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

f=lambda:map(int,raw_input().split());R=xrange;A=500;U=A*2+1
F=[[0]*(U+1)for i in R(U+1)];N,K=f();E=[f()for i in R(N)]
for i in R(K):x,y,w,h,d=f();x+=A;y+=A;r=min(U,x+w+1);t=min(U,y+h+1);F[y][x]+=d;F[y][r]-=d;F[t][x]-=d;F[t][r]+=d
for h in R(U+1):
	for w in R(U):F[h][w+1]+=F[h][w]
for w in R(U+1):
	for h in R(U):F[h+1][w]+=F[h][w]
print sum(max(0,h-F[y+A][x+A])for x,y,h in E)
0