結果

問題 No.431 死亡フラグ
ユーザー yamax3232
提出日時 2017-02-09 21:57:10
言語 Java
(openjdk 23)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 6,341 ms
コンパイル使用メモリ 74,640 KB
実行使用メモリ 41,352 KB
最終ジャッジ日時 2024-12-26 02:19:12
合計ジャッジ時間 8,290 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

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