QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#707865 | #9167. Coprime Array | tamir | WA | 0ms | 3636kb | C++14 | 325b | 2024-11-03 17:54:04 | 2024-11-03 17:54:04 |
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;
}
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: 0
Wrong Answer
time: 0ms
memory: 3636kb
input:
9 6
output:
1 1 7
result:
wrong answer Sum of the elements is not equal to s