QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#707869#9167. Coprime ArraytamirWA 0ms3632kbC++14348b2024-11-03 17:55:002024-11-03 17:55:02

Judging History

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

  • [2024-11-03 17:55:02]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3632kb
  • [2024-11-03 17:55:00]
  • 提交

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