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

×

[closed] Calculating nCr mod (10^9 + 7) for large n

Hi all, I want to know approach on how does one calculate nCr mod (10^9 + 7) for large n efficiently. Max constraint on n is 10^9 and r is 10^3. Please share your approach!!

asked 11 Oct, 17:19

vivek_shah98's gravatar image

5★vivek_shah98
966
accept rate: 0%

closed 11 Oct, 22:37

vijju123's gravatar image

5★vijju123 ♦♦
15.1k11857

The question has been closed for the following reason "Closed." by vijju123 11 Oct, 22:37


Hmmmmm Hmmmm

link

answered 11 Oct, 22:25

gorre_morre's gravatar image

7★gorre_morre
934210
accept rate: 42%

i don't think its wrong to answer to such question and also ask as it is quite common and basic thing....

(11 Oct, 22:38) vivek_19982996★

Its a controversial topic. There are many people against it with valid arguments, and many people support it and their arguments are valid as well.

(11 Oct, 23:07) vijju123 ♦♦5★

Sorry....i didnt know it was from some ongoing contest,and since it was just a basic question ,i decided to answer...

(11 Oct, 23:13) vivek_19982996★

@vivek_1998299 Don't worry about it. You acted in good faith, you couldn't have known this was related to an ongoing contest. The disappointment is with the user who asked the question, not you.

(11 Oct, 23:42) algmyr7★

Hi all. I didn't have any bad intention. Say, suppose in tommorrow's contest there will be a problem relating to djisktra's. Does that mean that during whole contest it's prohibited to discuss anything related to djisktra's algorithm ? Tell me ?

(12 Oct, 00:47) vivek_shah985★

Ofcourse, there's no fault of @vivek_1998299. Morever, I took implementation from site (i will post here after contest ends) and gave proper attributes and references !!

(12 Oct, 00:55) vivek_shah985★

In brief, my point is if for example someone needs help with Dijkstra but there's some long challenge having a problem about Dijkstra's algorithm, do you think nobody should say a word about Dijkstra during the long contest? Moreover, where is nCr even written in problem statement of BBRICKS ? @gorre_morre, @algmyr, @vijju123

(12 Oct, 01:00) vivek_shah985★
1

Oh come on. The constraints are the exact constraints for BBRICKS, and it was obvious from context the question was asked in relation to that specific task. There is a huge difference between asking some generic question and asking a question that's obviously related to an active competition. If you had actually framed it as some generic question I wouldn't have minded that much, but as it stands it's just asking for help for a specific ongoing contest problem. @vivek_shah98

(12 Oct, 02:55) algmyr7★

@algmyr, you can check my implementation for this problem after the contest! I have added reference link from where I got the implementation. So even, if anyone wouldn't have answered my query, I could have solved the problem, no matter what, from the reference link, which I have mentioned in my submission. "it was obvious from context the question was asked in relation to that specific task", how does constraint which I mentioned guarantee that question was related to that particular task. There are many task with having same constraints.

(12 Oct, 03:36) vivek_shah985★
1

As I said, its a controversial topic. Yes, we cannot in general prohibit any discussion - whether contest or not, but its expected that contestants maintain decorum and guide themselves in accordance to moral rules and spirit of competition. As such, asking a question, which is very very related to the live contest's problemset, is always looked down upon, whether explicitly stated in rules or not. At cases, the users say that "This problem is from live contest, we will answer it after contest ends.". There are varying approaches and sides to this issue.

(12 Oct, 03:46) vijju123 ♦♦5★
1

@vivek_shah98 You're free and even encouraged to search for information wherever you want. Read Wikipedia, read previously asked question stackexchange-like sites, read published articles, use oeis, whatever you wish! What I find in bad taste is asking this kind of question directly connected to a contest during a contest.

(12 Oct, 04:32) algmyr7★
showing 5 of 11 show all

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:

×853
×25

question asked: 11 Oct, 17:19

question was seen: 443 times

last updated: 12 Oct, 04:32