제출 #982805

#제출 시각아이디문제언어결과실행 시간메모리
982805vjudge1순열 (APIO22_perm)C++17
10 / 100
124 ms12272 KiB
#include "perm.h" #include <bits/stdc++.h> #define pb(x) push_back((x)) using namespace std; using ll = long long; std::vector<int> construct_permutation(long long k) { vector<int> x; ll currSum = 1; for (int i = 0; currSum + (1 << i) <= k; i++) { x.pb(i); currSum += (1 << i); } for (int i = 1; i <= (k - currSum); i++) x.pb(-i); for (int& i : x) i += k - currSum; return x; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...