# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
618069 |
2022-08-01T21:05:33 Z |
Lobo |
순열 (APIO22_perm) |
C++17 |
|
1000 ms |
276 KB |
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int32_t> construct_permutation(int k)
{
int k1 = k;
int k2 = 1;
for(int i = 1; i <= 1e8; i++) {
if(k%i == 0) {
k1 = i;
k2 = k/i;
}
}
vector<int32_t> vc;
deque<int> ans;
int lg = 0;
for(int i = 0; i <= 60; i++) {
if(k1 >= (1LL<<i)) lg = i;
}
for(int i = lg-1; i >= 0; i--) {
ans.push_back((int) ans.size());
if(k&(1LL<<i)) ans.push_front((int) ans.size());
}
for(auto x : ans) {
vc.push_back(x);
}
deque<int> ans2;
int lg2 = 0;
for(int i = 0; i <= 60; i++) {
if(k2 >= (1LL<<i)) lg2 = i;
}
for(int i = lg2-1; i >= 0; i--) {
ans2.push_back((int) ans2.size());
if(k2&(1LL<<i)) ans2.push_front((int) ans2.size());
}
for(auto x : ans2) {
vc.push_back(x);
}
return vc;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
933 ms |
276 KB |
Output is correct |
2 |
Execution timed out |
1092 ms |
212 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
933 ms |
276 KB |
Output is correct |
2 |
Execution timed out |
1092 ms |
212 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |