| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 87040 | 7Polygonz | Turnir (COCI17_turnir) | C++11 | 638 ms | 23900 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
using namespace std ;
#include <bits/stdc++.h> /* #7th-Polygon */
const int N = 1 << 20 ;
int n , a[N] , b[N] ;
int GetBit(int mask)
{
for (int i = n ; i >= 0 ; --i)
if (mask & (1 << i))
return n - i ;
return n ;
}
int main()
{
ios::sync_with_stdio(false) ;
cout.tie(nullptr) ;
cin.tie(nullptr) ;
cin >> n ;
for (int i = 0 ; i < (1 << n) ; ++i)
cin >> a[i] ;
memcpy(b , a , sizeof(b)) ;
sort(b , b + (1 << n)) ;
for (int i = 0 ; i < (1 << n) ; ++i)
cout << GetBit(upper_bound(b , b + (1 << n) , a[i]) - b) << " " ;
return 0 ;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
