QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#825001 | #9768. A + B = C Problem | ucup-team296# | WA | 0ms | 3648kb | C++20 | 2.3kb | 2024-12-21 16:53:28 | 2024-12-21 16:53:44 |
Judging History
answer
#include <bits/stdc++.h>
#define long long long int
#define DEBUG
using namespace std;
// @author: pashka
struct test {
void solve() {
vector<long> a(3);
cin >> a[0] >> a[1] >> a[2];
if (a[0] == a[1] && a[0] == a[2]) {
if (a[0] == 2) {
cout << "NO\n";
return;
}
cout << "YES\n";
for (int i = 0; i < a[0]; i++) {
cout << (i == 0);
}
cout << "\n";
for (int i = 0; i < a[0]; i++) {
cout << (i == 1);
}
cout << "\n";
for (int i = 0; i < a[0]; i++) {
cout << (i <= 1);
}
cout << "\n";
return;
}
for (int j = 0; j < 3; j++) {
int x = (j + 1) % 3;
int y = (j + 2) % 3;
if (a[j] == a[x] / gcd(a[x], a[y]) * a[y]) {
vector<string> res(3);
for (int i = 0; i < a[x]; i++) {
res[x] += '0' + (i == 0);
}
for (int i = 0; i < a[y]; i++) {
res[y] += '0' + (i == 0);
}
for (int i = 0; i < a[j]; i++) {
res[j] += '0' + ((i % a[x] == 0) ^ (i % a[y] == 0));
}
cout << "YES\n" << res[0] << "\n" << res[1] << "\n" << res[2] << "\n";
}
if (a[x] % 2 == 0 && a[y] % 2 == 0 && a[j] == a[x] / gcd(a[x], a[y]) * a[y] / 2) {
vector<string> res(3);
for (int i = 0; i < a[x]; i++) {
res[x] += '0' + (i < a[x] / 2);
}
for (int i = 0; i < a[y]; i++) {
res[y] += '0' + (i < a[y] / 2);
}
for (int i = 0; i < a[j]; i++) {
res[j] += '0' + ((i % a[x] < a[x] / 2) ^ (i % a[y] < a[y] / 2));
}
cout << "YES\n" << res[0] << "\n" << res[1] << "\n" << res[2] << "\n";
}
}
cout << "NO\n";
return;
}
};
int main() {
ios::sync_with_stdio(false);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
test().solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3648kb
input:
2 2 3 6 2 3 5
output:
YES 10 010 111000 YES 10 100 001110 NO NO
result:
wrong answer Invalid output! (test case 2)