結果
問題 |
No.431 死亡フラグ
|
ユーザー |
![]() |
提出日時 | 2019-03-22 21:21:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 366 bytes |
コンパイル時間 | 1,806 ms |
コンパイル使用メモリ | 165,312 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 02:36:23 |
合計ジャッジ時間 | 2,998 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 3 |
コンパイルメッセージ
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; | ^
ソースコード
#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; } }