結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
mh72012246
|
| 提出日時 | 2016-10-18 15:25:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 742 bytes |
| コンパイル時間 | 783 ms |
| コンパイル使用メモリ | 68,060 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-22 12:20:01 |
| 合計ジャッジ時間 | 1,349 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <cmath>
#include <vector>
#include <sstream> // istringstream
#include <algorithm> // sort
#include <utility> // pair
#include <cfloat> // DBL_MAX
typedef long long ll;
using namespace std;
int main(){
//// input
int N;
cin >> N;
//// main loop
vector<bool> poss(10, true);
int a,b,c,d;
string yn;
for(int i=0; i<N; i++){
cin >> a >> b >> c >> d >> yn;
if(yn=="YES"){
for(int i=0; i<10; i++){
if(i!=a&&i!=b&&i!=c&&i!=d){
poss[i] = false;
}
}
} else { // NO
poss[a]=poss[b]=poss[c]=poss[d] = false;
}
}
//// output
for(int i=0; i<10; i++){
if(poss[i]){
cout << i << endl;
break;
}
}
return 0;
}
mh72012246