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


Right triangle problem

for the above question my code is showing TLE but i have seen soutions with exactly same coding accepted in 0.00 time. what's the mistake

asked 10 Mar '15, 01:20

rishu97kr's gravatar image

accept rate: 0%

In your solution, you have a problem in the input function. You should add opening and closing braces and include ch=gc() inside the braces. I had added them but got wrong answer. Check here.


answered 10 Mar '15, 01:39

shivam217's gravatar image

accept rate: 20%

oo thnx..!! can you help me on that WA ??

(10 Mar '15, 17:00) rishu97kr2★

I just used scanf() to take input and it got accepted So that means there was a problem in the input function.Since your function does not take care of leading spaces, so I think there may leading spaces in the input file which are causing WAs.Hence I changed input() function and got AC.

(10 Mar '15, 17:30) shivam2174★

thnx shivam... so does it means i have to keep that extra statement for further submissions... i mean is there a drawback of that statement if there are no leading spaces or any other general case?

(11 Mar '15, 00:22) rishu97kr2★

Yes, you should keep that extra statement in your further submissions. There is no harm in keeping that line. Your code will work fine whether there are leading spaces or not.

(11 Mar '15, 01:11) shivam2174★
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: 10 Mar '15, 01:20

question was seen: 1,318 times

last updated: 11 Mar '15, 01:11