結果

問題 No.431 死亡フラグ
ユーザー ika__siika__si
提出日時 2020-04-20 14:26:41
言語 Java19
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 1,459 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 70,872 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2023-07-28 16:21:36
合計ジャッジ時間 5,205 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,028 KB
testcase_01 AC 124 ms
56,164 KB
testcase_02 AC 126 ms
55,836 KB
testcase_03 AC 124 ms
56,024 KB
testcase_04 AC 125 ms
55,780 KB
testcase_05 AC 126 ms
55,780 KB
testcase_06 AC 126 ms
55,488 KB
testcase_07 AC 125 ms
56,016 KB
testcase_08 AC 125 ms
55,944 KB
testcase_09 AC 124 ms
55,840 KB
testcase_10 AC 126 ms
55,980 KB
testcase_11 AC 123 ms
55,648 KB
testcase_12 AC 126 ms
55,804 KB
testcase_13 AC 128 ms
55,940 KB
testcase_14 AC 124 ms
56,164 KB
testcase_15 AC 124 ms
56,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class Main {

  // int n = sc.nextInt();
  // long m = sc.nextLong();
  // String s = sc.next();

  // // 最大公約数
  // public static long gcd (long m,long n) {
  //   if (m < n) return gcd(n,m);
  //   if (n == 0) return m;
  //   return gcd(n,m%n);
  // }
  //
  // // 最小公倍数
  // public static long lcm (long m,long n) {
  //   return m*n/gcd(m,n);
  // }
  //
  // // 素数判定
  // public static boolean isPrime (long n) {
  //   if (n == 2) return true;
  //   if (n < 2 || n%2 == 0) return false;
  //   double d = Math.sqrt(n);
  //   for (int i = 3; i <= d; i+=2) {
  //     if (n%i == 0) {
  //       return false;
  //     }
  //   }
  //   return true;
  // }
  //
  // public static final long gcd3(long[] param) {
  //   int len = param.length;
  //   long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
  //   for (int i = 1; i < len - 1; i++) {
  //       g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
  //   }
  //   return g;
  // }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = 0;

    for (int i = 0; i < 3; i++) {
      n += sc.nextInt();
    }

    int s = sc.nextInt();

    if (s == 1) {
      System.out.println("SURVIVED");
    } else {
      if (n >= 2) {
        System.out.println("DEAD");
      } else {
        System.out.println("SURVIVED");
      }
    }

  }

}
0