結果

問題 No.431 死亡フラグ
ユーザー yamax3232yamax3232
提出日時 2017-02-09 21:57:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 3,636 ms
コンパイル使用メモリ 72,288 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-08-26 22:45:37
合計ジャッジ時間 5,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,020 KB
testcase_01 AC 112 ms
55,992 KB
testcase_02 AC 113 ms
55,888 KB
testcase_03 AC 116 ms
55,852 KB
testcase_04 AC 119 ms
55,748 KB
testcase_05 AC 117 ms
56,176 KB
testcase_06 AC 116 ms
54,172 KB
testcase_07 AC 117 ms
55,864 KB
testcase_08 AC 115 ms
56,072 KB
testcase_09 AC 111 ms
56,364 KB
testcase_10 AC 117 ms
55,552 KB
testcase_11 AC 124 ms
55,532 KB
testcase_12 AC 115 ms
56,208 KB
testcase_13 AC 112 ms
55,932 KB
testcase_14 AC 115 ms
55,864 KB
testcase_15 AC 112 ms
56,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class DeathFlag {
	public static void main(String[] args){
		Scanner kb=new Scanner(System.in);
		int s,df[]={0,0,0};
		int t=0;
		int count=0;
		for(int i=0;i<3;i++){
			df[i]=kb.nextInt();
		}
		s=kb.nextInt();
		if(s==1){
			System.out.println("SURVIVED");
		}else{
			for(int i=0;i<3;i++){
				if(df[i]==1){
					count++;
				}
			}
			if(count>=2&&t!=1){
				System.out.println("DEAD");
			}else if(t!=1){
				System.out.println("SURVIVED");	
			}
		}
	}
}
0