結果

問題 No.24 数当てゲーム
コンテスト
ユーザー jajagacchi
提出日時 2017-01-11 23:40:23
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 353µs
コード長 523 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 327 ms
コンパイル使用メモリ 81,384 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2026-10-05 13:21:29
合計ジャッジ時間 1,435 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

int main()
{
	int N; std::cin >> N;
	std::vector<int> a(10);
	for(auto &x : a) x = 0;
	for(int n=0; n<N; n++)
	{
		int tmp[4];
		for(auto &x : tmp) std::cin >> x;
		std::string str; std::cin >> str;
		if(str=="YES")
		{
			for(const auto &x : tmp)
			{
				a[x]++;
			}
		}
		else
		{
			for(const auto &x : tmp)
			{
				a[x]--;
			}
		}
	}
	std::cout << std::distance(a.begin(), std::max_element(a.begin(), a.end())) << std::endl;
	return 0;
}
0