# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147821 | mariadinca | Turnir (COCI17_turnir) | C++14 | 819 ms | 21716 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>
using namespace std;
int n, m, i, dr, nivel, sol[2000001];
pair<int, int> v[2000002];
int main(){
cin>>m;
n = (1<<m);
for(i=1;i<=n;i++){
cin>>v[i].first;
v[i].second = i;
}
sort(v+1, v+n+1);
for(i=1;i<=n;i++){
nivel = 0;
dr = n;
while(v[i].first < v[dr].first)
dr /= 2, nivel++;
sol[v[i].second] = nivel;
}
for(i=1;i<=n;i++)
cout<<sol[i]<<" ";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |