Submission #1061346

#TimeUsernameProblemLanguageResultExecution timeMemory
1061346Halym2007Permutation (APIO22_perm)C++17
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define sz size() #define ff first #define ss second #define pb push_back #define pii pair <int, int> const int N = 2e5 + 5; vector <int> construct_permutation(ll k) { k--; vector <int> jog; int bashla = 5000; for (ll i = 60; i >= 1; i--) { while ((1LL << i) - 1 <= k) { k -= (1LL << i) - 1; for (int kk = bashla - i + 1; kk <= bashla; ++kk) { jog.pb (kk); } bashla -= i; } } return jog; } //int main () { // freopen ("input.txt", "r", stdin); // ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); // int q; // cin >> q; // while ( q-- ) { // ll k; // cin >> k; // vector <int> kk = construct_permutation(k); // for (int i : kk) { // cout << i << " "; // } // cout << "\n"; // } //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...