Hi! I did the Allocation problem off of Kickstart's competition 2020. My
code run locally, but when I submitted it, it got the Wrong Answer error.
Can you guys please enlighten me what I could be doing wrong? I can't find
any errors in the code. I know this is a CodeJam group, but I couldn't find
the KickStart one (if it exists).
import sys
T = int(input())
for x in range(1, T+1):
N, B = map(int, input().split(' '))
arr = list(map(int, input().split(" ")))
arr.sort()
summ = 0
count = 0
for i in range(0, len(arr) - 1):
summ += arr[i]
if summ <= B:
count += 1
else:
break
print ('Case #{}: {}'.format(x, count))
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/11bcc35a-05f0-4555-998a-80ab277afead%40googlegroups.com.