Submission #1272304

#TimeUsernameProblemLanguageResultExecution timeMemory
1272304nhq0914Turnir (COCI17_turnir)C++17
100 / 100
388 ms10732 KiB
#include <bits/stdc++.h> using namespace std; int n; vector <int> a, b; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n; a.resize(1 << n); for(int i = 0; i < (1 << n); ++i) cin >> a[i]; b = a; sort(a.begin(), a.end()); for(int i = 0; i < (1 << n); ++i){ cout << n - __lg(upper_bound(a.begin(), a.end(), b[i]) - a.begin()) << ' '; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...