結果

問題 No.24 数当てゲーム
ユーザー compass1201compass1201
提出日時 2018-07-22 14:54:35
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 697 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 51,396 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 00:53:31
合計ジャッジ時間 1,036 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>

using namespace std;

int main()
{
	int turn,tmp[4];
	char Bool[4];
	int num[10] = {};
	
	cin >> turn;

	for (int i = 0; i < turn; i++)
	{
		for(int j=0;j<4;j++)
			cin >> tmp[j];
		cin >> Bool;
		if (Bool[0]=='Y')//答えの値が含まれていた場合
		{
			for (int j = 0; j < 4; j++)
			{
				if (num[tmp[j]] > -1)//間違えであることが確定してない場合
					num[tmp[j]]++;
			}
		}
		else//答えが含まれていなかった場合
		{
			for (int j = 0; j < 4; j++)
				num[tmp[j]] = -1;
		}
	}

	tmp[0] = num[0];
	tmp[1] = 0;
	for (int i = 1; i < 10; i++)
		if (tmp[0] < num[i])
		{
			tmp[0] = num[0];
			tmp[1] = i;
		}
	cout << tmp[1];
	return 0;
}
0