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

×

wrong verdict DSERIES

Here is My solution:https://www.codechef.com/viewsolution/18687071

For Loc may problem DSERIES

asked 29 May '18, 20:52

doramon's gravatar image

3★doramon
865
accept rate: 5%


The constraints on N are upto 10^10 . So everytime you multiply by some factor of N you need to first take modulo . Specifically this line in your code lead to WA .

for(int i=0;i<=t;i++)
    ans=(ans*(n+1+i))%M;

Have a look at the modified version of your solution.

link

answered 30 May '18, 17:32

raj_13's gravatar image

4★raj_13
662
accept rate: 42%

Thankss :)

link

answered 02 Jun '18, 11:18

doramon's gravatar image

3★doramon
865
accept rate: 5%

1

accept his answer bro !! Instead of thanks..

(02 Jun '18, 13:21) l_returns5★
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:

×890

question asked: 29 May '18, 20:52

question was seen: 150 times

last updated: 02 Jun '18, 13:22