QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#768380#9167. Coprime Arrayucup-team4352#WA 0ms3668kbC++23520b2024-11-21 09:54:052024-11-21 09:54:12

Judging History

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

  • [2024-11-21 09:54:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3668kb
  • [2024-11-21 09:54:05]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define log(x) (31^__builtin_clz(x))
#define lowbit(x) (x&-x)
#define pii pair<int,int>
using namespace std;

void solve(){
	ll s,x;
	cin>>s>>x;
	ll ans=0;
	for(ll i=s;i;i++){
		if(__gcd(i,x)==1){
			ans=i;
			break;
		}
	}
	cout<<1+ans-s<<"\n";
	cout<<ans<<" ";
	for(int i=1;i<=ans-s;i++)cout<<"-1 ";
	cout<<"\n";
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	int t=1;
	// cin>>t;
	while(t--)solve();
}
/*
x
y
*/

详细

Test #1:

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

input:

9 6

output:

3
11 -1 -1 

result:

ok Correct

Test #2:

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

input:

14 34

output:

2
15 -1 

result:

ok Correct

Test #3:

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

input:

1000000000 223092870

output:

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

result:

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