結果

問題 No.431 死亡フラグ
ユーザー Kazu05Kazu05
提出日時 2019-03-22 21:21:49
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 366 bytes
コンパイル時間 1,522 ms
コンパイル使用メモリ 166,276 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 06:16:19
合計ジャッジ時間 2,321 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:12:26: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized]
   12 |                         a++;
      |                         ~^~
main.cpp:8:13: note: 'a' was declared here
    8 |         int a;
      |             ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	cin.sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int d[10];
	int s;
	int a;
	for (int i = 0; i < 3; i++) {
		cin >> d[i];
		if (d[i] == 1) {
			a++;
		}
	}
	cin >> s;
	if (s == 1) {
		cout << "SURVIVED" << endl;
	} else if (a >= 2) {
		cout << "DEAD" << endl;
	} else {
		cout << "SURVIVED" << endl;
	}
}
0