Submission #714370

#TimeUsernameProblemLanguageResultExecution timeMemory
714370SwanPermutation (APIO22_perm)C++17
91.33 / 100
2 ms340 KiB
#include <iostream> #include <vector> #include <stack> #include <algorithm> #include <string> #include <set> #include <map> #include <list> #include <time.h> #include <math.h> #include <random> #include <deque> #include <queue> #include <cassert> #include <unordered_map> #include <unordered_set> #include <iomanip> #include <bitset> #include <sstream> #include <chrono> #include <cstring> //#define int long long #define INP freopen("palpath.in","r",stdin) #define OUTP freopen("palpath.out","w",stdout) using ld = long double; using LD = ld; using namespace std; vector<int> construct_permutation(long long k) { bitset<64> bits (k); int mx = 0; for (int i = 0; i < 64; i++) { if (bits[i]) { mx = i; } } vector<int> res; for (int i = 0; i < mx; i++) { res.push_back(i); } for (int i = mx - 1; i >= 0; i--) { if (!bits[i]) { continue; } int resSize = res.size(); for (int j = 0; j < resSize; j++) { if(res[j] >= i) { res[j]++; } } res.push_back(i); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...