帮帮我
查看原帖
帮帮我
1269423
huge_wave楼主2024/9/7 19:01
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e6;
struct noid{
	int w,v,g=0;
}a[N];
int n,m,s;
int xxx(int mid){
	
}
main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>s;
	for(int i=1;i<=n;i++){
		cin>>a[i].w>>a[i].v;
	}
	for(int i=1;i<=m;i++){
		int ls,rs;
		cin>>ls>>rs;
		for(int j=ls;j<=rs;j++){
			a[j].g++;
		}
	}
	int l=0,r=N;
	int minn=1e13;
	while(l<r){
		int mid=(l+r+1)>>1;
		int d=xxx(mid);
		minn=min(minn,abs(s-d));
		if(d>=s){
			l=mid;
		}
		else{
			r=mid-1;
		}
	}
	cout<<l;
	return 0;
}
2024/9/7 19:01
加载中...