QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#511696#9167. Coprime Arrayucup-team3699#WA 0ms3612kbC++20640b2024-08-10 10:12:032024-08-10 10:12:03

Judging History

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

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

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