結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,323 ms
101,120 KB
testcase_01 AC 1,320 ms
101,376 KB
testcase_02 AC 1,303 ms
101,376 KB
testcase_03 AC 1,310 ms
100,096 KB
testcase_04 AC 1,640 ms
105,696 KB
testcase_05 AC 1,661 ms
113,076 KB
testcase_06 AC 1,897 ms
119,424 KB
testcase_07 AC 1,722 ms
115,048 KB
testcase_08 AC 1,551 ms
109,312 KB
testcase_09 AC 1,410 ms
102,528 KB
testcase_10 AC 1,854 ms
117,092 KB
testcase_11 AC 1,358 ms
98,944 KB
testcase_12 AC 1,519 ms
111,104 KB
testcase_13 AC 1,889 ms
121,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

A=$<.map{|s|s.split.map &:to_i}
m=(1..2e3).map{[0]*2e3}
A.pop(A.shift[1]).map{|x,y,w,h,d|m[x][y]+=d
m[a=x+w+1][b=y+h+1]+=d
m[x][b]-=d
m[a][y]-=d}
(R=-500..1e3).map{|x|R.map{|y|m[x+1][y]+=m[x][y]}}
R.map{|x|R.map{|y|m[x][y+1]+=m[x][y]}}
p A.map{|x,y,h|[0,h-m[x][y]].max}.sum
0