Submission #741541

# Submission time Handle Problem Language Result Execution time Memory
741541 2023-05-14T10:12:23 Z Mauve Permutation (APIO22_perm) C++17
91.3333 / 100
2 ms 340 KB
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define INF 1e18
#define ss second
#define ff first
ll n,m,i,j,ii,jj,l,r,k;
std::vector<int> construct_permutation(long long k)
{
    vector<int> v,suffix;
    l=1;
    for(i=0;i<=60;i++){
        if(l&k){
           j=i;
        }
        l*=2;
    }
    l=1;
    int r=0;
    for(i=0;i<j;i++){
        if(l&k){
            suffix.pb(r);
            r++;
        }
        l*=2;
        v.pb(r);
        r++;
    }
    for(i=suffix.size()-1;i>=0;i--) v.pb(suffix[i]);
    return v;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 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 Partially correct 2 ms 340 KB Partially correct
9 Correct 1 ms 340 KB Output is correct
10 Partially correct 2 ms 340 KB Partially correct
11 Partially correct 2 ms 340 KB Partially correct
12 Partially correct 1 ms 340 KB Partially correct
13 Partially correct 2 ms 340 KB Partially correct