結果

問題 No.451 575
ユーザー tailstails
提出日時 2016-12-02 00:21:45
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 31,616 KB
最終ジャッジ日時 2024-05-09 16:56:48
合計ジャッジ時間 5,231 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 4 ms
5,376 KB
testcase_05 AC 16 ms
6,656 KB
testcase_06 AC 41 ms
9,472 KB
testcase_07 AC 224 ms
31,104 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 4 ms
5,632 KB
testcase_10 AC 45 ms
11,776 KB
testcase_11 AC 131 ms
25,216 KB
testcase_12 AC 171 ms
31,488 KB
testcase_13 AC 122 ms
31,488 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 10 ms
6,272 KB
testcase_21 AC 5 ms
5,504 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 172 ms
31,360 KB
testcase_24 AC 102 ms
20,736 KB
testcase_25 AC 3 ms
5,376 KB
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 4 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 24 ms
7,552 KB
testcase_30 WA -
testcase_31 AC 4 ms
5,376 KB
testcase_32 AC 75 ms
14,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,@b)=<>;
@a=1;
for(0..2){
	$m=1e19;$o=-1e19;
	for(0..$#b){
		$v=$a[$_+1]=($b[$_]-$a[$_])*(-1)**$_;
		if($_%4==1||$_%4==2){
			$v=1e18+1-$v;
		}
		$m=$v if $m>$v;
		$o=$v if $o<$v;
	}
	if($m<1){
		$a[0]+=1-$m;
	}elsif($o>1e18){
		$a[0]-=$o-1e18;
	}else{
		print join$/,$n+1,@a;
		exit;
	}
}
print -1;
0