Submission #911289

# Submission time Handle Problem Language Result Execution time Memory
911289 2024-01-18T17:54:32 Z hjroh0315 Permutation (APIO22_perm) C++17
0 / 100
1 ms 344 KB
#include"perm.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int>construct_permutation(long long k)
{
    vector<int>v;
    int x=0,y=999;
    while(k>0)
    {
        if(k&1)
        {
            v.push_back(y);
            y--;k--;
        }
        else
        {
            v.push_back(x);
            x++;k>>=1;
        }
    }
    map<int,int>mp;
    for(int i:v)mp[i];
    int cnt=0;
    for(auto&[a,b]:mp)b=cnt++;
    for(int&i:v)i=mp[i];
    return v;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -