結果

問題 No.431 死亡フラグ
ユーザー iYaipHiYaipH
提出日時 2016-11-19 12:15:32
言語 Crystal
(1.10.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 16,547 ms
コンパイル使用メモリ 255,452 KB
実行使用メモリ 4,464 KB
最終ジャッジ日時 2023-09-13 09:21:34
合計ジャッジ時間 17,525 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,392 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 2 ms
4,420 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,464 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 2 ms
4,420 KB
testcase_12 AC 2 ms
4,392 KB
testcase_13 AC 2 ms
4,428 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

 class Application
    def main
      puts judgment( cut_received_code(get_code) )
    end

    def judgment(value : Array) : String
      i = 0
      value.each{ |v| (i += 1) if v == 1  }
      return ( (value[3] == 0) ? (i >= 2 ? "DEAD" : "SURVIVED") : "SURVIVED")
    end

    def cut_received_code(value : String) : Array
      value.split(" ").map(&.to_i)
    end

    def get_code : String
      return gets.to_s.chomp
    end
 end

 Application.new.main
0