QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#640585#4. GapDengDuckCompile Error//C++14682b2024-10-14 14:27:322024-10-14 14:27:37

Judging History

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

  • [2024-10-14 14:27:37]
  • 评测
  • [2024-10-14 14:27:32]
  • 提交

answer

#include<bits/stdc++.h> 
#define LL long long
using namespace std;
const LL inf=1e18;
extern "C" void MinMax(LL,LL,LL*,LL*);
extern "C" LL  findGap(int op,int n)
{
	LL mx=0,s,t,ss,tt;		
	MinMax(0,inf,&s,&t);
	if(op==1)
	{
		n-=2;
		while(n>0)
		{
			MinMax(s+1,t-1,&ss,&tt);
			n-=2;
			mx=max({mx,ss-s,t-tt});
			s=ss,t=tt;
		}
		mx=max(mx,t-s);
		return mx;
	}
	else
	{
		
		LL k=(t-s)/(n-1);
		LL lst=s,L=s+1,R;
		while(L<t)
		{
			R=min(L+k-1,t-1);
			MinMax(L,R,&ss,&tt);
			if(ss==-1)
			{
				k=max(k,R-lst+1),L=R+1;
				continue;
			}
			mx=max(mx,ss-lst);
			k=max(k,mx);
			lst=tt,L=R+1;
		}	
		mx=max(mx,t-lst);
	}
	return mx;
}

詳細信息

/usr/bin/ld: /tmp/ccP8SlPN.o: in function `main':
implementer.cpp:(.text.startup+0x1c6): undefined reference to `findGap(int, int)'
/usr/bin/ld: /tmp/ccbBkpuM.o: in function `findGap':
answer.code:(.text+0x3d): undefined reference to `MinMax'
/usr/bin/ld: answer.code:(.text+0xd3): undefined reference to `MinMax'
/usr/bin/ld: answer.code:(.text+0x169): undefined reference to `MinMax'
collect2: error: ld returned 1 exit status