QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#707869 | #9167. Coprime Array | tamir | WA | 0ms | 3632kb | C++14 | 348b | 2024-11-03 17:55:00 | 2024-11-03 17:55:02 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
using namespace std;
ll n,i,x,s,a[1000001];
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> s >> x;
while(__gcd(s,x)>1){
n++;
a[n]=1;
s-=1;
}
cout << n+1 << "\n";
for(i=1;i<=n;i++) cout << a[i] << " ";
cout << s;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3632kb
input:
9 6
output:
3 1 1 7
result:
ok Correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
14 34
output:
2 1 13
result:
ok Correct
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3564kb
input:
1000000000 223092870
output:
4 1 1 1 999999997
result:
wrong answer Jury's answer is better than participant's