Quantcast
Channel: CodeChef Discuss - latest questions
Browsing all 40121 articles
Browse latest View live
↧

factorial(n) /factorial(r1) factorial(r2)...factorial(rk)

ans = factorial(n) /factorial(r1) factorial(r2)...factorial(rk) where r1+r2+...+rk= n how to calculate this vale when n is large?I want the ans mod 1000000007 value any suggestions will be appreciated

View Article


finding median

i was studying selection in a worst case linear time algorithm which guarantee a good split in RANDOMIZED select to find ith smallest number. i am curious to know why it is so necessary to find median...

View Article


A humble request to all On-line IDE users!

This is just a request to all the ideone users or users of ne such online IDEs..please keep the visibility of your codes to user's so that no1 can search for it..this is just to avoid cheating cases in...

View Article

ATM question

include<iostream>include<iomanip>include<math.h>using namespace std; bool check(int x) { if(x%5==0) return true; else return false; }float withdraw(float balance, int amt) { return...

View Article

pls help me to find mistake

include<iostream>include<iomanip>include<math.h>using namespace std; bool check(int x) { if(x%5==0) return true; else return false; }float withdraw(float balance, int amt) { return...

View Article


Not able to submit in July Challenge

I am not able to select language in MountHoliday question in ongoing July challenge.Thus i am not able to submit.Please rectify this error ASAP.Thanks.

View Article

uva chemical attraction getting WA

okk i think this is a very hard problem.... coz only 17 people ever succeeded to get AC...problem...

View Article

randomized select

can anyone give me the iterative version of randomized select for finding the ith smallest number

View Article


NQUEEN problem

hii guys,i am trying to to do N-queen problem in which i have a function Place(k,i) which returns true if a queen can b placed at the K'th row and i'th column but am facing problem in understanding the...

View Article


pemutaion

can you give me a C++ program for calculating (n!/(p!q!r!)) where n,p,q,r are in the range of 100000... thanks in advance....

View Article

python NZEC error

import math; T=int(raw_input()); a=[]; for i in range(T): a=raw_input().split(); N=int(a[0]); M=int(a[1]); K=int(a[2]); n=math.factorial(N+M-2)/(math.factorial(N-1)*math.factorial(M-1));...

View Article

Concatinating Two Strings

#include<stdio.h> #include<conio.h> void main() { char a[25],b[25]; int i, j, k=1; puts("Enter the string A"); gets(a);fflush(stdin); puts("Enter the string B"); gets(b);fflush(stdin);...

View Article

help please

help in writing code to evaluate the foll. 4 : {1 1 1 1 , 1 2 2 , 2 1 2 , 2 2 1 , 1 3 , 3 1} size: 6 3 : {1 1 1 , 1 2 , 2 1} size: 3 2 : {1 1} size: 1

View Article


how to center align a number using printf

if 1 is given output=" 1 " if 12 is given output=" 12" if 123 is given output="123" thank you

View Article

decreasing runtime

hii guys,just wanted to know is there any other way other than BufferedReader or Scanner to make java program faster if yes will it make any difference in codechef submission and what time difference...

View Article


Help to me get right answer

i am solving chef and walking the rectangle problem of july 2013 challenge but i am getting wrong answer.Help to me correct my answer .This is my submission http://www.codechef.com/viewsolution/2329629...

View Article

SIGSEGV error

problem: http://www.codechef.com/problems/PRIMES2solution: http://www.codechef.com/viewsolution/2329374plz rectify this..

View Article


why the program showing runtime error ??

#include<stdio.h> int main() { int i; scanf("%d",i); while(i != 42) { printf("%d",i); scanf("%d",&i); } return (0); }

View Article

COUPON--getting wrong o/p though my solution is giving the right one

//Though I am getting the correct output it shows wrong output..someone please help include<stdio.h>int main() {int m,n,i,j,pp,t,k; scanf("%d",&t); while(t--) { scanf("%d%d",&m,&n);...

View Article

Can I get back the karma that I've awarded to someone?

I was going through the questions on the codechef forum, while reading @betlista's answer for http://discuss.codechef.com/questions/4240/why-the-program-showing-runtime-error , I thought the answer was...

View Article
Browsing all 40121 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>