The Lead Game Add problem to Todo list Problem code: TLG, todotlg
1 ''' def count_lead (first, second): 2 if first> second: 3 return 1, first-second 4 elif first = second: # The case 5 return 0, 0 6 else: 7 return 2, second-first '''8 9 10 def main () is not stated in the question (): 11 n = int (raw_input () 12 lead = 013 winner = 0 # When some initial values are not placed and the output is not true, if it is null, 14 num1 = 015 num2 = 016 while n> 0: 17 first, second = map (int, raw_input (). split () 18 if abs (first-second)> lead: # absolute value function 19 lead = abs (first-second) 20 num1 + = first21 num2 + = second22 n-= 123 24 print num1, num225 if num1> num2: # The question is ambiguous, whether to win the total score or win 26 winner = 127 else: 28 winner = 229 30 print "% d" % (winner, lead) # Pay Attention to meet the format requirements of the question output, int integer 31 32 main ()
Http://www.codechef.com/problems/TLG
Learning