結果
問題 |
No.431 死亡フラグ
|
ユーザー |
![]() |
提出日時 | 2017-05-03 21:37:04 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 907 bytes |
コンパイル時間 | 2,391 ms |
コンパイル使用メモリ | 79,528 KB |
実行使用メモリ | 38,212 KB |
最終ジャッジ日時 | 2024-09-14 07:10:12 |
合計ジャッジ時間 | 4,325 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Stream; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); int[] flags = Stream.of(inputs).mapToInt(Integer::parseInt).toArray(); if(flags[3]==1) { System.out.println("SURVIVED"); } else { int deadCounter = 0; for (int i = 0; i < 3; i++) { if (flags[i] == 1) { deadCounter += 1; } } if(deadCounter>=2){ System.out.println("DEAD"); } else { System.out.println("SURVIVED"); } } } }