Submission #94728

#TimeUsernameProblemLanguageResultExecution timeMemory
94728quoriessTurnir (COCI17_turnir)C++14
100 / 100
2400 ms45328 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef pair<lli,lli> pii; #define dbg(x) cout<<#x<<" has a value of: "<<x<<"\n"; #define usize(x) (int)(x.size()) #define plist(x) for(int i=0;i<usize(x);i++)cout<<"eleman "<<i<<" = "<<x[i]<<"\n"; #define foreach(x) for(auto item:x) #define fill(s,x) for(int i=0;i<x;i++)cin>>s[i]; #define in(veriler,a) (veriler.find(a)!=veriler.end()) #define btw(x,y,z) x>=y && x<=z std::ostream& operator<<(std::ostream& os, pair<int,int> p) { os << p.first << ", " << p.second; return os; } int lgv(int x){ int i=0; while(x/2>0){ x/=2; i++; } return i; } int main(){ int n; cin>>n; map<lli,int> dz; vector<lli> vals(1<<n); for (int i = 0; i < 1<<n; i++) { lli a; cin>>a; vals[i]=a; if(!dz.count(a))dz[a]=0; dz[a]++; } int kh=0; foreach(dz){ kh+=item.second; dz[item.first]=lgv(kh); } for (int i = 0; i < 1<<n; i++) { cout<<n-dz[vals[i]]<<" "; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...