Submission #1298314

#TimeUsernameProblemLanguageResultExecution timeMemory
1298314sanduchicuMessage (IOI24_message)C++20
0 / 100
468 ms732 KiB
#include <iostream>
#include <vector>

std::vector<bool> send_packet(std::vector<bool> A);

void send_message(std::vector<bool> M, std::vector<bool> C) {
	for (bool c : C) send_packet(std::vector<bool>(31, c));
	for (bool m : M) send_packet(std::vector<bool>(31, m));
}

std::vector<bool> receive_message(std::vector<std::vector<bool>> R) {
	std::vector<bool> C(31);

	for (int i = 0; i < 31; i++) {
		int count = 0;
		for (bool c : R[i]) {
			if (c) count++;
			else count--;
		}
		C[i] = count > 0 ? true : false;
	}

	std::vector<bool> result(R.size() - 31);
	for (int i = 31; i < R.size(); i++) {
		int count = 0;
		for (bool c : R[i-31]) {
			if (c) count++;
			else count--;
		}
		result[i-31] = count > 0 ? true : false;
	}
	return std::move(result);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...