Submission #614260

# Submission time Handle Problem Language Result Execution time Memory
614260 2022-07-31T00:11:48 Z Plurm Flight to the Ford (BOI22_communication) C++17
0 / 100
298 ms 1752 KB
#include "communication.h"
#include <bits/stdc++.h>
using namespace std;

void sendbit(int bit) {
  for (int i = 0; i < 100; i++)
    send(bit);
}

void encode(int N, int X) {
  // N = 3
  if (X == 2)
    sendbit(1);
  else
    sendbit(0);
}

int recbit() {
  int cnt[2];
  cnt[0] = cnt[1] = 0;
  for (int i = 0; i < 100; i++) {
    cnt[receive()]++;
  }
  return cnt[0] > cnt[1] ? 0 : 1;
}

std::pair<int, int> decode(int N) { return {1, (recbit() ? 2 : 3)}; }
# Verdict Execution time Memory Grader output
1 Correct 75 ms 1752 KB Output is correct
2 Correct 123 ms 1740 KB Output is correct
3 Incorrect 90 ms 200 KB Not correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 298 ms 200 KB Not correct
2 Halted 0 ms 0 KB -