QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189302#2701. Impressive IntegersMahmoudAtiaWA 1ms3444kbC++141.4kb2023-09-27 09:56:232023-09-27 09:56:24

Judging History

你现在查看的是最新测评结果

  • [2023-09-27 09:56:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3444kb
  • [2023-09-27 09:56:23]
  • 提交

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