QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#511970 | #9167. Coprime Array | ucup-team3877# | WA | 0ms | 3612kb | C++20 | 729b | 2024-08-10 13:08:51 | 2024-08-10 13:08:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define pb(a) push_back(a)
#define rep(i, n) for(int i=0;i<n;i++)
#define foa(e, v) for(auto& e : v)
using ll = long long;
const ll MOD7 = 1000000007, MOD998 = 998244353, INF = (1LL << 60);
#define dout(a) cout<<fixed<<setprecision(10)<<a<<endl;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll s, x;
cin >> s >> x;
vector<ll> v;
while(1) {
v.pb(1);
s --;
if(__gcd(s, x) == 1) {
v.pb(s);
cout << v.size() << endl;
foa(e, v) cout << e << " ";
cout << endl;
return 0;
}
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3480kb
input:
9 6
output:
3 1 1 7
result:
ok Correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
14 34
output:
2 1 13
result:
ok Correct
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
1000000000 223092870
output:
4 1 1 1 999999997
result:
wrong answer Jury's answer is better than participant's