QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#629116#9241. SphinxZpairCompile Error//C++141.1kb2024-10-11 04:48:482024-10-11 04:48:48

Judging History

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

  • [2024-10-11 04:48:48]
  • 评测
  • [2024-10-11 04:48:48]
  • 提交

answer

#include "sphinx.h"
#include<bits/stdc++.h>
using namespace std;
//int perform_experiment(vector<int>E);
const int MAXN=255;
vector<int> e[MAXN];
int fa[MAXN];
int find(int x){
	return x==fa[x]?x:fa[x]=find(fa[x]);
}
void merge(int x,int y){
	x=find(x),y=find(y);
	fa[x]=y;
}
int cnt[MAXN];
vector<int> find_colours(int N,vector<int>X,vector<int>Y) {
	int M=X.size();
	for(int i=0;i<M;++i){
		e[X[i]].push_back(Y[i]);
		e[Y[i]].push_back(X[i]);
	}
	for(int i=0;i<N;++i)
		fa[i]=i;
	cnt[0]=1;
	for(int i=1;i<N;++i){
		vector<int> now(N,N);
		for(int j=0;j<=i;++j)
			now[j]=-1;
		int ret=perform_experiment(now);
		if(ret==cnt[i-1]+1){
			cnt[i]=cnt[i-1]+1;
			continue;
		}
		int l=0,r=i-1,mid=(l+r)>>1;
		while(l<r){
			for(int j=0;j<=mid;++j)
				now[j]=-1;
			for(int j=mid+1;j<i;++j)
				now[j]=N;
			now[i]=-1;
			for(int j=i+1;j<N;++j)
				now[j]=N;			
			ret=perform_experiment(now);
			if(ret==cnt[mid]+1)
				r=mid;
			else l=mid+1;
			mid=(l+r)>>1;
		}
		merge(i,l);
		cnt[i]=cnt[i-1];
	}
	vector<int> ans(N);
	for(int i=0;i<N;++i)
		ans[i]=find(i);
	return ans;
}

Details

implementer.cpp: In function ‘int {anonymous}::sz(const C&)’:
implementer.cpp:26:52: error: ‘size’ is not a member of ‘std’; did you mean ‘size_t’?
   26 | template<class C> int sz(const C& c) { return std::size(c); }
      |                                                    ^~~~
      |                                                    size_t