제출 #153837

#제출 시각아이디문제언어결과실행 시간메모리
153837bogdan_buzatuTurnir (COCI17_turnir)C++14
100 / 100
844 ms15628 KiB
#include <iostream> #include <algorithm> #define pozitie second #define numar first using namespace std; pair<int,int>v[2000100]; int n,x,s[2000100]; int main(){ cin>>n; n=(1<<n); for(int i=1;i<=n;i++){ cin>>v[i].numar; v[i].pozitie=i; } sort(v+1,v+n+1); for(int i=1;i<=n;i++){ int lim=n; int sol=0; while(v[i].numar<v[lim].numar){ sol++; lim/=2; } s[v[i].pozitie]=sol; } for(int i=1;i<=n;i++){ cout<<s[i]<<" "; } }
#Verdict Execution timeMemoryGrader output
Fetching results...