QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#554519#9237. MessageEternatisCompile Error//C++142.0kb2024-09-09 11:45:412024-09-09 11:45:42

Judging History

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

  • [2024-09-09 11:45:42]
  • 评测
  • [2024-09-09 11:45:41]
  • 提交

answer

#include<bits/stdc++.h>
#include "message.h"
using namespace std;
#define N 1000010
#define int long long
#define db long double
#define pii pair<int,int>
#define st first
#define ed second
#define mkp make_pair
#define pb push_back
#define eps 1e-9
#define mod 998244353
#define mod2 1000000007
#define bs 13131
#define bs2 131
#define INF 0x3f3f3f3f3f3f3f3f
#define il inline
#define vi vector<int>
#define ins insert
#define umap unordered_map
#define uset unordered_set
#define R(x) x.begin(),x.end()
#define B(x) x.begin()
#define E(x) x.end()
#define lb lower_bound
#define ub upper_bound
il int read(){
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-')f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
int T=1,n,m,q,k;
int s[N];
char c[N];
vector<int> v[N];
il void solve(){
	n=read();
}
void send_message(std::vector<bool> M, std::vector<bool> C){
	M.pb(1),M.resize(1025,0);
	vector<int> p;
	vector<int> d(16);
	for(int i=0;i<31;i++)if(!C[i])p.pb(i);
	for(int i=0;i<16;i++)d[i]=(p[(i+1)%16]-p[i]+31)%31;
	vector<bool> data(66,vector<bool>(31,0));
	int pos=0;
	for(int i=0;i<16;i++){
		for(int j=0;j<d[i]-1;j++)data[p[i]][j]=0;
		data[p[i]][d[i]-1]=1;
		for(int j=d[i];j<66;j++)data[j][p[i]]=M[k++];
	}
	for(int i=0;i<66;i++)send_packet(data[i]);
}
std::vector<bool> receive_message(std::vector<std::vector<bool>> R){
	vector<int> to(31,0),vis(31,0);
	for(int i=0;i<31;i++)
		for(int j=0;j<66;j++)
			if(R[j][i]){
				to[i]=(i+j+j)%31;
				break;
			}
	vector<int> 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;
		}
	}
	vector<bool> 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;
}

Details

answer.code: In function ‘void send_message(std::vector<bool>, std::vector<bool>)’:
answer.code:54:48: error: no matching function for call to ‘std::vector<bool>::vector(int, std::vector<bool>)’
   54 |         vector<bool> data(66,vector<bool>(31,0));
      |                                                ^
In file included from /usr/include/c++/11/vector:68,
                 from /usr/include/c++/11/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:86,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_bvector.h:714:9: note: candidate: ‘template<class _InputIterator, class> std::vector<bool, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Alloc = std::allocator<bool>]’
  714 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:714:9: note:   template argument deduction/substitution failed:
answer.code:54:48: note:   deduced conflicting types for parameter ‘_InputIterator’ (‘int’ and ‘std::vector<bool>’)
   54 |         vector<bool> data(66,vector<bool>(31,0));
      |                                                ^
In file included from /usr/include/c++/11/vector:68,
                 from /usr/include/c++/11/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:86,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_bvector.h:702:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(std::initializer_list<bool>, const allocator_type&) [with _Alloc = std::allocator<bool>; std::vector<bool, _Alloc>::allocator_type = std::allocator<bool>]’
  702 |       vector(initializer_list<bool> __l,
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:702:37: note:   no known conversion for argument 1 from ‘int’ to ‘std::initializer_list<bool>’
  702 |       vector(initializer_list<bool> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_bvector.h:695:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(const std::vector<bool, _Alloc>&, const allocator_type&) [with _Alloc = std::allocator<bool>; std::vector<bool, _Alloc>::allocator_type = std::allocator<bool>]’
  695 |       vector(const vector& __x, const allocator_type& __a)
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:695:28: note:   no known conversion for argument 1 from ‘int’ to ‘const std::vector<bool>&’
  695 |       vector(const vector& __x, const allocator_type& __a)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_bvector.h:689:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&) [with _Alloc = std::allocator<bool>; std::vector<bool, _Alloc>::allocator_type = std::allocator<bool>]’
  689 |       vector(vector&& __x, const allocator_type& __a)
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:689:23: note:   no known conversion for argument 1 from ‘int’ to ‘std::vector<bool>&&’
  689 |       vector(vector&& __x, const allocator_type& __a)
      |              ~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_bvector.h:675:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&, std::false_type) [with _Alloc = std::allocator<bool>; std::vector<bool, _Alloc>::allocator_type = std::allocator<bool>; std::false_type = std::integral_constant<bool, false>]’
  675 |       vector(vector&& __x, const allocator_type& __a, false_type)
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:675:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/11/bits/stl_bvector.h:671:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&, std::true_type) [with _Alloc = std::allocator<bool>; std::vector<bool, _Alloc>::allocator_type = std::allocator<bool>; std::true_type = std::integral_constant<bool, true>]’
  671 |       vector(vector&& __x, const allocator_type& __a, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:671:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/11/bits/stl_bvector.h:668:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]’
  668 |       vector(vector&&) = default;
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:668:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/11/bits/stl_bvector.h:660:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]’
  660 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/11/bits/stl_bvector.h:660:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/11/bits/stl_bvector.h:647:7: note: candidate: ‘std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>:...