QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#46788 | #973. Composite Sequence | Ufowoqqqo | WA | 2ms | 3760kb | C++ | 598b | 2022-09-01 21:23:39 | 2022-09-01 21:23:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int a[N];
bool check(int x)
{
int i;
for(i = 2; i * i <= x; i ++)
if(x % i == 0)
return false;
return true;
}
int main()
{
int n;
int i;
scanf("%d", &n);
for(i = 0; i < n; i ++)
scanf("%d", &a[i]);
if(n > 2)
{
puts("Yes");
return 0;
}
if(n == 1)
puts(check(a[0]) ? "No" : "Yes");
else
puts(check(a[0]) && check(a[1]) && check(a[0] + a[1]) ? "No" : "Yes");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3760kb
input:
2 5 7
output:
Yes
result:
ok "Yes"
Test #2:
score: 0
Accepted
time: 2ms
memory: 3744kb
input:
1 97
output:
No
result:
ok "No"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3728kb
input:
1 97
output:
No
result:
ok "No"
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3736kb
input:
3 1 1 1
output:
Yes
result:
wrong answer 1st words differ - expected: 'No', found: 'Yes'