QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#640585 | #4. Gap | DengDuck | Compile Error | / | / | C++14 | 682b | 2024-10-14 14:27:32 | 2024-10-14 14:27:37 |
Judging History
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