結果

問題 No.207 世界のなんとか
ユーザー javyjavy
提出日時 2015-11-02 22:12:56
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 325 ms / 5,000 ms
コード長 731 bytes
コンパイル時間 11,573 ms
コンパイル使用メモリ 434,176 KB
実行使用メモリ 51,956 KB
最終ジャッジ日時 2024-04-30 03:01:35
合計ジャッジ時間 18,952 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 319 ms
51,524 KB
testcase_01 AC 315 ms
51,716 KB
testcase_02 AC 324 ms
51,664 KB
testcase_03 AC 317 ms
51,632 KB
testcase_04 AC 318 ms
51,608 KB
testcase_05 AC 316 ms
51,688 KB
testcase_06 AC 316 ms
51,688 KB
testcase_07 AC 317 ms
51,732 KB
testcase_08 AC 316 ms
51,420 KB
testcase_09 AC 319 ms
51,956 KB
testcase_10 AC 322 ms
51,516 KB
testcase_11 AC 320 ms
51,728 KB
testcase_12 AC 321 ms
51,616 KB
testcase_13 AC 325 ms
51,824 KB
testcase_14 AC 323 ms
51,784 KB
testcase_15 AC 320 ms
51,560 KB
testcase_16 AC 317 ms
51,588 KB
testcase_17 AC 319 ms
51,600 KB
testcase_18 AC 320 ms
51,744 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