QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#395084 | #2701. Impressive Integers | kevinyang# | WA | 1ms | 3656kb | C++17 | 1.5kb | 2024-04-21 03:25:33 | 2024-04-21 03:25:34 |
Judging History
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