Submission #795962

# Submission time Handle Problem Language Result Execution time Memory
795962 2023-07-28T01:23:15 Z hgmhc Parrots (IOI11_parrots) C++17
0 / 100
1 ms 1036 KB
#include "encoder.h"
#include "encoderlib.h"

void encode(int n, int a[])
{
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 4; ++j) {
      send(i | (j << 4) | ((a[i]>>(2*j)&4) << 6));
    }
  }
}

// send에 8bit 표현
// a[i] < 2^8
// ?? / ?? / ?? / ??
// 00 / 01 / 10 / 11
// 4bit + 4bit
#include "decoder.h"
#include "decoderlib.h"

static const int N = 20;
static int ans[N];

void decode(int n, int l, int x[])
{
  for (int k = 0; k < l; ++k) {
    int i = x[k]&0b1111;
    int j = x[k]>>4&0b11;
    int v = x[k]>>6&0b11;
    ans[i] = v<<(2*j);
  }
  for (int i = 0; i < n; ++i)
    output(ans[i]);
}
// ans[i] < 2^8
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 648 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1036 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 520 KB Error : Bad encoded integer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 512 KB Error : Bad encoded integer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 520 KB Error : Bad encoded integer
2 Incorrect 0 ms 512 KB Error : Bad encoded integer
3 Incorrect 1 ms 512 KB Error : Bad encoded integer
4 Incorrect 0 ms 512 KB Error : Bad encoded integer
5 Incorrect 0 ms 512 KB Error : Bad encoded integer
6 Incorrect 1 ms 512 KB Error : Bad encoded integer
7 Incorrect 0 ms 516 KB Error : Bad encoded integer