QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#395084#2701. Impressive Integerskevinyang#WA 1ms3656kbC++171.5kb2024-04-21 03:25:332024-04-21 03:25:34

Judging History

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

  • [2024-04-21 03:25:34]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3656kb
  • [2024-04-21 03:25:33]
  • 提交

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<=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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3656kb

input:

1

output:

impossible

result:

wrong output format Expected integer, but "impossible" found