# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
671081 | 2022-12-11T23:01:15 Z | AdamGS | 순열 (APIO22_perm) | C++17 | 2 ms | 360 KB |
#include "perm.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() vector<int>construct_permutation(ll k) { vector<int>ans; if(k==1) return ans; if(k%3==0) { ans=construct_permutation(k/3); rep(i, ans.size()) ans[i]+=2; reverse(all(ans)); ans.pb(0); ans.pb(1); reverse(all(ans)); return ans; } if(k%2==1) { ans=construct_permutation(k-1); reverse(all(ans)); ans.pb(ans.size()); reverse(all(ans)); return ans; } ans=construct_permutation(k/2); rep(i, ans.size()) ++ans[i]; reverse(all(ans)); ans.pb(0); reverse(all(ans)); return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 304 KB | Output is correct |
4 | Correct | 1 ms | 296 KB | Output is correct |
5 | Partially correct | 1 ms | 340 KB | Partially correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 2 ms | 340 KB | Output is correct |
8 | Correct | 2 ms | 360 KB | Output is correct |
9 | Correct | 2 ms | 340 KB | Output is correct |
10 | Correct | 2 ms | 340 KB | Output is correct |
11 | Correct | 2 ms | 304 KB | Output is correct |
12 | Correct | 2 ms | 340 KB | Output is correct |
13 | Partially correct | 2 ms | 340 KB | Partially correct |