Skip to content

Instantly share code, notes, and snippets.

@raullenchai
Created April 13, 2012 02:53
Show Gist options
  • Save raullenchai/2373187 to your computer and use it in GitHub Desktop.
Save raullenchai/2373187 to your computer and use it in GitHub Desktop.
Qualification Round Africa 2010 (A)
"""
http://code.google.com/codejam/contest/351101/dashboard#s=p0
"""
__author__ = 'Raullen'
f = open('C-small-practice.in','r')
N = int(f.readline())
g = open('res.out','w')
res = list()
for case in range(N):
C = int(f.readline())
mylen = int(f.readline())
mylist = str(f.readline()).split()
for i in range(mylen):
try:
tmp_idx = mylist[i+1:].index(str(C-int(mylist[i])))
print 'Case #'+str(case+1)+': ', i+1, tmp_idx+i+2
break
except:
pass
g.writelines(res)
g.close()
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment