結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2015-03-22 01:31:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 716 bytes |
| コンパイル時間 | 461 ms |
| コンパイル使用メモリ | 67,028 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 23:59:57 |
| 合計ジャッジ時間 | 964 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <set>
#include <vector>
using namespace std;
const int MOD = 1000003;
int main(int argc, char *argv[]) {
string s;
getline(cin, s);
int N = atoi(s.c_str());
int p[10] = {};
for (int i = 0; i < N; ++i) {
getline(cin, s);
stringstream ss(s);
int a, b, c, d;
string r;
ss >> a >> b >> c >> d >> r;
if (r.compare("YES") == 0) {
for (int j = 0; j < 10; ++j) {
if (j != a && j != b && j != c && j != d) {
p[j] = 1;
}
}
} else {
p[a] = p[b] = p[c] = p[d] = 1;
}
}
int ans = 0;
for (int j = 0; j < 10; ++j) {
if (!p[j]) {
ans = j;
break;
}
}
cout << ans << endl;
return 0;
}
hotpepsi