#include <bits/stdc++.h>
#define f first
#define s second
#define ent '\n'
//#define int long long
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
const int dx[]={-1, 1, 0, 0, 0};
const int dy[]={0, 0, 1, -1, 0};
typedef long long ll;
using namespace std;
const int mx=5e6+12;
const int mod=998244353;
const bool T=1;
int a[mx];
int n,m,k;
vector<int> construct_permutation(long long k){
int bit=-1;
for(int b=60;b>=0;b--){
if((k&(1ll<<b))){
bit=b;
break;
}
}
deque<int> ans;
for(int i=0;i<bit;i++){
ans.push_back(i*300);
}
for(int i=0;i<bit;i++){
if((k&(1l<<i))){
ans.push_front(ans[ans.size()-i-1]+1);
}
}
set<int> s;
map<int,int> val;
for(int x:ans){
s.insert(x);
}
int N=0;
for(int x:s){
val[x]=N;
N++;
}
vector<int> g;
for(int x:ans){
g.push_back(val[x]);
}
return g;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |