Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Sunday at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Jun 11, 2026
Ad icon
Wechat qr verification
Pawan2005
Updated:
Jun 11, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Tips & Tricks
nCr Engine(C++) + A joke
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="madurax86" data-source="post: 4271178" data-attributes="member: 1293"><p>dont know ban <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" /> i just put it because double tends to use scientific notation at 6 numbers(i think) nCr needs precision more than that ne so I used the long long, and long long long turned out to be the joke <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /> </p><p>Do you use the factorial simplification in ur code?</p><p>like, nCr=fact<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" />/fact(r)*fact(n-r)</p><p></p><p>if (r>n-r),</p><p>nCr=[(r+1)(r+2)(r+3)......(n-1)<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" />]/(n-r)! </p><p></p><p>if (r<n-r),</p><p>nCr=[(n-r+1)(n-r+2)(n-r+3)......(n-1)<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" />]/(n-r)! </p><p></p><p>for another simplification do the integer dividing too, I did that in my code. If java has more variable length then use these too then the output will be much larger <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /> and faster</p></blockquote><p></p>
[QUOTE="madurax86, post: 4271178, member: 1293"] dont know ban :P i just put it because double tends to use scientific notation at 6 numbers(i think) nCr needs precision more than that ne so I used the long long, and long long long turned out to be the joke :D Do you use the factorial simplification in ur code? like, nCr=fact(n)/fact(r)*fact(n-r) if (r>n-r), nCr=[(r+1)(r+2)(r+3)......(n-1)(n)]/(n-r)! if (r<n-r), nCr=[(n-r+1)(n-r+2)(n-r+3)......(n-1)(n)]/(n-r)! for another simplification do the integer dividing too, I did that in my code. If java has more variable length then use these too then the output will be much larger :D and faster [/QUOTE]
Insert quotes…
Verification
Dahaya deken beduwama keeyada?
Post reply
Top
Bottom