QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#85631 | #2056. Buddy Numbers | rania__# | AC ✓ | 2ms | 3588kb | C++14 | 992b | 2023-03-07 23:26:30 | 2023-03-07 23:26:32 |
Judging History
answer
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define endl '\n'
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int N = 1e5+7, P1 = 31, P2 = 37, mod= 1e9 + 7;
void doWork() {
int n;
cin >> n;
if ( n == 1)
cout << 1 ;
else if ( n == 2)
cout << "2 1";
else if ( n == 3)
cout << "3 1 2";
else if ( n == 4)
cout << "3 1 2 4";
else if ( n == 6)
cout << "5 1 3 6 2 4";
else
cout << -1 << endl;
}
int main() {
ios::sync_with_stdio(false);
cout.tie(nullptr);
cin.tie(nullptr);
// freopen("bisector.in","r",stdin);
// freopen("bisector.out","w",stdout);
int t = 1;
// cout << primes.size() << endl;
//cin >> t;
while (t--) {
doWork();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3388kb
input:
2
output:
2 1
result:
ok answer is OK
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
3
output:
3 1 2
result:
ok answer is OK
Test #3:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
1
output:
1
result:
ok answer is OK
Test #4:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
4
output:
3 1 2 4
result:
ok answer is OK
Test #5:
score: 0
Accepted
time: 2ms
memory: 3392kb
input:
5
output:
-1
result:
ok answer is OK
Test #6:
score: 0
Accepted
time: 2ms
memory: 3352kb
input:
6
output:
5 1 3 6 2 4
result:
ok answer is OK
Test #7:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
7
output:
-1
result:
ok answer is OK
Test #8:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
8
output:
-1
result:
ok answer is OK
Test #9:
score: 0
Accepted
time: 0ms
memory: 3432kb
input:
9
output:
-1
result:
ok answer is OK
Test #10:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
10
output:
-1
result:
ok answer is OK
Test #11:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
11
output:
-1
result:
ok answer is OK
Test #12:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
12
output:
-1
result:
ok answer is OK
Test #13:
score: 0
Accepted
time: 2ms
memory: 3584kb
input:
13
output:
-1
result:
ok answer is OK
Test #14:
score: 0
Accepted
time: 2ms
memory: 3392kb
input:
14
output:
-1
result:
ok answer is OK
Test #15:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
15
output:
-1
result:
ok answer is OK
Test #16:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
16
output:
-1
result:
ok answer is OK
Test #17:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
17
output:
-1
result:
ok answer is OK
Test #18:
score: 0
Accepted
time: 2ms
memory: 3348kb
input:
18
output:
-1
result:
ok answer is OK
Test #19:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
19
output:
-1
result:
ok answer is OK
Test #20:
score: 0
Accepted
time: 1ms
memory: 3300kb
input:
20
output:
-1
result:
ok answer is OK
Test #21:
score: 0
Accepted
time: 0ms
memory: 3388kb
input:
30
output:
-1
result:
ok answer is OK
Test #22:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
100
output:
-1
result:
ok answer is OK
Test #23:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
288
output:
-1
result:
ok answer is OK
Test #24:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
666
output:
-1
result:
ok answer is OK
Test #25:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
1000
output:
-1
result:
ok answer is OK