結果

問題 No.431 死亡フラグ
ユーザー mura40424mura40424
提出日時 2016-12-18 13:38:54
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 310 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 13,852 ms
コンパイル使用メモリ 413,524 KB
実行使用メモリ 53,292 KB
最終ジャッジ日時 2023-08-12 17:17:50
合計ジャッジ時間 19,240 ms
ジャッジサーバーID
(参考情報)
judge11 / judge7
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 291 ms
53,080 KB
testcase_01 AC 292 ms
52,892 KB
testcase_02 AC 297 ms
52,660 KB
testcase_03 AC 295 ms
52,940 KB
testcase_04 AC 296 ms
52,868 KB
testcase_05 AC 295 ms
53,292 KB
testcase_06 AC 293 ms
52,912 KB
testcase_07 AC 291 ms
53,204 KB
testcase_08 AC 297 ms
53,020 KB
testcase_09 AC 295 ms
53,168 KB
testcase_10 AC 304 ms
52,756 KB
testcase_11 AC 307 ms
52,744 KB
testcase_12 AC 310 ms
52,688 KB
testcase_13 AC 306 ms
52,972 KB
testcase_14 AC 302 ms
52,772 KB
testcase_15 AC 297 ms
52,812 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