0pts求调(壶关)
查看原帖
0pts求调(壶关)
995569
L__B楼主2025/7/18 23:02
#include<bits/stdc++.h>
using namespace std;
int n,x,s,ss,y,m,s1,s2,a,b,l,ma,t;
int main(){
    scanf("%d%d%d%d%d",&n,&x,&y,&a,&b);
    while(n--){
        scanf("%d%d%d",&s,&ss,&m);
        s1=s*x+ss*y,s2=m-s1;
        if(!s2){
            t--;
            if(t<=-b) l/=2;
        }
        else{
            t=max(t+1,0);
            l+=s2;
            if(s2>s1)
              l+=int(ceil(0.5*s2));
            if(t>=a) l*=2;
        }
        ma=max(l,ma);
    }
    printf("%d %d",ma,l);
    return 0;
}
2025/7/18 23:02
加载中...