結果

問題 No.546 オンリー・ワン
ユーザー tailstails
提出日時 2017-07-14 23:08:47
言語 Perl
(5.38.2)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2024-04-16 20:31:32
合計ジャッジ時間 2,484 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
12,672 KB
testcase_01 AC 50 ms
12,928 KB
testcase_02 AC 48 ms
12,800 KB
testcase_03 AC 53 ms
12,800 KB
testcase_04 AC 48 ms
12,800 KB
testcase_05 AC 50 ms
12,800 KB
testcase_06 AC 77 ms
12,800 KB
testcase_07 AC 114 ms
12,800 KB
testcase_08 AC 296 ms
12,928 KB
testcase_09 AC 311 ms
12,800 KB
testcase_10 AC 328 ms
12,800 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