标签:lam 情况 题意 nbsp 产生 贪心 exce [] sorted
题意:
try:
while True:
n = input();
n = int(n);
a = [];
for i in range(0, n):
str = input().split();
a += [[int(str[0]), int(str[1])]];
a = sorted(a, key = lambda x: x[0]+x[1]);
sumv = 0;
maxx = 0;
for i in range(0, n):
maxx = max(maxx, sumv-a[i][1]);
sumv += a[i][0];
print(maxx);
except EOFError:
pass
【Python3】【贪心】hdu4296 Buildings
标签:lam 情况 题意 nbsp 产生 贪心 exce [] sorted
原文地址:https://www.cnblogs.com/autsky-jadek/p/8976832.html