Skip to content

Instantly share code, notes, and snippets.

@GaZ3ll3
Created April 11, 2015 07:47
Show Gist options
  • Save GaZ3ll3/fc84a10af23c5ce7e2e3 to your computer and use it in GitHub Desktop.
Save GaZ3ll3/fc84a10af23c5ce7e2e3 to your computer and use it in GitHub Desktop.
google code jam 2015 qround
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