The lead Game Add problem to Todo list problem Code:tlg

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.