QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#707865#9167. Coprime ArraytamirWA 0ms3636kbC++14325b2024-11-03 17:54:042024-11-03 17:54:04

Judging History

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

  • [2024-11-03 17:54:04]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-11-03 17:54:04]
  • 提交

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