QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#575100#9237. Messagemaxrgby0 151ms3832kbC++201.8kb2024-09-19 10:31:572024-09-19 10:31:57

Judging History

你现在查看的是最新测评结果

  • [2024-09-19 10:31:57]
  • 评测
  • 测评结果:0
  • 用时:151ms
  • 内存:3832kb
  • [2024-09-19 10:31:57]
  • 提交

answer

#include "message.h"
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pi = array<lint, 2>;
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define cr(v, n) (v).clear(), (v).resize(n);
const int MAXN = 200005;

void send_message(vector<bool> M, vector<bool> C) {
	vector<int> h(sz(C));
	for (int i = 0; i < sz(C); i++) {
		if (C[i] == 0) {
			for (int j = 1; j < 31; j++) {
				if (C[(i + j) % 31] == 0) {
					h[i] = j;
					break;
				}
			}
		}
	}
	int z = M.back() ^ 1;
	while (sz(M) < 1025)
		M.push_back(z);
	vector<vector<bool>> R(66, vector<bool>(31));
	int p = 0;
	for (int i = 0; i < sz(C); i++) {
		if (C[i] == 1)
			continue;
		R[h[i] - 1][i] = 1;
		for (int j = h[i]; j < 66; j++) {
			R[j][i] = M[p++];
		}
	}
	assert(p == 1025);
	for (auto &v : R)
		send_packet(v);
}

std::vector<bool> receive_message(std::vector<std::vector<bool>> R) {
    for(auto i : R){
		for(auto j : i){
			cout << j;
		}
		cout << endl;
	}
	vector<int> nxt(31), goodRow(31);
	for (int i = 0; i < 31; i++) {
		int j = 0;
		while (j < sz(R) && R[j][i] == 0)
			j++;
		j++;
		nxt[i] = (i + j) % 31;
	}
	for (int i = 0; i < 31; i++) {
		int p = i;
		for (int j = 0; j < 16; j++) {
			p = nxt[p];
			if (j < 15 && p == i) {
				p = -1;
				break;
			}
		}
		if (p == i) {
			for (int j = 0; j < 16; j++) {
				goodRow[p] = 1;
				p = nxt[p];
			}
			break;
		}
	}
	assert(count(all(goodRow), 1) == 16);
	vector<bool> ans;
	for (int i = 0; i < sz(goodRow); i++) {
		if (goodRow[i] == 0)
			continue;
		int h = (nxt[i] - i + 31) % 31;
		for (int j = h; j < 66; j++) {
			ans.push_back(R[j][i]);
		}
	}
	assert(sz(ans) == 1025);
	int z = ans.back();
	while (ans.back() == z)
		ans.pop_back();
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 129ms
memory: 3832kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager

1011110101111011101110110110111
1011111101111111111111110111111
1011111101111111111111111111111
0011111101111111111111111111111
0111111111111111111111111111111
0111111111111111111111111111111
1111111111111111111111111111111
0111111111111111111111111111111
0111111111111111111111111111111
011111111111...

Manager to Checker

0
ing with message 'Possible tampering with sol2mgr[1]'
Sending secret with code DIE to mgr2sol[1]
Quitting with result code 11

result:

wrong output format Extra information in the output file

Subtask #2:

score: 0
Wrong Answer

Test #8:

score: 0
Wrong Answer
time: 151ms
memory: 3832kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager

0101111110101111101101010111101
1101111101101111011011110111011
0101110111101111101011011111001
0111110110101111111101111110011
0111111011111111111011011110001
0101111001101111001111111111011
0111110111111111111001110111011
0111111001111111011011011111101
0111110001101111011001010111001
110111101011...

Manager to Checker

0
ing with message 'Possible tampering with sol2mgr[1]'
Sending secret with code DIE to mgr2sol[1]
Quitting with result code 11

result:

wrong output format Extra information in the output file