QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#335401#4. GapCrysflyCompile Error//C++17718b2024-02-23 12:06:212024-02-23 12:06:22

Judging History

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

  • [2024-02-23 12:06:22]
  • 评测
  • [2024-02-23 12:06:21]
  • 提交

answer

#include<bits/stdc++.h>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(register int i=(a);i>=(b);--i)
typedef int iint;
#define int long long

long long findGap(iint T, iint n)
{
	if(T==1){
		int b1,bn,res=0,b2,bn2;
		MinMax(0,1e18,&b1,&bn);n-=2;
		while(n>0)
		{
			MinMax(b1+1,bn-1,&b2,&bn2);n-=2;
			res=max(res,max(b2-b1,bn-bn2));
			b1=b2;
			bn=bn2;
		}
		res=max(res,bn-b1);
		return res;
	}
	int res=0;
	int a1,an,al,ar;
	MinMax(0,1e18,&a1,&an);
	int k=(an-a1)/(n-1),lst=a1;
	if((an-a1)%(n-1))++k;
	for(int l=a1+1;l<an;l+=k)
	{
		int r=min(l+k-1,an-1);
		MinMax(l,r,&al,&ar);
		res=max(res,al-lst);
		if(ar>0)lst=ar;
	}
	return max(res,an-lst);
}

Details

answer.code: In function ‘long long int findGap(iint, iint)’:
answer.code:11:17: error: ‘MinMax’ was not declared in this scope
   11 |                 MinMax(0,1e18,&b1,&bn);n-=2;
      |                 ^~~~~~
answer.code:15:37: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   15 |                         res=max(res,max(b2-b1,bn-bn2));
      |                                     ^~~
      |                                     std::max
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: ‘std::max’ declared here
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:15:29: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   15 |                         res=max(res,max(b2-b1,bn-bn2));
      |                             ^~~
      |                             std::max
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: ‘std::max’ declared here
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:19:21: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   19 |                 res=max(res,bn-b1);
      |                     ^~~
      |                     std::max
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: ‘std::max’ declared here
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:24:9: error: ‘MinMax’ was not declared in this scope
   24 |         MinMax(0,1e18,&a1,&an);
      |         ^~~~~~
answer.code:29:23: error: ‘min’ was not declared in this scope; did you mean ‘std::min’?
   29 |                 int r=min(l+k-1,an-1);
      |                       ^~~
      |                       std::min
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: ‘std::min’ declared here
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:31:21: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   31 |                 res=max(res,al-lst);
      |                     ^~~
      |                     std::max
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: ‘std::max’ declared here
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:34:16: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   34 |         return max(res,an-lst);
      |                ^~~
      |                std::max
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: ‘std::max’ declared here
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~