제출 #1177421

#제출 시각아이디문제언어결과실행 시간메모리
1177421tkm_algorithms순열 (APIO22_perm)C++20
10 / 100
336 ms51136 KiB
/** * In the name of Allah * We are nothing and you're everything **/ #include <bits/stdc++.h> //#include "swap.h" #include "perm.h" using namespace std; #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; //#define int ll const char nl = '\n'; const int N = 3e5+10; const int inf = 1e9; int calc(vector<int> &c) { int n = sz(c), sum = 0; for (int i = 0; i <= (1 << n); ++i) { int onki = -1; bool ok = true; for (int j = 0; j < n; ++j) if ((i & j) > 0) { if (j < onki){ok = false; break; } onki = j; } if (ok)sum += 1; } return sum; } vector<int> construct_permutation(long long k) { //vector<int> b{2, 4, 8, 16, 32, 64, 128, 256}; //int s = lower_bound(all(b), k) - b.begin(); //for (int i = sz(b)-1; i >= 0; --i) { //vector<int> c; //for (int j = 0; j <= i; ++j)c.push_back(j); //int t = calc(c); //do { //} while (next_permutation(all(c))); //} vector<int> b; for (int i = k-2; i >= 0; --i)b.push_back(i); return b; } //int main() { //return 0; //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...