QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#233651 | #2701. Impressive Integers | Fyind# | WA | 0ms | 3600kb | C++20 | 1.9kb | 2023-10-31 20:52:55 | 2023-10-31 20:52:56 |
Judging History
answer
#include <bits/stdc++.h>
#define mp(x, y) make_pair(x, y)
#define fi first
#define se second
using namespace std;
int main() {
#ifdef LLOCAL
freopen("a.in", "r", stdin);
#endif
int n;
cin >> n;
--n;
if (n == 0) {
cout << 1 << ' ' << 0 << ' ' << 1 << '\n';
cout << "A 0 0 U\n";
return 0;
}
if (n == 1 || n == 2) {
cout << "impossible\n";
return 0;
}
if (n % 2 == 0 && n % 4 != 0) {
int m = n / 4;
int a = 2, b = 2 * m - 1, c = 4 * m;
cout << a << ' ' << b << ' ' << c << endl;
int j = 0;
for (int i = c; i > 4 * m - 2; i -= a) {
for (int k = 0; k < i; k += a)
cout << 'A' << ' ' << k << ' ' << j << ' ' << 'U' << '\n';
j += a;
for (int k = 0; k < i - a; k += a)
cout << 'A' << ' ' << k << ' ' << j << ' ' << 'D' << '\n';
}
for (int i = 4 * m - 2; i > 0; i -= b) {
for (int k = 0; k < i; k += b)
cout << 'B' << ' ' << k << ' ' << j << ' ' << 'U' << '\n';
j += b;
for (int k = 0; k < i - b; k += b)
cout << 'B' << ' ' << k << ' ' << j << ' ' << 'D' << '\n';
}
// cout << 'B' << ' ' << 0 << ' ' << j << ' ' << 'U' << '\n';
return 0;
}
int a = 1, b, c;
if (n % 2 != 0)
c = (1 + n) / 2, b = (n - 1) / 2;
else
c = (2 + n / 2) / 2, b = (n / 2 - 2) / 2;
cout << a << ' ' << b << ' ' << c << '\n';
int j = 0;
for (int i = c; i > b; --i) {
for (int k = 0; k < i; ++k)
cout << 'A' << ' ' << k << ' ' << j << ' ' << 'U' << '\n';
++j;
for (int k = 0; k < i - 1; ++k)
cout << 'A' << ' ' << k << ' ' << j << ' ' << 'D' << '\n';
}
cout << 'B' << ' ' << 0 << ' ' << j << ' ' << 'U' << '\n';
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3600kb
input:
1
output:
1 0 1 A 0 0 U
result:
wrong answer Value is lower than limit!