# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153837 | bogdan_buzatu | Turnir (COCI17_turnir) | C++14 | 844 ms | 15628 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |