Merge branch 'fix'

This commit is contained in:
2026-08-18 10:19:21 +08:00
+2 -5
View File
@@ -4,10 +4,6 @@ using namespace std;
struct node
{
int w, s;
const bool operator<(const node &x) const
{
return w + s < x.w + x.s;
}
} a[50005];
int main()
{
@@ -15,7 +11,8 @@ int main()
scanf("%d", &n);
for (int i = 1; i <= n; ++i)
scanf("%d%d", &a[i].w, &a[i].s);
sort(a + 1, a + 1 + n);
sort(a + 1, a + 1 + n, [](node x, node y)
{ return x.w + x.s < y.w + y.s; });
int tot = 0, ans = -2147483648;
for (int i = 1; i <= n; ++i)
{