# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
371018 | 2021-02-25T15:47:15 Z | FatihSolak | Turnir (COCI17_turnir) | C++17 | 2 ms | 512 KB |
#include <bits/stdc++.h> #define N 20 using namespace std; int arr[1<<N]; int brr[1<<N]; map<int,int> mp; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); int n; cin >> n; for(int i = 0;i<(1<<n);i++){ cin >> arr[i]; brr[i] = arr[i]; } sort(brr,brr+(1<<n)); int cnt = 0; int num = 0; int pw = 1; for(int i=0;i<(1<<n);i++){ if((i-cnt) == pw){ cnt += pw; pw = pw*2; num++; } mp[brr[i]] = n-num; } for(int i=0;i<(1<<n);i++){ cout << mp[arr[i]] << " "; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 364 KB | Output isn't correct |
2 | Incorrect | 2 ms | 364 KB | Output isn't correct |
3 | Incorrect | 2 ms | 512 KB | Output isn't correct |
4 | Incorrect | 2 ms | 364 KB | Output isn't correct |
5 | Incorrect | 2 ms | 364 KB | Output isn't correct |
6 | Incorrect | 2 ms | 364 KB | Output isn't correct |
7 | Incorrect | 2 ms | 364 KB | Output isn't correct |
8 | Incorrect | 2 ms | 364 KB | Output isn't correct |
9 | Incorrect | 2 ms | 364 KB | Output isn't correct |
10 | Incorrect | 2 ms | 364 KB | Output isn't correct |