結果
問題 |
No.431 死亡フラグ
|
ユーザー |
|
提出日時 | 2018-03-19 18:05:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 403 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 26,880 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-02 20:16:43 |
合計ジャッジ時間 | 941 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d %d %d %d",&D1,&D2,&D3,&S); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ //input int D1,D2,D3,S; scanf("%d %d %d %d",&D1,&D2,&D3,&S); //output if (S){ printf("SURVIVED\n"); }else{ int count = 0; if (D1) count++; if (D2) count++; if (D3) count++; if (count < 2){ printf("SURVIVED\n"); }else{ printf("DEAD\n"); } } return 0; }