# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170580 | mdn2002 | Turnir (COCI17_turnir) | C++14 | 1591 ms | 38520 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<bits/stdc++.h>
using namespace std;
const long long mod=998244353;
int n,x,a[(1<<20)+3],b[(1<<20)+3];
map<int,int>m;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
//freopen("lemonade.in","r",stdin);
//freopen("lemonade.out","w",stdout);
cin>>n;
x=1<<n;
for(int i=0;i<x;i++)
{
cin>>a[i];
b[i]=a[i];
}
sort(a,a+x);
for(int i=0;i<x;i++)
{
int num=upper_bound(a,a+x,a[i])-a,ans=n+1;
while(num)
{
num/=2;
ans--;
}
m[a[i]]=ans;
}
for(int i=0;i<x;i++)cout<<m[b[i]]<<' ';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |