QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#395081 | #2701. Impressive Integers | kevinyang# | WA | 1ms | 3708kb | C++17 | 1.6kb | 2024-04-21 03:21:13 | 2024-04-21 03:21:13 |
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==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!