# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
717970 | 125259 | Permutation (APIO22_perm) | C++17 | 3 ms | 432 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
vector<long long>num;
void start(){
long long cnt=1;
for(int i=0; i<63; i++){
num.push_back(cnt);
cnt*=2;
}
return;
}
vector<int> construct_permutation(long long k){
start();
vector<int>v;
for(int i=62; i>=0; i--){
if(k>=num[i]){
v.push_back(i);
k-=num[i];
}
}
sort(v.begin(),v.end());
vector<int>vec;
int cnt=v.back()+v.size()-2;
int cnt1=0;
for(int i=0; i<v.size()-1; i++){
while(cnt1<v[i]){
vec.push_back(cnt1);
cnt1++;
}
vec.push_back(cnt); cnt--;
}
while(cnt1<v.back()){
vec.push_back(cnt1); cnt1++;
}
return vec;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |