求助
查看原帖
求助
955580
LOSpace楼主2023/7/18 15:46
#include <cstdio>
#include <algorithm>
using namespace std;
int n, x, y, a, b, p, q, t, S, s, m;
long long val, maxn;
int main() {
	scanf("%d%d%d%d%d", &n, &x, &y, &a, &b);
	for (; n--; ) {
		scanf("%d%d%d", &S, &s, &m);
		t = m - x * S + y * s;
		if (!t) {
			q = 0, p++;
			if (p >= b) val >>= 1;
		} else {
			p = 0, q++, val += t;
			if (t > x * S + y * s) val += (t + 1) >> 1;
			if (q >= a) val <<= 1;
			maxn = max(val, maxn);
		}
	}
	printf("%lld %lld", maxn, val);
	return 0;
}```
2023/7/18 15:46
加载中...