QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#189302 | #2701. Impressive Integers | MahmoudAtia | WA | 1ms | 3444kb | C++14 | 1.4kb | 2023-09-27 09:56:23 | 2023-09-27 09:56:24 |
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" << endl;
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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3444kb
input:
1
output:
1 1 1 A 0 0
result:
wrong output format Unexpected end of file - token expected