結果

問題 No.1120 Strange Teacher
ユーザー tailstails
提出日時 2020-07-22 21:59:03
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 5,292 KB
実行使用メモリ 29,060 KB
最終ジャッジ日時 2023-09-04 18:40:34
合計ジャッジ時間 3,480 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,516 KB
testcase_01 AC 3 ms
4,612 KB
testcase_02 AC 3 ms
4,736 KB
testcase_03 AC 14 ms
7,192 KB
testcase_04 AC 124 ms
28,960 KB
testcase_05 AC 120 ms
28,756 KB
testcase_06 AC 118 ms
28,824 KB
testcase_07 AC 119 ms
28,672 KB
testcase_08 AC 117 ms
28,616 KB
testcase_09 AC 2 ms
4,740 KB
testcase_10 AC 99 ms
28,800 KB
testcase_11 AC 98 ms
28,672 KB
testcase_12 AC 98 ms
28,784 KB
testcase_13 AC 98 ms
28,672 KB
testcase_14 AC 98 ms
28,828 KB
testcase_15 AC 98 ms
28,808 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 3 ms
4,496 KB
testcase_19 AC 119 ms
29,060 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,596 KB
testcase_23 AC 3 ms
4,636 KB
testcase_24 AC 116 ms
28,604 KB
testcase_25 AC 2 ms
4,668 KB
testcase_26 AC 2 ms
4,712 KB
testcase_27 AC 2 ms
4,676 KB
testcase_28 AC 2 ms
4,652 KB
testcase_29 AC 3 ms
4,620 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::u" used only once: possible typo at Main.pl line 15.
Main.pl syntax OK

ソースコード

diff #

sub muri { print -1; exit; }

$n=<>;
@a=<>=~/\S+/g;
@b=<>=~/\S+/g;
for(0..$n-1){
	$s-=$b[$_]-=$a[$_];
}

$n==2 ? $s==0 : $s%($n-2)==0 or muri;

$n==2 or $s/=$n-2;
for(0..$n-1){
	$b[$_]+$s&1 and muri;
	$t+=$u=($b[$_]+$s)/2;
}

$s==$t or muri;
print $s;
0