Submission #1087050

#TimeUsernameProblemLanguageResultExecution timeMemory
1087050toast12Turnir (COCI17_turnir)C++14
100 / 100
1098 ms54608 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x = (1<<n); vector<int> nums(x); map<int, int> cnt; for (int i = 0; i < x; i++) { cin >> nums[i]; cnt[nums[i]]++; } int cur = 0; map<int, int> ans; for (auto c : cnt) { cur += c.second; int temp = log2(cur); ans[c.first] = n-temp; } for (int i = 0; i < x; i++) cout << ans[nums[i]] << ' '; cout << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...