結果

問題 No.1120 Strange Teacher
ユーザー tailstails
提出日時 2020-07-22 21:58:13
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 40,064 KB
最終ジャッジ日時 2023-09-04 18:36:41
合計ジャッジ時間 9,690 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,072 KB
testcase_01 AC 7 ms
5,292 KB
testcase_02 AC 12 ms
5,512 KB
testcase_03 AC 57 ms
8,484 KB
testcase_04 AC 529 ms
39,352 KB
testcase_05 AC 501 ms
39,376 KB
testcase_06 AC 490 ms
39,964 KB
testcase_07 AC 510 ms
39,604 KB
testcase_08 AC 477 ms
39,380 KB
testcase_09 AC 6 ms
5,088 KB
testcase_10 AC 509 ms
38,860 KB
testcase_11 AC 483 ms
38,980 KB
testcase_12 AC 498 ms
38,896 KB
testcase_13 AC 468 ms
39,484 KB
testcase_14 AC 464 ms
39,356 KB
testcase_15 AC 463 ms
39,340 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 6 ms
5,052 KB
testcase_19 AC 364 ms
39,248 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 6 ms
5,388 KB
testcase_23 AC 6 ms
5,120 KB
testcase_24 AC 363 ms
40,064 KB
testcase_25 AC 6 ms
5,052 KB
testcase_26 AC 6 ms
5,108 KB
testcase_27 AC 6 ms
5,224 KB
testcase_28 AC 6 ms
5,072 KB
testcase_29 AC 6 ms
5,268 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=glob<>;
@b=glob<>;
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