Submission #957573

#TimeUsernameProblemLanguageResultExecution timeMemory
957573vjudge1Permutation (APIO22_perm)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #define f first #define s second #define ent '\n' //#define int long long #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("Ofast,unroll-loops,fast-math,O3") const int dx[]={-1, 1, 0, 0, 0}; const int dy[]={0, 0, 1, -1, 0}; typedef long long ll; using namespace std; const int mx=5e6+12; const int mod=998244353; const bool T=1; int a[mx]; int n,m,k; vector<int> construct_permutation(long long k){ int bit=-1; for(int b=60;b>=0;b--){ if((k&(1ll<<b))){ bit=b; break; } } deque<int> ans; for(int i=0;i<bit;i++){ ans.push_back(i*300); } for(int i=0;i<bit;i++){ if((k&(1l<<i))){ ans.push_front(ans[ans.size()-i-1]+1); } } set<int> s; map<int,int> val; for(int x:ans){ s.insert(x); } int N=0; for(int x:s){ val[x]=N; N++; } vector<int> g; for(int x:ans){ g.push_back(val[x]); } return g; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...