結果

問題 No.106 素数が嫌い!2
ユーザー firiexpfiriexp
提出日時 2019-03-03 22:21:45
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 406 ms / 5,000 ms
コード長 282 bytes
コンパイル時間 10,033 ms
コンパイル使用メモリ 435,000 KB
実行使用メモリ 92,396 KB
最終ジャッジ日時 2024-04-30 19:59:12
合計ジャッジ時間 15,907 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 325 ms
75,764 KB
testcase_01 AC 266 ms
57,000 KB
testcase_02 AC 264 ms
56,848 KB
testcase_03 AC 268 ms
56,868 KB
testcase_04 AC 316 ms
75,728 KB
testcase_05 AC 325 ms
67,456 KB
testcase_06 AC 327 ms
65,268 KB
testcase_07 AC 325 ms
65,304 KB
testcase_08 AC 291 ms
59,324 KB
testcase_09 AC 309 ms
57,232 KB
testcase_10 AC 340 ms
65,380 KB
testcase_11 AC 306 ms
61,168 KB
testcase_12 AC 406 ms
92,396 KB
testcase_13 AC 267 ms
56,964 KB
testcase_14 AC 270 ms
56,916 KB
testcase_15 AC 266 ms
56,880 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(" ").map(String::toInt)
    val v = Array<Int>(n+1, {0})
    for (i in 2..n) {
        if (v[i] > 0) continue
        for (j in i..n step i){
            v[j]++
        }
    }
    println(v.filter{it >= k}.size)
}
0