QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#511696 | #9167. Coprime Array | ucup-team3699# | WA | 0ms | 3612kb | C++20 | 640b | 2024-08-10 10:12:03 | 2024-08-10 10:12:03 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define F first
#define S second
const int mol=1e9+7;
void solve(){
int s, x;
cin>>s>>x;
int id;
for(int j=2003;;j++){
if(__gcd(x, j)==1) {
id=j;
break;
}
}
vector<int>ans;
int now=0;
while(now+id<=s){
now+=id;
ans.pb(id);
}
while(now<s) now++, ans.pb(1);
cout<<ans.size()<<"\n";
for(int i: ans) cout<<i<<" ";
}
signed main(){
ios::sync_with_stdio(0);cin.tie(0);
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
9 6
output:
9 1 1 1 1 1 1 1 1 1
result:
wrong answer Jury's answer is better than participant's