結果

問題 No.106 素数が嫌い!2
ユーザー togatogatogatoga
提出日時 2016-04-26 13:50:43
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 43,136 KB
最終ジャッジ日時 2024-04-21 01:21:30
合計ジャッジ時間 27,284 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 3,900 ms
43,008 KB
testcase_08 WA -
testcase_09 AC 249 ms
43,008 KB
testcase_10 AC 3,891 ms
42,752 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 62 ms
39,296 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main (input) {
	input = input.split("\n");
	input = input[0].split(" ");
	var N = parseInt(input[0], 10);
	var K = parseInt(input[1], 10);
	ans = 0;
	for (var i = 2; i <= N; i++){
		var tmp = i;
		var k = 0;
		for (var j = 2; j * j <= tmp; j++){
			var ok = false;
			while (tmp % j == 0){
				ok = true;
				tmp = Math.floor(tmp / j);
			}
			if (ok){
				k += 1;
			}
		}
		if (k >= K){
			ans += 1;
		}
	}
	console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0