結果

問題 No.207 世界のなんとか
ユーザー javyjavy
提出日時 2015-11-02 22:12:56
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 302 ms / 5,000 ms
コード長 731 bytes
コンパイル時間 15,371 ms
コンパイル使用メモリ 417,944 KB
実行使用メモリ 53,104 KB
最終ジャッジ日時 2023-08-12 13:11:10
合計ジャッジ時間 21,362 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
52,964 KB
testcase_01 AC 291 ms
52,852 KB
testcase_02 AC 302 ms
52,976 KB
testcase_03 AC 297 ms
52,812 KB
testcase_04 AC 288 ms
53,036 KB
testcase_05 AC 297 ms
52,936 KB
testcase_06 AC 282 ms
52,904 KB
testcase_07 AC 296 ms
52,952 KB
testcase_08 AC 278 ms
52,800 KB
testcase_09 AC 281 ms
53,104 KB
testcase_10 AC 288 ms
52,888 KB
testcase_11 AC 287 ms
52,844 KB
testcase_12 AC 281 ms
52,876 KB
testcase_13 AC 284 ms
52,808 KB
testcase_14 AC 294 ms
52,708 KB
testcase_15 AC 283 ms
52,928 KB
testcase_16 AC 291 ms
52,776 KB
testcase_17 AC 291 ms
52,816 KB
testcase_18 AC 288 ms
52,776 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

/**
 * Created by hichikawa on 2015/11/01.
 */

fun main(args: Array<String>) {
    fun readLineIntArray() : List<Int> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toInt() }
        return ret
    }
    fun is3Times(num : Int) : Boolean {
        return (num % 3 ==0)
    }
    fun isEnclude3(num : Int) : Boolean {
        if (num == 0)
            return false
        else if (num % 10 == 3)
            return true
        else
            return isEnclude3(num / 10)
    }

    val inputNums = readLineIntArray()
    val numA = inputNums[0]
    val numB = inputNums[1]
    for(i in numA..numB) {
    if(is3Times(i) || isEnclude3(i))
        println(i)
    }
}
0