# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
619529 | Lobo | Permutation (APIO22_perm) | C++17 | 547 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include<iostream>
#include<vector>
#include<deque>
#include<math.h>
using namespace std;
#define int long long
vector<int32_t> construct_permutation(int k)
{
int k1 = k;
int k2 = 1;
vector<int> ks;
for(int i = 2; i <= min((int) 5e5,k); i++) {
while(k%i == 0) {
ks.push_back(i);
k/=i;
}
}
ks.push_back(k);
vector<int32_t> vc;
for(auto k1 : ks) {
deque<int> ans;
// int lg = 0;
// for(int i = 0; i <= 60; i++) {
// if(k1 >= (1LL<<i)) lg = i;
// }
int lg = log2(k1);
for(int i = lg-1; i >= 0; i--) {
ans.push_back((int) ans.size()+vc.size());
if(k1&(1LL<<i)) ans.push_front((int) ans.size()+vc.size());
}
// cout << " " << k1 << endl;
for(auto x : ans) {
// cout << " 1 " << x << endl;
vc.push_back(x);
}
}
return vc;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |