# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
982982 | Jawad_Akbar_JJ | Permutation (APIO22_perm) | C++17 | 4 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
const int N = 100 + 10;
vector<int> construct_permutation(long long k){
vector<int> ans;
long long o = 1;
for (int i=60;i>=0;i--){
if ((o<<i) & k){
for (int j=1;j<=i;j++)
ans.push_back(j * 1000);
while (i > 0){
i--;
if ((o<<i) & k)
ans.push_back(ans[i] - 500);
}
break;
}
}
int n = ans.size(),cur = 0;
vector<int> seen(n,0);
while (cur < n){
int ind = 0;
for (int i=0;i<n;i++)
if (!seen[i] and (seen[ind] or ans[i] < ans[ind]))
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |