Submission #65884

# Submission time Handle Problem Language Result Execution time Memory
65884 2018-08-09T05:20:59 Z jaehun630 Parrots (IOI11_parrots) C++14
0 / 100
6 ms 1832 KB
#include "encoder.h"
#include "encoderlib.h"

void encode(int N, int M[])
{
  int i;
  //subtask3
  for (i = 0; i < N; i++)
	  for(int j=0; j<=1; j++)
		j == 0 ? send((i << 5) + (M[i] >> 4)) : send((i << 5) + (j << 4) + M[i]);
}
#include "decoder.h"
#include "decoderlib.h"

void decode(int N, int L, int X[])
{
  int i, b;
  int ans[100] = { 0 };
  for(i=0; i<L; i++)
	  ans[X[i] / (1 << 5)] += (X[i] >> 4) == 0 ? (X[i] << 4) : X[i];
  
  for (int i = 0; i < N; i++)
	  output(ans[i]);
}

Compilation message

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:6:10: warning: unused variable 'b' [-Wunused-variable]
   int i, b;
          ^
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 864 KB Error : Output is wrong
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1832 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1832 KB Error : Bad encoded integer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1832 KB Error : Bad encoded integer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1832 KB Error : Bad encoded integer
2 Incorrect 5 ms 1832 KB Error : Bad encoded integer
3 Incorrect 6 ms 1832 KB Error : Bad encoded integer
4 Incorrect 6 ms 1832 KB Error : Bad encoded integer
5 Incorrect 4 ms 1832 KB Error : Bad encoded integer
6 Incorrect 4 ms 1832 KB Error : Bad encoded integer
7 Incorrect 4 ms 1832 KB Error : Bad encoded integer