Submission #911290

#TimeUsernameProblemLanguageResultExecution timeMemory
911290hjroh0315Permutation (APIO22_perm)C++17
0 / 100
0 ms348 KiB
#include"perm.h" #include<bits/stdc++.h> using namespace std; std::vector<int>construct_permutation(long long k) { k--; vector<int>v; int x=0,y=999; while(k>0) { if(k&1) { v.push_back(y); y--;k--; } else { v.push_back(x); x++;k>>=1; } } map<int,int>mp; for(int i:v)mp[i]; int cnt=0; for(auto&[a,b]:mp)b=cnt++; for(int&i:v)i=mp[i]; return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...