| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 345764 | daniel920712 | Parrots (IOI11_parrots) | C++14 | 5 ms | 1488 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 "encoder.h"
#include "encoderlib.h"
#include <vector>
#include <algorithm>
using namespace std;
void encode(int N, int M[])
{
vector < pair < int , int > > all2;
int i,t=0;
for(i=0; i<N; i++)
{
send(M[i]);
send(M[i]);
send(M[i]);
send(M[i]);
all2.push_back(make_pair(M[i],i));
}
sort(all2.begin(),all2.end());
for(i=0;i<N;i++)
{
send(i/8*32+all2[i].second);
send(i/8*32+all2[i].second);
send(i%8*32+all2[i].second);
}
}#include "decoder.h"
#include "decoderlib.h"
#include <map>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
void decode(int N, int L, int X[])
{
vector < int > all;
map < int , int > con;
int ans[305];
int where[305];
int i,j, b;
for(i=0; i<L; i++)
{
con[X[i]]++;
}
for(i=0; i<N; i++) all.push_back(0);
for(auto i:con)
{
for(j=0;j<i.second/4;j++) all.push_back(i.first);
}
sort(all.begin(),all.end());
//for(i=0;i<N;i++) printf("%d\n",all[i]);
for(auto i:con)
{
//printf("%d %d\n",i.first,i.second);
//if(i.second%4) printf("%d\n",i.first/32);
if(i.second%4==2)
{
//printf("%d %d\n",i.first%16,i.first/16);
where[i.first%32]+=i.first/32*8;
}
else if(i.second%4==1)
{
where[i.first%32]+=i.first/32;
}
else if(i.second%4==3)
{
where[i.first%32]+=i.first/32;
where[i.first%32]+=i.first/32*8;
}
}
for(i=0; i<N; i++)
{
//printf("%d ",where[i]);
output(all[where[i]]);
//printf("%d\n",all[where[i]]);
}
}
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... | ||||
