QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#768380 | #9167. Coprime Array | ucup-team4352# | WA | 0ms | 3668kb | C++23 | 520b | 2024-11-21 09:54:05 | 2024-11-21 09:54:12 |
Judging History
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]