| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1356719 | Toto | 순열 (APIO22_perm) | C++20 | 1 ms | 344 KiB |
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> construct_permutation(long long k)
{
vector<int> ans;
int minn=-1,maxn=0;
while(k>1){
if(k%2==0){
ans.push_back(minn);
minn--;
k/=2;
} else if(k%3==0){
ans.push_back(minn-1);
ans.push_back(minn);
minn-=2;
k/=3;
}else{
ans.push_back(maxn);
maxn++;
k--;
}
}
int total=ans.size();
for(int i=0;i<total;i++){
if(ans[i]<0)ans[i]=total+ans[i];
}
reverse(ans.begin(),ans.end());
return ans;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
