全红求助
  • 板块灌水区
  • 楼主The_rain
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/12/25 16:44
  • 上次更新2023/12/25 17:10:11
查看原帖
全红求助
593389
The_rain楼主2023/12/25 16:44

题目信

已过样例,但全红

#include<bits/stdc++.h>
using namespace std;
long long n,x,y,a,b,maxx,z,s,m,h,l,ql,j;
int main(){
	cin>>n>>x>>y>>a>>b;
	while(n--){
		cin>>s>>m>>h;
		h=h-s-m;
		if(!h){
			l++;
			ql=0;
			if(l>=b)j/=2;
		}
		else{
			l=0;
			ql++;
			j+=h;
			if(h>s+m)j=ceil(0.5*h)+j;
			if(ql>=a)j*=2;
		}
		if(maxx<j)maxx=j;
	}
	cout<<maxx<<" "<<j<<endl;
	return 0;
} 
2023/12/25 16:44
加载中...