Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hehe = int(input())
- a = []
- asss = []
- for i in range(hehe):
- asd = []
- kaka = input()
- asd += int(kaka[0]), int(kaka[2])
- asss += [asd]
- maxx = 0
- luot = 1
- tien = 0
- def quaylui(a,cc=0):
- global maxx
- global luot
- global tien
- if a == []:
- return 0
- elif luot !=0:
- for i in range(0, len(a)):
- tien += a[i][0]
- if tien > maxx: maxx = tien
- luot -= 1 - int(a[i][1])
- index1 = a.index(a[i])
- lmao = a.copy()
- lmao.pop(index1)
- quaylui(lmao,1)
- tien -= int(a[i][0])
- luot +=1
- if cc == 0: return maxx
- print(quaylui(asss))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement