結果

問題 No.106 素数が嫌い!2
ユーザー firiexpfiriexp
提出日時 2019-03-03 22:32:39
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 377 ms / 5,000 ms
コード長 275 bytes
コンパイル時間 12,262 ms
コンパイル使用メモリ 433,500 KB
実行使用メモリ 65,628 KB
最終ジャッジ日時 2024-04-30 20:01:13
合計ジャッジ時間 18,949 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 359 ms
61,452 KB
testcase_01 AC 316 ms
56,864 KB
testcase_02 AC 316 ms
56,776 KB
testcase_03 AC 315 ms
56,932 KB
testcase_04 AC 356 ms
61,412 KB
testcase_05 AC 373 ms
65,356 KB
testcase_06 AC 377 ms
65,528 KB
testcase_07 AC 372 ms
65,628 KB
testcase_08 AC 349 ms
57,184 KB
testcase_09 AC 351 ms
57,276 KB
testcase_10 AC 376 ms
65,428 KB
testcase_11 AC 354 ms
61,504 KB
testcase_12 AC 372 ms
65,516 KB
testcase_13 AC 314 ms
56,764 KB
testcase_14 AC 320 ms
56,956 KB
testcase_15 AC 316 ms
56,924 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 = IntArray(n+1, {0})
    for (i in 2..n) {
        if (v[i] > 0) continue
        for (j in i..n step i){
            v[j]++
        }
    }
    println(v.count {it >= k})
}
0