# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
170580 | mdn2002 | Turnir (COCI17_turnir) | C++14 | 1591 ms | 38520 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |