QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#68157#5029. 在路上xlwangCompile Error//C++141.1kb2022-12-14 20:23:082022-12-14 20:23:09

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-14 20:23:09]
  • 评测
  • [2022-12-14 20:23:08]
  • 提交

answer

#include<bits/stdc++.h>
#include"path.h"
#define fr(i,j,k) for(register int i=j;i<=k;++i)
#define randfind(l,r) ((rnd()%(r-l+1))+l)
using namespace std;
const int Maxn=5e4+10;
int num[5];
int vis[Maxn];
mt19937_64 rnd(114514);
int n;
int pop[Maxn];
inline int solve(int k,int id){
	if(k==1) {
		fr(i,1,n) if(vis[i]) return i;
	}
	int now1,now2;
	now1=randfind(1,1);now2=randfind(now1+1,k);
	int cnt=0;
	fr(i,1,n){
		cnt+=vis[i];
		if(cnt==now1){
			now1=i;
			break;
		}
	}
	if(id==1) return now1;
	cnt=0;
	fr(i,1,n){
		cnt+=vis[i];
		if(cnt==now2){
			now2=i;
			break;
		}
	}
	memset(num,0,sizeof(num));
	fr(i,1,n){
		if(vis[i]==0) continue;
		int tot;
		tot=ask(now1,now2,i);
		pop[i]=tot;
		if(tot==now1) ++num[1];
		if(tot==i) ++num[2];
		if(tot=now2) ++num[3];
	}
	if(k==1) return now1;k-=1;
	if(k<=num[1]){
		memset(vis,0,sizeof(vis));
		fr(i,1,n){
			if(vis[i]==0) continue;
			// if(pop[i]) ==
		}
	}
}
inline int centroid(int id,int N,int M){
	fr(i,1,N) vis[i]=1;
	if(N==3) return ask(1,2,3);
	n=N;
	return solve(N,(N+1)/2);
}

詳細信息

implementer.cpp: In function ‘int main()’:
implementer.cpp:60:14: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   60 |         fread(Interactor::rbuf,1,50000000,stdin);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cc6ekRjO.o: in function `main':
implementer.cpp:(.text.startup+0x249): undefined reference to `centroid(int, int, int)'
collect2: error: ld returned 1 exit status