結果

問題 No.546 オンリー・ワン
ユーザー tailstails
提出日時 2017-07-14 23:08:47
言語 Perl
(5.38.0)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 11,608 KB
実行使用メモリ 11,572 KB
最終ジャッジ日時 2023-07-29 14:39:42
合計ジャッジ時間 2,345 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
11,364 KB
testcase_01 AC 38 ms
11,364 KB
testcase_02 AC 36 ms
11,348 KB
testcase_03 AC 37 ms
11,396 KB
testcase_04 AC 35 ms
11,572 KB
testcase_05 AC 36 ms
11,316 KB
testcase_06 AC 57 ms
11,488 KB
testcase_07 AC 85 ms
11,352 KB
testcase_08 AC 232 ms
11,396 KB
testcase_09 AC 243 ms
11,352 KB
testcase_10 AC 259 ms
11,488 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,$l,$h)=glob<>;
@c=glob<>;
for$k(1..2**$n-1){
	{
		use bigint;
		$a=1;
	}
	$c=0;
	for$i(0..$n-1){
		if($k&1<<$i){
			$a=$a->blcm($c[$i]);
			++$c;
		}
	}
	$r+=(int($h/$a)-int(($l-1)/$a))*$c*(-1)**($c-1);
}

print $r;
0