結果

問題 No.24 数当てゲーム
ユーザー furonfuron
提出日時 2023-05-31 15:15:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,392 bytes
コンパイル時間 1,171 ms
コンパイル使用メモリ 125,768 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-28 01:32:21
合計ジャッジ時間 1,837 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <string>
#include <queue>
#include <map>
#include <bitset>
#include <set>
#include <stack>
#include <numeric>
#include <unordered_map>
#include <random>

using namespace std;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;
const int inf = (1 << 30) - 1;
const ll INF = 1LL << 60;
const int MOD = 1000000007;
//const int MOD = 998244353;

int main() {
	int n;
	cin >> n;
	int ans = -1;
	vi num(10, -1);
	for (int i = 0; i < n; i++) {
		vb inp(10, false);
		for (int j = 0; j < 4; j++) {
			int a; cin >> a;
			inp[a] = true;
		}
		string s;
		cin >> s;
		if (s == "YES") {
			for (int j = 0; j < 10; j++) {
				if (inp[j]) {
					if (num[j] == -1) num[j] = 1;
				}
				else {
					num[j] = 0;
				}
			}
		}
		else {
			for (int j = 0; j < 10; j++) {
				if (inp[j]) {
					num[j] = 0;
				}
			}
		}
	}
	for (int i = 0; i < 10; i++) {
		if (num[i] == 1 || num[i] == -1) {
			cout << i << endl;
			break;
		}
	}
	
	return 0;
}
0