結果

問題 No.431 死亡フラグ
ユーザー mura40424mura40424
提出日時 2016-12-18 13:38:54
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 12,477 ms
コンパイル使用メモリ 430,496 KB
実行使用メモリ 57,084 KB
最終ジャッジ日時 2024-04-30 12:20:53
合計ジャッジ時間 15,962 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 283 ms
56,836 KB
testcase_01 AC 287 ms
56,832 KB
testcase_02 AC 281 ms
56,828 KB
testcase_03 AC 286 ms
56,828 KB
testcase_04 AC 284 ms
56,976 KB
testcase_05 AC 291 ms
56,864 KB
testcase_06 AC 286 ms
56,844 KB
testcase_07 AC 291 ms
56,840 KB
testcase_08 AC 290 ms
57,084 KB
testcase_09 AC 279 ms
56,840 KB
testcase_10 AC 284 ms
56,984 KB
testcase_11 AC 281 ms
56,952 KB
testcase_12 AC 281 ms
56,936 KB
testcase_13 AC 285 ms
56,988 KB
testcase_14 AC 284 ms
56,924 KB
testcase_15 AC 286 ms
56,932 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val flags : List<Int> = readLine()!!.split(" ").map { it.toInt() }
    if (isDead(flags)) {
        println("DEAD")
    } else {
        println("SURVIVED")
    }
}

fun isDead(flags : List<Int>) : Boolean {
    if (flags.last() == 1) {
        return false
    } else {
        return flags.sum() >= 2
    }
}
0