結果

問題 No.24 数当てゲーム
ユーザー ub_nyaoiixub_nyaoiix
提出日時 2020-05-03 07:29:48
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,158 bytes
コンパイル時間 959 ms
コンパイル使用メモリ 96,040 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-31 00:04:27
合計ジャッジ時間 1,604 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


int main()
{
	ll n;
	cin >> n;

	vector<ll> x(10, 1);
	for (ll i = 0; i < n; i++)
	{
		ll a, b, c, d;
		string r;
		cin >> a >> b >> c >> d >> r;

		if (r == "NO")
		{
			x[a] = -100;
			x[b] = -100;
			x[c] = -100;
			x[d] = -100;
		}
		else
		{
			x[a]++;
			x[b]++;
			x[c]++;
			x[d]++;
		}
	}

	ll xx = -inf;
	ll res = -1;
	for (ll i = 0; i < 10; i++)
	{
		if (x[i] > xx)
		{
			xx = x[i];
			res = i;
		}
	}

	println(res);
}
0