結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-07 22:04:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 437 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 55,024 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 14:36:37 |
| 合計ジャッジ時間 | 773 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <iostream>
#define REP(i,n) for(int i=0;i<n;i++)
int main(){
int n, a[4];
std::string r;
bool no[10] = {false};
scanf("%d", &n);
while(n--){
scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
std::cin >> r;
if(r == "NO") REP(i,4) no[a[i]] = true;
else REP(i,10) if(i!=a[0] && i!=a[1] && i!=a[2] && i!=a[3]) no[i] = true;
}
REP(i,10){
if(no[i]==false){
printf("%d\n", i);
break;
}
}
}