Submission #1177928

#TimeUsernameProblemLanguageResultExecution timeMemory
1177928Muhammet순열 (APIO22_perm)C++17
91.33 / 100
1 ms328 KiB
#include "bits/stdc++.h" #include "perm.h" // #include "grader.cpp" #define ll long long using namespace std; vector <int> v; void f(int x) { for(auto &i : v) { i += x; } for(int i = 0; i < x; i++) { v.push_back(i); } return; } vector<int> construct_permutation(ll k) { v.clear(); bool tr = 0; while(k) { ll k1 = k - 1, ind; for(ll i = 0; i < 60; i++) { k1 -= (1LL<<i); if(k1 < 0) { ind = i; break; } } k1 += (1LL<<ind); k = k1; if(!tr) { tr = 1; f(ind); continue; } for(auto &i : v) { if(i >= ind) i++; } v.push_back(ind); } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...