結果

問題 No.648  お や す み 
ユーザー takayuki-ochiaitakayuki-ochiai
提出日時 2020-02-21 00:38:55
言語 Kotlin
(1.9.23)
結果
RE  
実行時間 -
コード長 403 bytes
コンパイル時間 11,276 ms
コンパイル使用メモリ 430,984 KB
実行使用メモリ 50,796 KB
最終ジャッジ日時 2024-04-17 06:36:40
合計ジャッジ時間 37,370 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 280 ms
49,640 KB
testcase_01 AC 276 ms
49,924 KB
testcase_02 AC 273 ms
49,832 KB
testcase_03 AC 287 ms
49,632 KB
testcase_04 AC 285 ms
49,744 KB
testcase_05 AC 274 ms
49,836 KB
testcase_06 AC 287 ms
49,812 KB
testcase_07 AC 283 ms
49,524 KB
testcase_08 AC 280 ms
49,744 KB
testcase_09 AC 284 ms
49,748 KB
testcase_10 AC 289 ms
49,860 KB
testcase_11 AC 276 ms
49,924 KB
testcase_12 AC 280 ms
49,696 KB
testcase_13 AC 283 ms
49,668 KB
testcase_14 AC 277 ms
49,604 KB
testcase_15 AC 276 ms
49,612 KB
testcase_16 AC 283 ms
49,492 KB
testcase_17 AC 279 ms
49,604 KB
testcase_18 AC 275 ms
49,772 KB
testcase_19 AC 282 ms
49,756 KB
testcase_20 AC 283 ms
49,824 KB
testcase_21 AC 279 ms
49,856 KB
testcase_22 AC 282 ms
49,964 KB
testcase_23 AC 280 ms
49,828 KB
testcase_24 AC 280 ms
49,716 KB
testcase_25 AC 285 ms
49,888 KB
testcase_26 AC 285 ms
49,540 KB
testcase_27 AC 286 ms
49,916 KB
testcase_28 AC 281 ms
49,792 KB
testcase_29 AC 295 ms
49,672 KB
testcase_30 AC 285 ms
50,104 KB
testcase_31 AC 286 ms
50,440 KB
testcase_32 AC 278 ms
50,320 KB
testcase_33 AC 281 ms
50,396 KB
testcase_34 AC 284 ms
50,344 KB
testcase_35 AC 277 ms
49,852 KB
testcase_36 AC 290 ms
49,796 KB
testcase_37 AC 295 ms
50,352 KB
testcase_38 AC 287 ms
50,264 KB
testcase_39 AC 283 ms
50,288 KB
testcase_40 AC 287 ms
50,740 KB
testcase_41 AC 284 ms
50,548 KB
testcase_42 AC 277 ms
50,428 KB
testcase_43 AC 286 ms
50,556 KB
testcase_44 AC 293 ms
49,996 KB
testcase_45 AC 292 ms
50,612 KB
testcase_46 AC 295 ms
50,132 KB
testcase_47 AC 284 ms
50,260 KB
testcase_48 AC 279 ms
50,268 KB
testcase_49 AC 288 ms
50,796 KB
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
testcase_63 RE -
testcase_64 RE -
testcase_65 RE -
testcase_66 RE -
testcase_67 RE -
testcase_68 RE -
testcase_69 RE -
testcase_70 RE -
testcase_71 RE -
testcase_72 RE -
testcase_73 RE -
testcase_74 RE -
testcase_75 RE -
testcase_76 RE -
testcase_77 RE -
testcase_78 RE -
testcase_79 RE -
testcase_80 RE -
testcase_81 RE -
testcase_82 AC 285 ms
49,840 KB
testcase_83 AC 275 ms
49,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val sheepNumber = readLine()?.toInt()

    var second = 1
    sheepNumber?.let {
        var restSheepNumber = sheepNumber
        while (restSheepNumber > 0) {
            restSheepNumber -= second
            second++
        }

        if (restSheepNumber == 0) {
            println("YES")
            println(second - 1)
        } else {
            println("NO")
        }
    }
}
0