結果
| 問題 | 
                            No.192 合成数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2015-11-11 17:19:09 | 
| 言語 | Kotlin  (2.1.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 276 ms / 2,000 ms | 
| コード長 | 672 bytes | 
| コンパイル時間 | 12,633 ms | 
| コンパイル使用メモリ | 435,524 KB | 
| 実行使用メモリ | 54,324 KB | 
| 最終ジャッジ日時 | 2024-11-19 20:02:23 | 
| 合計ジャッジ時間 | 18,531 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 25 | 
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
            
            ソースコード
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)
    loop@
    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@loop
            }
        }
    }
}