답안 #171389

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
171389 2019-12-28T13:56:18 Z arnold518 앵무새 (IOI11_parrots) C++14
81 / 100
7 ms 1776 KB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static int N, *M;

void encode(int _N, int *_M)
{
    int i, j;
    N=_N; M=_M;

    for(i=0; i<N; i++)
    {
        for(j=0; j<8; j++)
        {
            if(M[i]&(1<<j))
            {
                send(i*8+j);
            }
        }
    }
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 64;

static int N, L, *X;
static int ans[MAXN+10];

void decode(int _N, int _L, int *_X)
{
    int i, j;
    N=_N; L=_L; X=_X;

    for(i=0; i<N; i++) ans[i]=0;
    for(i=0; i<L; i++)
    {
        ans[X[i]/8]+=(1<<(X[i]%8));
    }

    for(i=0; i<N; i++)
    {
        output(ans[i]);
    }
}

Compilation message

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:17:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;
            ^
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 888 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1520 KB Output is correct
2 Correct 5 ms 1520 KB Output is correct
3 Correct 5 ms 1520 KB Output is correct
4 Correct 5 ms 1512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1520 KB Output is correct
2 Correct 3 ms 1520 KB Output is correct
3 Correct 5 ms 1520 KB Output is correct
4 Correct 4 ms 1520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 1520 KB Output is correct
2 Correct 5 ms 1776 KB Output is correct
3 Correct 5 ms 1520 KB Output is correct
4 Correct 7 ms 1520 KB Output is correct
5 Correct 7 ms 1776 KB Output is correct
6 Correct 7 ms 1520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 5 ms 1520 KB Output is partially correct - P = 8.000000
2 Partially correct 7 ms 1520 KB Output is partially correct - P = 8.000000
3 Incorrect 4 ms 836 KB Error : Bad encoded integer
4 Incorrect 4 ms 888 KB Error : Bad encoded integer
5 Incorrect 4 ms 880 KB Error : Bad encoded integer
6 Incorrect 4 ms 836 KB Error : Bad encoded integer
7 Incorrect 4 ms 884 KB Error : Bad encoded integer