You are not logged in. Please login at to post your questions!


Why i am getting wrong answer?

n=int(input()) diff=0 lead=0 leadingplayer=0 for i in range(n): a,b=input().split() a=int(a) b=int(b) diff=abs(a-b) if lead<diff: lead="diff" if="" a="">b: leadingplayer=1 elif b>a: leadingplayer=1 print(str(leadingplayer)+" "+str(lead)) This is my code for TLG problem that is very basic problem here and i think it is optimal solution to this problem also .And before codechef i am familiar with CP rules also but i dont know why this is giving Wrong answer.Please help

asked 31 Dec '18, 00:10

shubhamsks's gravatar image

accept rate: 0%

edited 31 Dec '18, 00:11

The code is not readable. Please post the link of your submission.


answered 31 Dec '18, 00:23

masood786's gravatar image

accept rate: 13%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • 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:


question asked: 31 Dec '18, 00:10

question was seen: 70 times

last updated: 31 Dec '18, 00:23