問題一覧 > 通常問題

No.431 Death Flags

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 802
作問者 : くれちー / テスター : 小指が強い人
お気に入りにしたユーザー ProblemId : 1352 / 自分の提出
問題文最終更新日: 2026-06-25 01:27:15
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 151 (順位表) の他の問題:

Problem Statement

You are given the states of 3 death flags and 1 survival flag.
Determine whether the result is death or survival. The determination is made as follows.

  • If 2 or more death flags are raised, the result is death; if fewer than 2 are raised, the result is survival.
  • If the survival flag is raised, the result is survival regardless of the states of the death flags.

Input

$D_1$ $D_2$ $D_3$ $S$

$D_i\,$ is the state of death flag $\,i\,$ and $S\,$ is the state of the survival flag; each is given as $1\,$ or $\,0\,$.
$1\,$ means ON (the flag is raised) and $0\,$ means OFF (the flag is not raised).

Output

Print "DEAD" in the case of death and "SURVIVED" in the case of survival.
Print a newline at the end.

Sample

Sample 1
Input
0 1 0 0
Output
SURVIVED

Fewer than 2 death flags are raised, so the result is survival.

Sample 2
Input
1 1 1 0
Output
DEAD

2 or more death flags are raised, so the result is death.

Sample 3
Input
1 0 1 1
Output
SURVIVED

The survival flag is raised, so the result is survival regardless of the states of the death flags.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。