結果

問題 No.60 魔法少女
ユーザー tailstails
提出日時 2017-02-23 09:36:26
言語 Perl
(5.38.2)
結果
AC  
実行時間 2,491 ms / 5,000 ms
コード長 671 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 231,904 KB
最終ジャッジ日時 2023-08-30 21:16:54
合計ジャッジ時間 30,251 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,587 ms
185,472 KB
testcase_01 AC 1,571 ms
185,588 KB
testcase_02 AC 1,567 ms
185,368 KB
testcase_03 AC 1,578 ms
185,404 KB
testcase_04 AC 2,219 ms
216,260 KB
testcase_05 AC 1,935 ms
204,424 KB
testcase_06 AC 2,477 ms
230,852 KB
testcase_07 AC 2,288 ms
223,120 KB
testcase_08 AC 1,888 ms
199,424 KB
testcase_09 AC 1,700 ms
191,092 KB
testcase_10 AC 2,421 ms
229,384 KB
testcase_11 AC 1,646 ms
188,804 KB
testcase_12 AC 1,807 ms
198,668 KB
testcase_13 AC 2,491 ms
231,904 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::k" used only once: possible typo at Main.pl line 1.
Main.pl syntax OK

ソースコード

diff #

($n,$k)=glob<>;
$e[$_]=<>for 0..$n-1;

for(<>){
($x,$y,$w,$h,$d)=split;
$m{$x,$y}+=$d;
$m{$x+$w+1,$y}-=$d;
$m{$x,$y+$h+1}-=$d;
$m{$x+$w+1,$y+$h+1}+=$d;
}

for$y(@i=-500..500){
$s=0;
for$x(@i){
$l{$x,$y}+=$l{$x,$y-1}+($s=$m{$x,$y}+=$s);
}
}

for(@e){
($x,$y,$h)=split;
$r+=$-=$h-$l{$x,$y};
}

print$r;

########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
0