QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#94026#4. Gapushg8877Compile Error//C++17773b2023-04-05 01:01:252023-04-05 01:01:28

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-05 01:01:28]
  • 评测
  • [2023-04-05 01:01:25]
  • 提交

answer

#include<bits/stdc++.h>
#include<gap.h>
using namespace std;
#define ll long long
#define MP make_pair
ll findGap(int sid,int n){
	if(sid==1){
		ll l=0,r=1e18;
		vector<ll> a;
		while(l<r){
			ll mn,mx;
			MinMax(l,r,&mn,&mx);
			a.push_back(mn);
			if(mx>mn) a.push_back(mx);
			l=mn+1,r=mx-1;
		}
		sort(a.begin(),a.end());
		ll ans=0;
		for(int i=0;i<a.size()-1;i++)
			ans=max(ans,a[i+1]-a[i]);
		return ans;
	}
	else{
		ll l=0,r=1e18,mn,mx;
		MinMax(l,r,&l,&r);
		ll lst=l,ans=0,len=r-l+1;
		vector<ll> blo(n-1);
		for(int i=0;i<n-1;i++)
			blo[i]=(len/(n-1))+(i<len%(n-1));
		for(int i=0;i<n-1;i++){
			MinMax(l,l+blo[i]-1,&mn,&mx);
			if(mn!=-1){
				ans=max(mn-lst,ans);
				lst=mx;
			}
			l+=blo[i];
		}
		return ans;
	}
}

詳細信息

answer.code:2:9: fatal error: gap.h: No such file or directory
    2 | #include<gap.h>
      |         ^~~~~~~
compilation terminated.