답안 #18660

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
18660 2016-02-13T12:54:07 Z ggoh 앵무새 (IOI11_parrots) C++
98 / 100
12 ms 2624 KB
#include "encoder.h"
#include "encoderlib.h"

void encode(int N,int M[])
{
    int t=0,u=0,st[1002],stt[1002];
    for(int i=0;i<N;i++)
    {
        for(int j=0;j<M[i]/64;j++)st[t++]=i*4;
        for(int j=0;j<M[i]%64/16;j++)st[t++]=i*4+1;
        for(int j=0;j<M[i]%16/4;j++)st[t++]=i*4+2;
        for(int j=0;j<M[i]%4;j++)st[t++]=i*4+3;
        for(int j=0;j<3-M[i]/64;j++)stt[u++]=i*4;
        for(int j=0;j<3-M[i]%64/16;j++)stt[u++]=i*4+1;
        for(int j=0;j<3-M[i]%16/4;j++)stt[u++]=i*4+2;
        for(int j=0;j<3-M[i]%4;j++)stt[u++]=i*4+3;
    }
    if(t<u)
    {
        for(int i=0;i<t;i++)send(st[i]);
    }
    else
    {
        for(int i=0;i<u;i++)send(stt[i]);
        send(0);send(0);send(0);send(0);
    }
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N,int L,int X[])
{
    int ch[256]={};
    for(int i=0;i<L;i++)ch[X[i]]++;
    if(ch[0]<4)
    {
        for(int i=0;i<N;i++)
        {
            output(ch[i*4]*64+ch[i*4+1]*16+ch[i*4+2]*4+ch[i*4+3]);
        }
    }
    else
    {
        ch[0]-=4;
        for(int i=0;i<N;i++)
        {
            output((3-ch[i*4])*64+(3-ch[i*4+1])*16+(3-ch[i*4+2])*4+(3-ch[i*4+3]));
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 752 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 1592 KB Output is correct
2 Correct 7 ms 1592 KB Output is correct
3 Correct 6 ms 1624 KB Output is correct
4 Correct 6 ms 1728 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1848 KB Output is correct
2 Correct 5 ms 2032 KB Output is correct
3 Correct 6 ms 2144 KB Output is correct
4 Correct 5 ms 2144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 2144 KB Output is correct
2 Correct 5 ms 2144 KB Output is correct
3 Correct 9 ms 2144 KB Output is correct
4 Correct 7 ms 2144 KB Output is correct
5 Correct 7 ms 2144 KB Output is correct
6 Correct 8 ms 2176 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 5 ms 2176 KB Output is partially correct - P = 6.250000
2 Partially correct 7 ms 2176 KB Output is partially correct - P = 6.093750
3 Partially correct 7 ms 2176 KB Output is partially correct - P = 6.121212
4 Partially correct 9 ms 2176 KB Output is partially correct - P = 6.080000
5 Partially correct 11 ms 2176 KB Output is partially correct - P = 6.066667
6 Partially correct 12 ms 2432 KB Output is partially correct - P = 6.047619
7 Partially correct 11 ms 2624 KB Output is partially correct - P = 6.062500