×

 0 1 This is for the problem "Lead Game". I'm sure my error is a sneaky testcase, a situation I don't expect. Can someone tell me what is wrong with my code? And also, if there is any way to improve it? Thanks. This is python BTW. highScore = 0 winner = 0 lead = 0 n = int(input()) for x in range(n): t1,t2 = list(map(int,input("").split())) if t1 > t2: lead = t1-t2 if lead > highScore: highScore = lead winner = 1 elif t2 > t1: lead = t2-t1 if lead > highScore: highScore = lead winner = 2 print(str(winner) + " " + str(highScore))  asked 30 Dec '17, 00:05 2★kalesaur 36●3 accept rate: 33%

 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×868
×740
×444
×190
×43
×9

question asked: 30 Dec '17, 00:05

question was seen: 228 times

last updated: 30 Dec '17, 00:23