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

×

Right triangle problem

http://www.codechef.com/problems/RIGHTRI/

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

http://www.codechef.com/viewsolution/6449998

asked 10 Mar '15, 01:20

rishu97kr's gravatar image

2★rishu97kr
2527
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.

link

answered 10 Mar '15, 01:39

shivam217's gravatar image

4★shivam217
8373515
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 http://www.codechef.com/viewsolution/6454817. 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. http://www.codechef.com/viewsolution/6454925

(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
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×2,279
×1,725
×1,377
×1,139
×538
×249
×33

question asked: 10 Mar '15, 01:20

question was seen: 1,251 times

last updated: 11 Mar '15, 01:11