QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#400333#6696. Three Diceliutaowoaini#WA 0ms3532kbC++171.0kb2024-04-27 10:18:562024-04-27 10:18:57

Judging History

你现在查看的是最新测评结果

  • [2024-04-27 10:18:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2024-04-27 10:18:56]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
int hei[4] = { 2,3,5,6 };
int h[2] = { 1,4 };
void solve()
{
	int a, b;
	cin >> a >> b;
	if (b != 0)
	{
		if (a == 1 || a == 4)//一个红色
		{
			for (int i = 0; i < 4; i++)
			{
				for (int j = i; j < 4; j++)
				{
					if (hei[i] + hei[j] == b)
					{
						cout << "Yes" << endl;
						return;
					}
				}
			}
		}
		else if (a == 2 || a == 5 || a == 8)//两个红
		{
			for (int i = 0; i < 4; i++)
			{
				if (hei[i] == b)
				{
					cout << "Yes" << endl;
					return;
				}
			}
		}
	}
	else//三个红
	{
		for (int i = 0; i < 2; i++)
		{
			for (int j = i; j < 2; j++)
			{
				for (int k = j; k < 2; k++)
				{
					int sum = h[i] + h[j] + h[k];
					if (sum == a)
					{
						cout << "Yes" << endl;
						return;
					}
				}
			}
		}
	}
	cout << "No" << endl;
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	t = 1;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3532kb

input:

4 5

output:

No
No
No
No

result:

wrong answer expected YES, found NO