QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#819096#9237. MessageFlamire#0 201ms3996kbC++171.6kb2024-12-18 12:34:532024-12-18 12:34:53

Judging History

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

  • [2024-12-18 12:34:53]
  • 评测
  • 测评结果:0
  • 用时:201ms
  • 内存:3996kb
  • [2024-12-18 12:34:53]
  • 提交

answer

#include <bits/stdc++.h>
#include "message.h"
using namespace std;
int a[100011];long long seed=chrono::steady_clock::now().time_since_epoch().count();
void send_message(vector<bool> M,vector<bool> C)
{
	// printf("send_message():\n");
	// printf("M:");for(bool x:M)printf("%d",x);putchar(10);
	// printf("C:");for(bool x:C)printf("%d",x);putchar(10);
	mt19937 rnd(seed);
	int Sok=0,SC=0;
	for(int i=0;i<31;++i)SC|=C[i]<<i;
	while(Sok^SC)
	{
		// printf("Sok:%d SC:%d\n",Sok,SC);
		unsigned x=rnd();
		vector<bool> msg(C.size(),0);
		for(int j=0;j<C.size();++j)if(!C[j])msg[j]=x>>j&1;
		vector<bool> tt=send_packet(msg);
		for(int j=0;j<C.size();++j)if(tt[j]!=(x>>j&1))Sok|=1<<j;
	}
	M.push_back(1);
	while(M.size()<1025)M.push_back(0);
	int S=M.size(),pt=0;
	// printf("need %d\n",(S+15)/16);
	for(int i=0;i<(S+15)/16;++i)
	{
		vector<bool> msg(C.size(),0);
		for(int j=0;j<C.size();++j)if(!C[j])
		{//printf("(%d,%d) pt:%d\n",i,j,pt+1);
			if(pt<S)msg[j]=M[pt++];
		}
		send_packet(msg);
	}
}
vector<bool> receive_message(vector<vector<bool>> R)
{
	mt19937 rnd(seed);
	int K=R.size()-65;
	int SC=0;
	for(int i=0;i<K;++i)
	{
		unsigned x=rnd();
		for(int _=0;_<31;++_)if(R[i][_]!=(x>>_&1))SC|=1<<_;
	}
	// printf("C:");for(int i=0;i<31;++i)printf("%d ",SC>>i&1);putchar(10);
	// printf("K:%d\n",K);
	vector<bool> M;
	for(int i=K;i<R.size();++i)
	{
		for(int _=0;_<R[i].size();++_)if(!(SC>>_&1))M.push_back(R[i][_]);
	}
	// for(bool x:M)printf("%d ",x);putchar(10);
	while(!M.back())M.pop_back();
	M.pop_back();
	// for(bool x:M)printf("%d ",x);putchar(10);
	return M;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 164ms
memory: 3996kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

0
ing with message 'decoded message is incorrect'
Sending secret with code DIE to mgr2sol[1]
Quitting with result code 1

result:

wrong output format Extra information in the output file

Subtask #2:

score: 0
Wrong Answer

Test #8:

score: 0
Wrong Answer
time: 201ms
memory: 3764kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

0
ing with message 'decoded message is incorrect'
Sending secret with code DIE to mgr2sol[1]
Quitting with result code 1

result:

wrong output format Extra information in the output file