QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189303 | #2701. Impressive Integers | MahmoudAtia | WA | 1ms | 3436kb | C++14 | 1.4kb | 2023-09-27 09:56:53 | 2023-09-27 09:56:55 |
Judging History
answer
#include <bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
int di[] = {1, 0, -1, 0, 0, 1, -1, 1};
int dj[] = {0, 1, 0, -1, -1, 0, 1, -1};
const ll oo = 1e18;
const int N = 2e6 + 5, M = 1e4 + 5, MOD = 998244353;
#define EPS 1e-9
int n, m, k, h, w, x[N], y[N];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
//memset(dp, -1, sizeof dp);
cin >> n;
if (n == 1) {
cout << "1 1 1" << endl;
cout << "A 0 0";
return 0;
}
if (n == 2 || n == 3 || n == 5) return !(cout << "impossible");
if (n % 2 == 0) {
cout << 1 << " " << n - 1 << " " << n << endl;
for (int i = 0; i < n - 1; i++) {
cout << "A ";
if (i & 1) cout << i / 2 << " 1 D" << endl;
else cout << i / 2 << " 0 U" << endl;
}
cout << "B 0 1 U";
} else {
int c = (n - 4 + 1) / 2 * 2;
int b = (c - 2) / 2;
cout << 2 << " " << (c - 2) / 2 << " " << c << endl;
for (int i = 0; i < n - 4; i++) {
cout << "A ";
if (i & 1) cout << i / 2 * 2 << " 2 D" << endl;
else cout << i / 2 * 2 << " 0 U" << endl;
}
cout << "B 0 2 U" << endl;
cout << "B 0 " << 2 + b << " D" << endl;
cout << "B " << b << " 2 U" << endl;
cout << "B 0 " << 2 + b << " U";
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3436kb
input:
1
output:
1 1 1 A 0 0
result:
wrong output format Unexpected end of file - token expected