QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#430046#973. Composite Sequencegrass8cow#WA 0ms3836kbC++14427b2024-06-03 12:06:362024-06-03 12:06:36

Judging History

This is the latest submission verdict.

  • [2024-06-03 12:06:36]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3836kb
  • [2024-06-03 12:06:36]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int n,a[300100];
bool chk(int x){
	if(x==1)return 0;
	for(int i=2;i*i<=x;i++)if(!(x%i))return 0;
	return 1;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		if(a[i]==1){puts("Yes");return 0;}
	}
	if(n>2){puts("Yes");return 0;}
	if(n==1&&chk(a[1])||n==2&&chk(a[1])&&chk(a[2])&&chk(a[1]+a[2]))puts("No");
	else puts("Yes");
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
5 7

output:

Yes

result:

ok "Yes"

Test #2:

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

input:

1
97

output:

No

result:

ok "No"

Test #3:

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

input:

1
97

output:

No

result:

ok "No"

Test #4:

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

input:

3
1 1 1

output:

Yes

result:

wrong answer 1st words differ - expected: 'No', found: 'Yes'