QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#430045#973. Composite Sequencegrass8cow#WA 0ms3808kbC++14404b2024-06-03 12:05:212024-06-03 12:05:21

Judging History

This is the latest submission verdict.

  • [2024-06-03 12:05:21]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3808kb
  • [2024-06-03 12:05:21]
  • 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 1;
	return 0;
}
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(chk(a[1])&&chk(a[2])&&chk(a[1]+a[2]))puts("No");
	else puts("Yes");
	return 0;
} 

詳細信息

Test #1:

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

input:

2
5 7

output:

Yes

result:

ok "Yes"

Test #2:

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

input:

1
97

output:

Yes

result:

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