QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#395081#2701. Impressive Integerskevinyang#WA 1ms3708kbC++171.6kb2024-04-21 03:21:132024-04-21 03:21:13

Judging History

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

  • [2024-04-21 03:21:13]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3708kb
  • [2024-04-21 03:21:13]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    cin.tie(nullptr)->sync_with_stdio(false);
    int n;
    cin >> n;
    if(n%2==0){
        if(n==2){
            cout << "impossible\n";
            return 0;
        }
        else{
            cout << 1 << ' ' << n/2-1 << ' ' << n/2 << '\n';
            cout << "B 0 1 U\n";
            for(int i = 0; i<n/2; i++){
                cout << "A " << i << ' ' << 0 << ' ' << 'U' << '\n';
            }
            for(int i = 0; i+1<n/2; i++){
                cout << "B " << i << ' ' << 1 << ' ' << 'D' << '\n';
            }
        }
    }
    else{
        if(n==1){
            cout << "1 1 1\n";
            cout << "A 0 0 U\n";
            return 0;
        }
        if(n<=5){
            cout << "impossible\n";
            return 0;
        }
        else{
            int a = 2;
            int b = (n-5)/2;
            cout << 2 << ' ' << (n-5)/2 << ' ' << (n-3) << '\n';
            cout << "B " << 0 << ' ' << a << ' ' << 'U' << '\n';
            cout << "B " << 0 << ' ' << a+b << ' ' << 'U' << '\n';
            cout << "B " << 0 << ' ' << a+b << ' ' << 'D' << '\n';
            cout << "B " << b << ' ' << a << ' ' << 'U' << '\n';
            for(int i = 0; i<n-4; i++){
                if(i%2==0){
                    cout << "A " << i << ' ' << 0 << ' ' << 'U' << '\n';
                }
                else{
                    cout << "A " << i-1 << ' ' << 2 << ' ' << 'D' << '\n';
                }
            }
        }
    }
    return 0;
}

詳細信息

Test #1:

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

input:

1

output:

1 1 1
A 0 0 U

result:

ok 

Test #2:

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

input:

2

output:

impossible

result:

ok 

Test #3:

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

input:

3

output:

impossible

result:

ok 

Test #4:

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

input:

4

output:

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

result:

ok 

Test #5:

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

input:

5

output:

impossible

result:

ok 

Test #6:

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

input:

6

output:

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

result:

wrong answer Triangle not contained within large triangle!