Submission #742404

# Submission time Handle Problem Language Result Execution time Memory
742404 2023-05-16T08:31:51 Z jamielim Flight to the Ford (BOI22_communication) C++17
0 / 100
15 ms 200 KB
#include "communication.h"
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ii,ii> i4;
typedef vector<int> vi;
const int MOD=1000000007;
const int INF=1012345678;
const ll LLINF=1012345678012345678LL;
const double PI=3.1415926536;
const double EPS=1e-14;

void encode(int N, int X) {
	int x=0;
    if(X==1){
		// [0101...][000 or 111]
		// or [11]
	}else{
		x=1;
		// [1010...][000 or 111]
		// or [00]
	}
	for(int i=0;i<10;i++){
		if(send(x)!=x){
			send(x^1);
			break;
		}
		x^=1;
	}
}

pair<int, int> decode(int N) {
	int x=receive();
	int y=receive();
	if(x==y){
		if(x==1)return {1,1};
		return {2,3};
	}
	if(x==1)return {2,3};
	return {1,1};
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 200 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 200 KB Not correct
2 Halted 0 ms 0 KB -