QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#554651#9237. MessageEternatisCompile Error//C++171.1kb2024-09-09 14:05:132024-09-09 14:05:13

Judging History

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

  • [2024-09-09 14:05:13]
  • 评测
  • [2024-09-09 14:05:13]
  • 提交

answer

#include<bits/stdc++.h>
#include "message.h"
using namespace std;
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
vector<vb> now;
void send_packet(vector<bool> v){
	now.pb(v);
}
//vb send_packet(vb a);
void send_message(vb M, vb C){
	M.pb(1),M.resize(1025,0);
	vi p;
	for(int i=0;i<31;i++)if(!C[i])p.pb(i);
	p.pb(p[0]+31);
	vector<vb> data(66,vb(31,0));
	int pos=0;
	for(int i=0;i<16;i++){
		int d=p[i+1]-p[i];
		data[d-1][p[i]]=1;
		for(int j=d;j<66;j++)data[j][p[i]]=M[pos++];
	}
	for(int i=0;i<66;i++)send_packet(data[i]);
}
vb receive_message(vector<vb> R){
	vi to(31),vis(31,0);
	for(int i=0;i<31;i++){
		to[i]=i;
		for(int j=0;j<66;j++)
			if(R[j][i]){
				to[i]=(i+j+1)%31;
				break;
			}
	}
	vi p,tmp;
	for(int i=0;i<31;i++){
		if(vis[i])continue;
		tmp.clear();
		int now=i;
		do{tmp.pb(now),now=to[now],vis[now]=1;}while(now!=i);
		if(tmp.size()==16){
			p=tmp;
			break;
		}
	}
	vb ans;
	for(auto x:p)
		for(int i=0;i<66;i++)
			if(R[i][x]){
				for(int j=i+1;j<66;j++)
					ans.pb(R[j][x]);
				break;
			}
	while(!ans.back())ans.pop_back();
	ans.pop_back();
	return ans;
}

詳細信息

answer.code:8:6: error: ambiguating new declaration of ‘void send_packet(std::vector<bool>)’
    8 | void send_packet(vector<bool> v){
      |      ^~~~~~~~~~~
In file included from answer.code:2:
message.h:5:19: note: old declaration ‘std::vector<bool> send_packet(std::vector<bool>)’
    5 | std::vector<bool> send_packet(std::vector<bool> A);
      |                   ^~~~~~~~~~~