QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#511701#9167. Coprime Arrayucup-team4508#WA 0ms3944kbC++14401b2024-08-10 10:12:402024-08-10 10:12:41

Judging History

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

  • [2024-08-11 17:38:28]
  • hack成功,自动添加数据
  • (/hack/775)
  • [2024-08-10 10:12:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3944kb
  • [2024-08-10 10:12:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define LL long long
LL n,i,j,k,m;
LL a[500005];
LL gcd(LL x,LL y){
	if(y==0) return x;
	else return gcd(y,x%y);
}
int main(){
	scanf("%lld%lld",&n,&m);
	for(i=1;i<=1000000;i++){
		LL x=gcd(n+i-1,m);
		if(x==1){
			printf("%lld\n",i);
			for(j=1;j<i;j++)
			  printf("-1 ");
			printf("%lld",n+i-1);
			return 0;
		}	
	}
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

9 6

output:

3
-1 -1 11

result:

ok Correct

Test #2:

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

input:

14 34

output:

2
-1 15

result:

ok Correct

Test #3:

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

input:

1000000000 223092870

output:

8
-1 -1 -1 -1 -1 -1 -1 1000000007

result:

wrong answer Integer element a[8] equals to 1000000007, violates the range [-10^9, 10^9]