Best known algos for calculating nCr % M
I have often encountered calculating nCr problems the last one being one of the IIIT-M problems but it probably had weak test cases that got easy solutions AC. The other one...
View ArticleChange Language in Account
Hello Sir, I want to change language from C to C++ in my account. PLz help me how to change
View ArticleSPAM : Is that right decision to get SEO services from smm india company?
Is that right decision to get SEO services from smm india company?
View ArticleREPSTR - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYMEDIUMEXPLANATIONAt first, it is easy to prove that if there exists a substring with the length of K (K > 1) appearing the most times, there must exist another...
View ArticleBetter algorithm than O(nlogn)(or better implementation)
I have been trying to solve this SPOJ problem R2D2.I have been using segment tree.But I am getting TLE.Time limit is 7s. Constraints on input is following:T <= 10n <= 10^6This is my...
View ArticleTravelling Plan problem dilemma
Hello everyone. I am totally new to Codechef. I would rather say I am below novice level. So I went on to practice my first problem Traveling Plan. I would like to know if I assumptions are right:...
View ArticleABCSTR - Editorial
PROBLEM LINK:PracticeContestAuthor:Konstantin SokolTester:Gerald AgapovEditorialist:Tasnim Imran SunnyDIFFICULTY:SimplePREREQUISITES:Ad-Hoc, MapPROBLEM:Given a string S which is consisted of characters...
View ArticleIncrement and Decrement operator in c??
Please help me guys for ?? i am always confuse while i am facing a problem related to pre and post - increment & decrements operators in c ?? i know basic rule of pre and post increment but after...
View ArticleHelp me debug SIGKILL error.
I have been trying to solve http://www.spoj.com/problems/SUMFOUR/ . But I am getting SIGKILL error in the 10th test case (which I presume is the largest input case). If possible, please help me...
View Articlewa in spoj Cobbled streets!!!
hey constantly getting WA..though i have applied kruskal algorithm..plzzz help me guys.http://www.spoj.com/problems/CSTREET/ .here my code http://ideone.com/pAhcao
View ArticleBNGAME - Editorial
Problem link : contestpracticeDifficulty : EasyPre-requisites : Two pointersProblem : Calculate the minimum possible penalty for the game described.Explanation :The heart of the solution is the...
View Articlegetting wrong answer in small factorial
include<stdio.h>int main(){ int a,i,j; double z; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d",&j);="" for(z="1;j">0;j--) z=z*j; printf("%.0lf\n",z); } return 0; }
View Articlegetting TLE for subtask-1 and got AC for subtask-2 &3
for the DIVSUBS problem(DIVSUBS) i am getting TLE for subtask-1 (range of input is 1<=n<=15), but for subtask-2 (range of input is 1<=n<=1000) and subtask-3 (range of input is...
View Articleruntime error in CHEFBM
Can somebody tell why I am getting run time error(SIGSEGV) My soln:-http://www.codechef.com/viewsolution/3966627
View ArticleTANDC - Editorial
Problem link : contestpracticeDifficulty : Easy-MediumPre-requisites : Modular ArithmeticProblem : Find the maximal K that Mk divides an integer, obtained by the rules described in the problem...
View ArticleSomething Fishy about my code
This problem is about the most basic segment tree ,i guess that's what i've been told ,i'm trying to learn seg trees so please help me ,dont read and go away *In problem GSS1...
View ArticleWRONG ANSWER: PRIME1.Where did i go wrong?
/*prime1 using hashing*/ #include<stdio.h> int main(void) { int...
View ArticleWhy wrong answer? Works fine for all values on dev c++
include<stdio.h>int main() { int i,t; int a[100]; double q; double factorial(int m); scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d",&a[i]); } for(i=0;i<t;i++) { q=factorial(a[i]);...
View ArticleWhy do I get sigsegv in TSORT when i write my array as arr[10^6],and get AC...
The program ran properly on my computer when i used arr[10^6], but when i submitted it to the online judge i got sigsegv, i changed arr[10^6] to arr[1000000] and the program got accepted. I dont...
View Articlegetchar_unlocked()
Hey every1, i see every1 uses getchar_unlocked()for accepting 2 space separated integers. Can any1 please tell me how this function works and how to use it(detailed) because i dont know anything bout...
View Article