結果

問題 No.192 合成数
ユーザー javyjavy
提出日時 2015-11-11 17:16:02
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 9,466 ms
コンパイル使用メモリ 431,452 KB
実行使用メモリ 54,476 KB
最終ジャッジ日時 2024-04-30 06:22:53
合計ジャッジ時間 18,711 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 242 ms
54,224 KB
testcase_01 AC 241 ms
54,052 KB
testcase_02 AC 248 ms
54,204 KB
testcase_03 AC 255 ms
54,120 KB
testcase_04 AC 245 ms
54,112 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 247 ms
54,276 KB
testcase_09 AC 243 ms
54,232 KB
testcase_10 WA -
testcase_11 AC 243 ms
54,088 KB
testcase_12 WA -
testcase_13 AC 248 ms
54,128 KB
testcase_14 WA -
testcase_15 AC 248 ms
54,272 KB
testcase_16 WA -
testcase_17 AC 243 ms
54,240 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 245 ms
54,116 KB
testcase_22 AC 260 ms
54,128 KB
testcase_23 AC 243 ms
54,200 KB
testcase_24 AC 260 ms
54,360 KB
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

/**
 * Created by hichikawa on 2015/11/11.
 */
fun main(args: Array<String>) {
    fun readLineLong() : Long {
        val str = readLine() as String
        return str.toLong()
    }

    val  num = readLineLong()
    if (num != 2.toLong() && num % 2.toLong() == 0.toLong()) {
        println(num)
        return
    }

    val min = Math.max(4, num - 100)
    for (i in min..(num+100)) {
        if (i.toInt() % 2 == 0) {
            println(i)
            break
        }
        for (j in 3..(i-1) step 2) {
            if (i.toInt() % j.toInt() == 0) {
                println(i)
                break
            }
        }
    }
}
0