1 " "def count_lead (First, second):2 If First > second:3 return 1, First-second4 elif First = = Second: # The question does not indicate an equal situation5 return 0, 06 Else:7 return 2, Second-first" " 8 9 Ten defMain (): Onen =Int (raw_input ()) ALead =0 -Winner = 0#some initial values are not placed, the judgment is not established and the output is empty. -NUM1 =0 thenum2 =0 - whilen >0: -First, second =map (int, raw_input (). Split ()) - ifABS (First-second) > lead:#Absolute Value function +Lead = ABS (first-second) -NUM1 + = First +Num2 + =Second AN-= 1 at - PrintNUM1, num2 - ifNUM1 > num2:#This place has the ambiguity, the total score wins or the branch wins -Winner = 1 - Else: -Winner = 2 in - Print "%d%d"% (winner, lead)#Note the format requirements that satisfy the problem output, int integer to +Main ()
Http://www.codechef.com/problems/TLG
Learn
The lead Game Add problem to Todo list problem Code:tlg