QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#554124#9237. MessageXun_xiaoyao100 ✓251ms4100kbC++171.6kb2024-09-09 07:19:432024-09-09 07:19:45

Judging History

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

  • [2024-09-09 07:19:45]
  • 评测
  • 测评结果:100
  • 用时:251ms
  • 内存:4100kb
  • [2024-09-09 07:19:43]
  • 提交

answer

#include <bits/stdc++.h>
#include "message.h"
using namespace std;

namespace Aisha{
	vector<vector<bool>>R;
	vector<bool> M_;
	vector<bool>::iterator it;
	int nxt[31];
	void send_message(vector<bool> M,vector<bool> C)
	{
		vector<bool>().swap(M_),vector<vector<bool>>().swap(R);

		M_.resize(1025);
		R.resize(66,vector<bool>(31));
		for(int i=0,lm=M.size();i<lm;i++) M_[i]=M[i];
		M_[M.size()]=1;

		for(int i=0;i<31;i++) if(!C[i])
		{
			nxt[i]=1;
			while(C[(i+nxt[i])%31]) nxt[i]++;
			R[nxt[i]-1][i]=1;
		}

		it=M_.begin();
		for(int i=0;i<66;i++) for(int j=0;j<31;j++) if(!C[j]&&i>=nxt[j])
			R[i][j]=*it,it++;
		for(int i=0;i<66;i++) send_packet(R[i]);
	}
}

namespace Basma{
	int nxt[31],p[31];
	int C[31];
	vector<bool> M;
	vector<bool>::iterator it;
	vector<bool> receive_message(vector<vector<bool>> R)
	{
		M.resize(1025);it=M.begin();

		for(int i=0;i<31;i++)
		{
			nxt[i]=1;C[i]=1;
			while(nxt[i]<31&&!R[nxt[i]-1][i]) nxt[i]++;
			p[i]=(i+nxt[i])%31;
		}

		bool abl=true;
		for(int i=0;i<31&&abl;i++) for(int cnt=1,cur=p[i];cnt<=16;cnt++,cur=p[cur])
		if(cur==i)
		{
			if(cnt!=16) break;
			abl=false;
			C[i]=0;
			for(int cur=p[i];cur!=i;cur=p[cur]) C[cur]=0;
			break;
		}

		for(int i=0;i<66;i++) for(int j=0;j<31;j++) if(!C[j]&&i>=nxt[j])
			*it=R[i][j],it++;

		while(*(M.end()-1)==0) M.pop_back();
		M.pop_back();
		return M;
	}
}

void send_message(vector<bool> M,vector<bool> C){Aisha::send_message(M,C);}
vector<bool> receive_message(vector<vector<bool>> R){return Basma::receive_message(R);}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 141ms
memory: 4096kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #2:

score: 10
Accepted
time: 155ms
memory: 4020kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #3:

score: 10
Accepted
time: 152ms
memory: 3796kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #4:

score: 10
Accepted
time: 155ms
memory: 3748kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #5:

score: 10
Accepted
time: 115ms
memory: 4092kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #6:

score: 10
Accepted
time: 106ms
memory: 3984kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #7:

score: 10
Accepted
time: 109ms
memory: 3748kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Subtask #2:

score: 90
Accepted

Test #8:

score: 90
Accepted
time: 172ms
memory: 3792kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #9:

score: 90
Accepted
time: 122ms
memory: 3796kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #10:

score: 90
Accepted
time: 179ms
memory: 3824kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #11:

score: 90
Accepted
time: 178ms
memory: 4100kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #12:

score: 90
Accepted
time: 145ms
memory: 4024kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #13:

score: 90
Accepted
time: 84ms
memory: 3812kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #14:

score: 90
Accepted
time: 97ms
memory: 3784kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #15:

score: 90
Accepted
time: 95ms
memory: 3824kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #16:

score: 90
Accepted
time: 140ms
memory: 4024kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #17:

score: 90
Accepted
time: 148ms
memory: 3816kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #18:

score: 90
Accepted
time: 217ms
memory: 3760kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #19:

score: 90
Accepted
time: 115ms
memory: 3736kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #20:

score: 90
Accepted
time: 137ms
memory: 3740kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #21:

score: 90
Accepted
time: 154ms
memory: 3732kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #22:

score: 90
Accepted
time: 170ms
memory: 4012kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #23:

score: 90
Accepted
time: 203ms
memory: 3752kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #24:

score: 90
Accepted
time: 251ms
memory: 3812kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #25:

score: 90
Accepted
time: 177ms
memory: 3808kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #26:

score: 90
Accepted
time: 172ms
memory: 3812kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #27:

score: 90
Accepted
time: 123ms
memory: 3820kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Extra Test:

score: 0
Extra Test Passed