QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#400346 | #6696. Three Dice | liutaowoaini# | WA | 1ms | 3712kb | C++17 | 1.0kb | 2024-04-27 10:25:47 | 2024-04-27 10:25:47 |
Judging History
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: 1ms
memory: 3712kb
input:
4 5
output:
Yes
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
3 0
output:
Yes
result:
ok answer is YES
Test #3:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
1 2
output:
No
result:
ok answer is NO
Test #4:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
0 0
output:
No
result:
ok answer is NO
Test #5:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
0 1
output:
No
result:
ok answer is NO
Test #6:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
0 2
output:
No
result:
ok answer is NO
Test #7:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
0 3
output:
No
result:
ok answer is NO
Test #8:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
0 4
output:
No
result:
ok answer is NO
Test #9:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
0 5
output:
No
result:
ok answer is NO
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3656kb
input:
0 6
output:
No
result:
wrong answer expected YES, found NO