QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#139888 | #2056. Buddy Numbers | Deadplayer# | AC ✓ | 1ms | 3632kb | C++14 | 1.4kb | 2023-08-14 19:08:05 | 2023-08-14 19:08:07 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
//Practice, Practice, Practice
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define debug(x) cerr << #x << " is " << x << endl;
#define Practice ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl '\n'
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define ull unsigned long long
#define one(x) __builtin_popcount(x)
#define double long double
#define sz(x) x.size()
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
const int MAXN = 2e5 + 5, SQ = 350, mod = 1e9 + 7, INF = 1e9;
void doWork(){
int n;
cin >> n;
if(n <= 2){
for(int i = 1; i <= n; ++i){
cout << i << " ";
}
}
else if(n == 3){
cout << 3 << " " << 1 << " " << 2 << endl;
}
else if(n == 4){
cout << 4 << " " << 2 << " " << 1 << " " << 3 << endl;
}
else if(n == 6){
cout << 5 << " " << 1 << " " << 3 << " " << 6 << " " << 2 << " " << 4 << endl;
}
else{
cout << -1 << endl;
}
}
int32_t main(){
Practice
int tc = 1;
//cin >> tc;
while(tc--){
doWork();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3472kb
input:
2
output:
1 2
result:
ok answer is OK
Test #2:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
3
output:
3 1 2
result:
ok answer is OK
Test #3:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
1
output:
1
result:
ok answer is OK
Test #4:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
4
output:
4 2 1 3
result:
ok answer is OK
Test #5:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
5
output:
-1
result:
ok answer is OK
Test #6:
score: 0
Accepted
time: 0ms
memory: 3428kb
input:
6
output:
5 1 3 6 2 4
result:
ok answer is OK
Test #7:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
7
output:
-1
result:
ok answer is OK
Test #8:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
8
output:
-1
result:
ok answer is OK
Test #9:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
9
output:
-1
result:
ok answer is OK
Test #10:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
10
output:
-1
result:
ok answer is OK
Test #11:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
11
output:
-1
result:
ok answer is OK
Test #12:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
12
output:
-1
result:
ok answer is OK
Test #13:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
13
output:
-1
result:
ok answer is OK
Test #14:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
14
output:
-1
result:
ok answer is OK
Test #15:
score: 0
Accepted
time: 1ms
memory: 3372kb
input:
15
output:
-1
result:
ok answer is OK
Test #16:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
16
output:
-1
result:
ok answer is OK
Test #17:
score: 0
Accepted
time: 1ms
memory: 3404kb
input:
17
output:
-1
result:
ok answer is OK
Test #18:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
18
output:
-1
result:
ok answer is OK
Test #19:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
19
output:
-1
result:
ok answer is OK
Test #20:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
20
output:
-1
result:
ok answer is OK
Test #21:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
30
output:
-1
result:
ok answer is OK
Test #22:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
100
output:
-1
result:
ok answer is OK
Test #23:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
288
output:
-1
result:
ok answer is OK
Test #24:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
666
output:
-1
result:
ok answer is OK
Test #25:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
1000
output:
-1
result:
ok answer is OK