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

×

Please help! Why did I get wrong answer in T>10 for the following code in XYPIZQ?


It seems like something is wrong at the corner case:

4 
1000000000 1 1000000000 999999999 999999998 
1000000000 2 1000000000 999999999 999999998 
1000000000 3 1000000000 999999999 999999998 
1000000000 4 1000000000 999999999 999999998

should give the answer

1000000003 2000000001
1 666666667
1000000001 2000000001
1 666666667

But your code gives the following output:

800000007 1600000010
1 666666661
999999918 1999999835
1 666666661

I don't know python but I guess there is some issue about 32-bit integers. Values of N may be small in the first subtask, so your code passes it, but gets wrong in the second one. The number of test cases, T, is most likely not a problem here.

link

answered 15 Jan, 20:02

petch's gravatar image

4★petch
181
accept rate: 14%

-1

I guess the verdict is shown incorrectly as WA when it should be TLE as you have clearly exceeded the time limit of 1 sec for the question. Your program takes more than 2.6 sec which is clearly exceeds the time limit. @vijju123 @admin ,please look into this.

link

answered 15 Jan, 09:20

akash19jain's gravatar image

3★akash19jain
726
accept rate: 12%

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:

×1,672
×422
×109
×73

question asked: 15 Jan, 08:36

question was seen: 148 times

last updated: 15 Jan, 20:02