# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
741585 | shantol | Permutation (APIO22_perm) | C++17 | 8 ms | 368 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sz size()
#define pb push_back
#define lb lower_bound
#define all(x) x.begin(),x.end()
vector<int> construct_permutation(ll k){
int bit=64-__builtin_clzll(k);
vector<double> ans;
bool flag=false;
while(bit>0){
bit-=2;
if(bit==-1){
ans.pb(100);
if(k&1)ans.pb(-100);
}
else{
int val=(k>>bit)&3;
if(ans.empty()){
if(val==2) ans.pb(0);
else ans={1,0},flag=true;
continue;
}
if(val==0){
ans.pb(100);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |