# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
67402 | zetapi | Parrots (IOI11_parrots) | C++14 | 9 ms | 2328 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 "decoder.h"
#include "decoderlib.h"
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
typedef pair<int,int> pii;
const int MAX=1e5;
void decode(int N, int L, int X[])
{
assert(L==4*N);
vector<int> vec;
map<int,int> maps;
int res[1000]={0};
for(int A=0;A<L;A++)
maps[X[A]]++;
for(auto A:maps)
{
int cur=A.second;
if(cur>=3)
{
cur-=3;
vec.pb(A.first);
}
}
sort(vec.begin(),vec.end());
for(auto A:maps)
{
if(A.second%3==0)
continue;
int ind=0,num=0;
for(int B=0;B<4;B++)
if(A.first&(1<<B))
ind+=(1<<B);
for(int B=0;B<4;B++)
if(A.first&(1<<(B+4)))
num+=(1<<B);
assert(res[ind]==0);
res[ind]=num;
}
for(int A=0;A<N;A++)
output(vec[res[A]]);
return ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |