# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
738754 | shantol | 순열 (APIO22_perm) | C++17 | 272 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sz size()
#define pb push_back
vector<int> construct_permutation(ll k){
vector<int> ans;
k--;
for(ll p=1, i=0;p<=k;i++,p=(p<<1)|1){
ans.pb(i);
}
ll p=ans.sz;
vector<vector<int>> v(p+1);
k=k-(1<<p)+1;
for(int i=ans.sz-1;i>=0;i--){
while(k>=(1<<i)){
v[i].pb(p++);
k-=(1<<i);
}
}
vector<int> val;
for(int i=0;i<ans.sz;i++){
for(int j:v[i])val.pb(j);
val.pb(ans[i]);
}
return val;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |