結果

問題 No.60 魔法少女
ユーザー letrangerjpletrangerjp
提出日時 2017-06-18 01:48:27
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,538 ms / 5,000 ms
コード長 250 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 162,792 KB
最終ジャッジ日時 2024-04-08 21:06:30
合計ジャッジ時間 19,672 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 921 ms
141,440 KB
testcase_01 AC 979 ms
141,440 KB
testcase_02 AC 957 ms
141,440 KB
testcase_03 AC 924 ms
141,440 KB
testcase_04 AC 1,243 ms
150,096 KB
testcase_05 AC 1,246 ms
152,720 KB
testcase_06 AC 1,538 ms
159,040 KB
testcase_07 AC 1,334 ms
156,556 KB
testcase_08 AC 1,171 ms
150,368 KB
testcase_09 AC 1,025 ms
144,640 KB
testcase_10 AC 1,484 ms
157,508 KB
testcase_11 AC 958 ms
142,976 KB
testcase_12 AC 1,133 ms
150,016 KB
testcase_13 AC 1,518 ms
162,792 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:7: warning: `&' interpreted as argument prefix
Syntax OK

ソースコード

diff #

A=$<.map{|s|s.split.map &:to_i}
m=(1..M=4*L=500).map{[0]*M}
A.pop(A.shift[1]).map{|x,y,w,h,d|m[x+=L][y+=L]+=d
m[a=x+w+1][b=y+h+1]+=d
m[x][b]-=d
m[a][y]-=d}
m=m.map(&f=->x{s=0;x.map{|y|s+=y}}).transpose.map &f
p A.map{|x,y,h|[0,h-m[y+L][x+L]].max}.sum
0