結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  cww | 
| 提出日時 | 2016-09-05 17:37:24 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 959 bytes | 
| コンパイル時間 | 1,696 ms | 
| コンパイル使用メモリ | 172,740 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-15 20:28:49 | 
| 合計ジャッジ時間 | 2,246 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(n); i++)
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
	int N{};
	cin >> N;
	
	vector<int> a(N), b(N), c(N), d(N);
	vector<string> R(N);
	REP( i, N ) cin >> a[i] >> b[i] >> c[i] >> d[i] >> R[i];
	vector<pair<int, int>> P{ {0,0},{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0} };
	REP( i, N )
	{
		REP( j, 10 )
		{
			if( R[i] == "YES" )
			{
				if( a[i] == P[j].first || b[i] == P[j].first || c[i] == P[j].first || d[i] == P[j].first )
				{
					P[j].second += 1;
				}
			}
			if( R[i] == "NO" )
			{
				if( a[i] == P[j].first || b[i] == P[j].first || c[i] == P[j].first || d[i] == P[j].first )
				{
					P[j].second = 0;
				}
				else
				{
					P[j].second += 1;
				}
			}
		}
	}
	int tmp{}, res{};
	for( const auto& x : P )
	{
		if( tmp < x.second )
		{
			tmp = x.second;
			res = x.first;
		}
	}
	cout << res << endl;
	return 0;
}
            
            
            
        