QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189256#2701. Impressive IntegersBeevoWA 1ms3596kbC++201.7kb2023-09-27 05:33:352023-09-27 05:33:36

Judging History

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

  • [2023-09-27 05:33:36]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3596kb
  • [2023-09-27 05:33:35]
  • 提交

answer

#include <bits/stdc++.h>

#define el '\n'
#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef long long ll;
typedef long double ld;

using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

void testCase() {
    int n;
    cin >> n;

    if (n == 2 || n == 3 || n == 5)
        return cout << "impossible", void();

    if (n == 1) {
        cout << 1 << ' ' << 1 << ' ' << 1 << el;

        cout << 'A' << ' ' << 0 << ' ' << 0 << ' ' << 'U';

        return;
    }

    if (n & 1) {
        cout << 2 << ' ' << (n - 3) / 4 << ' ' << 2 + (n - 3) / 2 << el;

        for (int i = 0; i < n - 4; i++) {
            if (i & 1)
                cout << 'A' << ' ' << i / 2 * 2 << ' ' << 2 << ' ' << 'D' << el;
            else
                cout << 'A' << ' ' << i / 2 * 2 << ' ' << 0 << ' ' << 'U' << el;
        }

        cout << 'B' << ' ' << 0 << ' ' << 2 << ' ' << 'U' << el;

        cout << 'B' << ' ' << (n - 3) / 4 << ' ' << 2 << ' ' << 'U' << el;

        cout << 'B' << ' ' << 0 << ' ' << 2 + (n - 3) / 4 << ' ' << 'D' << el;

        cout << 'B' << ' ' << 0 << ' ' << 2 + (n - 3) / 4 << ' ' << 'U' << el;
    }
    else {
        cout << 1 << ' ' << n / 2 - 1 << ' ' << n / 2 << el;

        for (int i = 0; i < n - 1; i++) {
            if (i & 1)
                cout << 'A' << ' ' << i / 2 << ' ' << 1 << ' ' << 'D' << el;
            else
                cout << 'A' << ' ' << i / 2 << ' ' << 0 << ' ' << 'U' << el;
        }

        cout << 'B' << ' ' << 0 << ' ' << 1 << ' ' << 'U';
    }
}

signed main() {
    Beevo

    int t = 1;
//    cin >> t;

    while (t--)
        testCase();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3452kb

input:

1

output:

1 1 1
A 0 0 U

result:

ok 

Test #2:

score: 0
Accepted
time: 0ms
memory: 3444kb

input:

2

output:

impossible

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 3496kb

input:

3

output:

impossible

result:

ok 

Test #4:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

4

output:

1 1 2
A 0 0 U
A 0 1 D
A 1 0 U
B 0 1 U

result:

ok 

Test #5:

score: 0
Accepted
time: 0ms
memory: 3480kb

input:

5

output:

impossible

result:

ok 

Test #6:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

6

output:

1 2 3
A 0 0 U
A 0 1 D
A 1 0 U
A 1 1 D
A 2 0 U
B 0 1 U

result:

ok 

Test #7:

score: 0
Accepted
time: 0ms
memory: 3432kb

input:

7

output:

2 1 4
A 0 0 U
A 0 2 D
A 2 0 U
B 0 2 U
B 1 2 U
B 0 3 D
B 0 3 U

result:

ok 

Test #8:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

8

output:

1 3 4
A 0 0 U
A 0 1 D
A 1 0 U
A 1 1 D
A 2 0 U
A 2 1 D
A 3 0 U
B 0 1 U

result:

ok 

Test #9:

score: -100
Wrong Answer
time: 0ms
memory: 3544kb

input:

9

output:

2 1 5
A 0 0 U
A 0 2 D
A 2 0 U
A 2 2 D
A 4 0 U
B 0 2 U
B 1 2 U
B 0 3 D
B 0 3 U

result:

wrong answer Triangle not contained within large triangle!