# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94728 | quoriess | Turnir (COCI17_turnir) | C++14 | 2400 ms | 45328 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |