Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- N = int(input(' > '))
- K = N
- L = []
- min_times = 0
- temporary_time = 0
- iterations = 1000000
- for i in range(N):
- L.append(input(' > '))
- for i in range(iterations):
- for i in L:
- if N <= 0 :
- break
- j = random.randint(0,2)
- k = i.split()[j]
- temporary_time += int(k)
- N -= j + 1
- if min_times == 0 or temporary_time < min_times:
- min_times = temporary_time
- temporary_time = 0
- N = K
- print(min_times)
- input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement