제출 #982803

#제출 시각아이디문제언어결과실행 시간메모리
982803vjudge1순열 (APIO22_perm)C++17
71.22 / 100
11 ms1372 KiB
#include <bits/stdc++.h> #define endl '\n' #define mp make_pair #define pb push_back #define f first #define s second #define fo(i,n) for(auto i =0 ; i < n;i++) #define fore(i,l,r) for(auto i = l; i < r;i++) #define forex(i,r,l) for(auto i = r; i >= l; i--) #define ffo(i,n) forex(i,n-1,0) #define all(x) x.begin(),x.end() #define lsb(x) x&(-x) #define sz(x) (int)x.size() #define gcd(a,b) __gcd(a,b) #define vii vector<ii> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>;using ii = pair<int,int>;using mii = map<int,int>; // #pragma GCC target ("avx2") // #pragma GCC optimization ("O3") // #pragma GCC optimization ("unroll-loops") vi construct_permutation(ll k){ int act = 0; vi ans; while(k>1){ // cout<<k<<endl;cout.flush(); ll lg = 1, p2 = 2; while(p2*2 <= k)p2*=2, lg++; vi ins;fo(i,lg)ins.pb(act),act++; reverse(all(ins)); for(int v : ins)ans.pb(v); k-=p2;k++; }reverse(all(ans)); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...