# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
60105 | theknife2001 | Parrots (IOI11_parrots) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void encode(int N, int M[])
{
for(int i=0;i<N;i++)
{
for(int j=0;j<8;j++)
{
if(M[i]&(1<<j))
{
if(i>15)
{
send(j+(i-16)*10);
send(j+(i-16)*10);
}
else
{
send(j+i*10);
}
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <algorithm>
#include <iostream>
#include <map>
using namespace std;
map < int , int > mp;
void decode(int N, int L, int X[])
{
int a[260];
for(int i=0;i<N;i++)
a[i]=0;
int x;
for(int i=0;i<L;i++)
mp[X[i]]++;
int f,s;
for(auto m:mp)
{
f=m.first;
s=m.second;
if(f!=0)
{
x=f%10;
f/=10;
}
else
f=0;
if(s>1)
{
a[f+16]+=(1<<x);
s-=2;
assert(0);
}
if(s==1)
{
a[f]+=(1<<x);
}
}
for(int i=0;i<N;i++)
output(a[i]);
}