結果

問題 No.106 素数が嫌い!2
ユーザー 👑 tatt61880tatt61880
提出日時 2021-03-20 19:21:25
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 154,180 KB
実行使用メモリ 19,212 KB
最終ジャッジ日時 2023-10-14 17:45:05
合計ジャッジ時間 3,381 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 20 ms
18,988 KB
testcase_07 AC 21 ms
19,060 KB
testcase_08 WA -
testcase_09 AC 3 ms
4,788 KB
testcase_10 AC 24 ms
19,212 KB
testcase_11 AC 12 ms
10,340 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var k: int :: cui@inputInt()
	if(k = 1)
		do cui@print("\{n - 1}\n")
		ret
	end if
	var i: int :: 2
	var a: []int :: #[n + 1]int
	while loop(i * i <= n)
		if(math@prime(i))
			var x: int :: i
			while(x <= n)
				do a[x] :+ 1
				do x :+ i
			end while
		end if
		do i :+ 1
	end while
	
	var ans: int :: 0
	for j(2, n)
		if(a[j] >= k)
			do ans :+ 1
		end if
	end for
	do cui@print("\{ans}\n")
end func
0