Submission #595073

# Submission time Handle Problem Language Result Execution time Memory
595073 2022-07-13T10:32:13 Z Andyvanh1 Permutation (APIO22_perm) C++17
0 / 100
0 ms 212 KB
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;


std::vector<int> construct_permutation(long long k){
    int Max = 0;
    int cur = 0;
    for(int i = 0; i < 60; i++){
        if((((long long)1)<<i)&k){
            Max = i;
            cur++;
        }
    }
    vector<int> ans(Max);
    
    for(int i = 0; i < Max; i++){
        if((((long long)1)<<i)&k){
            cur--;
            ans.push_back(Max+cur);
            
        }
        ans.push_back(i);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -