結果

問題 No.648  お や す み 
ユーザー takayuki-ochiaitakayuki-ochiai
提出日時 2020-02-21 00:47:13
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 1,803 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 10,708 ms
コンパイル使用メモリ 431,416 KB
実行使用メモリ 49,944 KB
最終ジャッジ日時 2024-04-17 06:38:03
合計ジャッジ時間 69,081 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 265 ms
49,536 KB
testcase_01 AC 276 ms
49,812 KB
testcase_02 AC 275 ms
49,532 KB
testcase_03 AC 271 ms
49,696 KB
testcase_04 AC 280 ms
49,776 KB
testcase_05 AC 278 ms
49,632 KB
testcase_06 AC 275 ms
49,736 KB
testcase_07 AC 279 ms
49,836 KB
testcase_08 AC 281 ms
49,628 KB
testcase_09 AC 277 ms
49,732 KB
testcase_10 AC 274 ms
49,608 KB
testcase_11 AC 282 ms
49,664 KB
testcase_12 AC 273 ms
49,748 KB
testcase_13 AC 268 ms
49,760 KB
testcase_14 AC 282 ms
49,760 KB
testcase_15 AC 272 ms
49,532 KB
testcase_16 AC 279 ms
49,680 KB
testcase_17 AC 280 ms
49,528 KB
testcase_18 AC 275 ms
49,728 KB
testcase_19 AC 278 ms
49,548 KB
testcase_20 AC 274 ms
49,532 KB
testcase_21 AC 282 ms
49,664 KB
testcase_22 AC 277 ms
49,744 KB
testcase_23 AC 276 ms
49,920 KB
testcase_24 AC 292 ms
49,784 KB
testcase_25 AC 289 ms
49,520 KB
testcase_26 AC 289 ms
49,676 KB
testcase_27 AC 284 ms
49,716 KB
testcase_28 AC 277 ms
49,844 KB
testcase_29 AC 279 ms
49,536 KB
testcase_30 AC 275 ms
49,652 KB
testcase_31 AC 287 ms
49,624 KB
testcase_32 AC 289 ms
49,744 KB
testcase_33 AC 279 ms
49,664 KB
testcase_34 AC 279 ms
49,532 KB
testcase_35 AC 280 ms
49,748 KB
testcase_36 AC 275 ms
49,664 KB
testcase_37 AC 281 ms
49,724 KB
testcase_38 AC 292 ms
49,636 KB
testcase_39 AC 289 ms
49,696 KB
testcase_40 AC 283 ms
49,500 KB
testcase_41 AC 285 ms
49,684 KB
testcase_42 AC 286 ms
49,796 KB
testcase_43 AC 292 ms
49,528 KB
testcase_44 AC 288 ms
49,776 KB
testcase_45 AC 285 ms
49,752 KB
testcase_46 AC 275 ms
49,872 KB
testcase_47 AC 276 ms
49,944 KB
testcase_48 AC 278 ms
49,848 KB
testcase_49 AC 278 ms
49,684 KB
testcase_50 AC 283 ms
49,672 KB
testcase_51 AC 283 ms
49,792 KB
testcase_52 AC 282 ms
49,824 KB
testcase_53 AC 286 ms
49,732 KB
testcase_54 AC 289 ms
49,664 KB
testcase_55 AC 276 ms
49,868 KB
testcase_56 AC 282 ms
49,664 KB
testcase_57 AC 286 ms
49,752 KB
testcase_58 AC 291 ms
49,728 KB
testcase_59 AC 274 ms
49,820 KB
testcase_60 AC 1,733 ms
49,804 KB
testcase_61 AC 1,689 ms
49,652 KB
testcase_62 AC 1,702 ms
49,820 KB
testcase_63 AC 1,697 ms
49,628 KB
testcase_64 AC 1,694 ms
49,544 KB
testcase_65 AC 1,708 ms
49,696 KB
testcase_66 AC 1,781 ms
49,800 KB
testcase_67 AC 1,760 ms
49,664 KB
testcase_68 AC 1,723 ms
49,832 KB
testcase_69 AC 1,752 ms
49,708 KB
testcase_70 AC 1,304 ms
49,816 KB
testcase_71 AC 1,359 ms
49,728 KB
testcase_72 AC 1,673 ms
49,652 KB
testcase_73 AC 1,670 ms
49,876 KB
testcase_74 AC 1,718 ms
49,936 KB
testcase_75 AC 1,726 ms
49,836 KB
testcase_76 AC 1,739 ms
49,592 KB
testcase_77 AC 1,756 ms
49,772 KB
testcase_78 AC 1,803 ms
49,756 KB
testcase_79 AC 1,732 ms
49,704 KB
testcase_80 AC 1,745 ms
49,868 KB
testcase_81 AC 1,749 ms
49,812 KB
testcase_82 AC 292 ms
49,792 KB
testcase_83 AC 285 ms
49,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

            second++
        }

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