結果

問題 No.1152 10億ゲーム
ユーザー tailstails
提出日時 2020-08-09 04:17:50
言語 Perl
(5.38.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 5,356 KB
実行使用メモリ 24,360 KB
平均クエリ数 23.02
最終ジャッジ日時 2023-09-24 05:27:25
合計ジャッジ時間 6,258 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
24,012 KB
testcase_01 AC 63 ms
24,336 KB
testcase_02 AC 63 ms
24,348 KB
testcase_03 AC 63 ms
23,328 KB
testcase_04 AC 58 ms
23,580 KB
testcase_05 AC 59 ms
23,484 KB
testcase_06 AC 59 ms
23,988 KB
testcase_07 AC 59 ms
23,772 KB
testcase_08 AC 59 ms
23,304 KB
testcase_09 AC 57 ms
24,012 KB
testcase_10 AC 58 ms
23,676 KB
testcase_11 AC 59 ms
23,352 KB
testcase_12 AC 60 ms
23,400 KB
testcase_13 AC 59 ms
23,580 KB
testcase_14 AC 59 ms
23,760 KB
testcase_15 AC 59 ms
23,988 KB
testcase_16 AC 57 ms
23,616 KB
testcase_17 AC 61 ms
24,156 KB
testcase_18 AC 60 ms
24,000 KB
testcase_19 AC 62 ms
23,472 KB
testcase_20 AC 58 ms
23,940 KB
testcase_21 AC 58 ms
24,324 KB
testcase_22 AC 62 ms
23,340 KB
testcase_23 AC 59 ms
23,364 KB
testcase_24 AC 58 ms
23,808 KB
testcase_25 AC 59 ms
24,000 KB
testcase_26 AC 59 ms
23,820 KB
testcase_27 AC 59 ms
24,348 KB
testcase_28 AC 59 ms
23,472 KB
testcase_29 AC 60 ms
23,628 KB
testcase_30 AC 60 ms
23,328 KB
testcase_31 AC 58 ms
23,364 KB
testcase_32 AC 64 ms
24,288 KB
testcase_33 AC 63 ms
23,496 KB
testcase_34 AC 61 ms
24,000 KB
testcase_35 AC 59 ms
24,336 KB
testcase_36 AC 61 ms
24,012 KB
testcase_37 AC 58 ms
24,360 KB
testcase_38 AC 58 ms
23,484 KB
testcase_39 AC 58 ms
23,484 KB
testcase_40 AC 60 ms
23,928 KB
testcase_41 AC 59 ms
23,520 KB
testcase_42 AC 64 ms
23,352 KB
testcase_43 AC 58 ms
24,144 KB
testcase_44 AC 59 ms
23,988 KB
testcase_45 AC 58 ms
23,376 KB
testcase_46 AC 64 ms
23,760 KB
testcase_47 AC 58 ms
23,412 KB
testcase_48 AC 57 ms
23,520 KB
testcase_49 AC 59 ms
23,496 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

sub f{
	my($x,$i,$j)=@_;
	$x/=2,++$i while $x%2==0;
	$x/=5,++$j while $x%5==0;
	($i,$j);
}

($x,$y)=glob<>;
($i,$j)=f($x);
while(1){
	($k,$l)=f($y);
	exit if $k==$i && $l==$j;
	$d=abs($k-$i)-abs($l-$j);
	$d&1 ? $d>0 ? ($i+=$k<=>$i) : ($j+=$l<=>$j) :
	$j<9 ? ++$j : ($i+=7<=>$i||2);
	$|=print 2**$i*5**$j,$/;
	exit if $k==$i && $l==$j;
	$y=<>;
}
0