結果

問題 No.431 死亡フラグ
ユーザー FVRChanFVRChan
提出日時 2017-10-03 00:12:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 1,736 ms
コンパイル使用メモリ 74,600 KB
実行使用メモリ 54,268 KB
最終ジャッジ日時 2024-04-27 18:17:58
合計ジャッジ時間 4,203 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
52,808 KB
testcase_01 AC 116 ms
54,028 KB
testcase_02 AC 108 ms
53,108 KB
testcase_03 AC 101 ms
52,764 KB
testcase_04 AC 118 ms
54,232 KB
testcase_05 AC 112 ms
54,244 KB
testcase_06 AC 114 ms
54,060 KB
testcase_07 AC 114 ms
54,192 KB
testcase_08 AC 117 ms
53,956 KB
testcase_09 AC 113 ms
54,268 KB
testcase_10 AC 98 ms
52,716 KB
testcase_11 AC 102 ms
54,156 KB
testcase_12 AC 103 ms
53,112 KB
testcase_13 AC 113 ms
54,004 KB
testcase_14 AC 111 ms
53,936 KB
testcase_15 AC 113 ms
54,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main{
	private static Scanner sc=new Scanner(System.in);
	public static void main(String args[])throws Exception{
		int s,d[]=new int[3];
		for(int i=0;i<d.length;i++)d[i]=sc.nextInt();
		s=sc.nextInt();
		if(s==1){
			System.out.println("SURVIVED");
		}else{
			int counter=0;
			for(int element:d){
				if(element==1)counter++;
			}
			if(counter>=2)System.out.println("DEAD");
			else System.out.println("SURVIVED");
		}
	}
}
0