n=5
s = [1,3,0,5,3,5,6,8,8,2,12]
f = [4,5,6,7,8,9,10,11,12,13,14]
a =[False, False, False, False, False, False, False, False, False, False, False ]
_list = zip(s,f)
print _list
def greedySelect(n, s, f, a):
a[0]=True
j = 0
for i in range(0,11):
if s[i] > f[j]:
a[i] = True
j = i
greedySelect(11, s, f,a)
print a
时间: 2024-10-17 13:11:29