-
-
Save GaZ3ll3/fc84a10af23c5ce7e2e3 to your computer and use it in GitHub Desktop.
google code jam 2015 qround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
cases = int(raw_input()) | |
for c in xrange(cases): | |
# read in misc problem constants | |
x, y = map(str, raw_input().split()) | |
m = 0 | |
x = int(x) | |
s = int(y[0]) | |
for i in xrange(1, x+ 1): | |
if (i > s): | |
m = max(m, i - s) | |
s = s + int(y[i]) | |
# read in data | |
# problem solving logic here | |
# output answer | |
print "Case #%d: %d" % ((c+1), m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment