ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1636. Penalty Time

WA8 Why?
Posted by Vincent Kotwizkiy [SESC] 31 Mar 2013 04:40
Can anybody give me test 8?
Code on python2:
a, b = map(int, raw_input().split(' '))
k = 0
c = map(int, raw_input().split(' '))
for x in xrange(1,10):
    k = k+c[x]*20
if b-k>a:
    print('No chance.')
elif b-k<a:
    print('Dirty debug :(')
elif b-k==a:
    print('No chance.')
Re: WA8 Why?
Posted by Snetch 15 Jan 2016 21:23
xrange(1, 10) only takes array elements 1-9. You need to use xrange(0, 10) to get elements 0-9