QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#400336#6696. Three Diceliutaowoaini#WA 0ms3708kbC++171.0kb2024-04-27 10:20:012024-04-27 10:20:01

Judging History

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

  • [2024-04-27 10:20:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2024-04-27 10:20:01]
  • 提交

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;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3640kb

input:

4 5

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

3 0

output:

Yes

result:

ok answer is YES

Test #3:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

1 2

output:

No

result:

ok answer is NO

Test #4:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

0 0

output:

No

result:

ok answer is NO

Test #5:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

0 1

output:

No

result:

ok answer is NO

Test #6:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

0 2

output:

No

result:

ok answer is NO

Test #7:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

0 3

output:

No

result:

ok answer is NO

Test #8:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

0 4

output:

No

result:

ok answer is NO

Test #9:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

0 5

output:

No

result:

ok answer is NO

Test #10:

score: -100
Wrong Answer
time: 0ms
memory: 3584kb

input:

0 6

output:

No

result:

wrong answer expected YES, found NO