| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 579794 | peuch | 순열 (APIO22_perm) | C++17 | 2 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> construct_permutation(long long k)
{
deque<int> dq;
stack<bool> op;
while(k > 1){
if(k % 2 == 0){
op.push(0);
k /= 2;
}
else{
op.push(1);
k--;
}
}
int cur = 0;
while(!op.empty()){
int val = op.top();
op.pop();
if(val == 0) dq.push_back(cur++);
else dq.push_front(cur++);
}
vector<int> ret;
while(!dq.empty()){
ret.push_back(dq.front());
dq.pop_front();
}
return ret;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
