Submission #1187724

#TimeUsernameProblemLanguageResultExecution timeMemory
1187724rainmarParrots (IOI11_parrots)C++20
Compilation error
0 ms0 KiB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;

string intToBinaryString(uint16_t number) {
  return bitset<16>(number).to_string();
}

void encode(int N, int M[])
{
  string e = "";
  uint16_t i, b;
  for(i=0; i<N; i++) {
    b = M[i];
    e += intToBinaryString(b);
  }
  for (size_t i = 0; i < e.size(); i++) {
    if (e[i] == '1') {
        send(i);
    }
  }
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

string intToBinaryString(int number) {
  return bitset<32>(number).to_string();
}

void decode(int N, int L, int X[]) {
  string binary(N * 16, '0');

  for(int i = 0; i < L; i++) {
      binary[X[i]] = '1';
  }

  for (int i = 0; i < N; i++) {
      string byteStr = binary.substr(i * 16, 16);
      int value = bitset<16>(byteStr).to_ulong();
      send(value);
  }
}

Compilation message (stderr)

# 2번째 컴파일 단계

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:20:7: error: 'send' was not declared in this scope
   20 |       send(value);
      |       ^~~~