Submission #722958

#TimeUsernameProblemLanguageResultExecution timeMemory
722958The_SamuraiFlight to the Ford (BOI22_communication)C++17
0 / 100
895 ms1708 KiB
#include "bits/stdc++.h"
#include "communication.h"
using namespace std;
void encode(int N, int X) {
    vector<int> a(2);
    a[0] = X % 2;
    a[1] = (X / 2) % 2;
    for (int i = 0; i < 125; i++) {
        send(a[0]);
        send(a[1]);
    }
}

std::pair<int, int> decode(int N) {
    for (int i = 0; i < 124; i++) {
        int now = receive();
        now += receive() * 2;
        if (now == 3) continue;
        if (now == 0) return {1, 2};
        if (now == 1) return {1, 3};
        if (now == 2) return {2, 3};
    }
    return {3, 3};
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...