#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using PP = pair<ll, P>;
const ll n_ =4e5+100, inf = (ll)2e9 * (ll)1e9 + 7, mod = 998244353;
ll n, m, tc = 1, a, b, c, d, sum, x, y, z, base, ans, k;
ll gcd(ll x,ll y){
if(!y)return x;
return gcd(y,x%y);
}
vector<int> construct_permutation(long long k){
vector<int>res,A;
x=k-1;
while(1){
if(x==2){
res.push_back(1);
res.push_back(0);
break;
}
else if(x==1){
res.push_back(0);
break;
}
if(x%2)A.push_back(1),x=(x-1)/2;
else A.push_back(-1),x=(x-2)/2;
}
reverse(all(A));
for(auto nxt:A){
if(nxt==-1){
for(auto &i:res)i++;
res.push_back(0);
}
res.push_back(res.size());
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
428 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
428 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |