modular exponentiation help
http://www.codechef.com/viewplaintext/3493800 pls explain me the code...y he taking 1000000006 for processing the second string????....thanks
View ArticleEditorial : Wilson's theorem
In number theory, Wilson's theorem states that a natural number n > 1 is a prime number if and only if ((n-1)!) mod n =(n-1)That is, it asserts that the factorial (n - 1)! = 1 * 2 * 3 *...
View ArticleLittle stuart and his teacher HackerEarth
Little Stuart is a smart guy, and he loves mathematics. Today his math teacher taught his class about common factors. After finishing the class his teacher asked them a question: For a given number "n"...
View Articlea-"maze"-ing
Can everyone please discuss the logic for this problem. I find the submissions a bit difficult to understand.
View ArticleDBOY-wrong ans
Someone please tell ,what is the problem in the logic of the following code : http://www.codechef.com/viewsolution/3499725or please provide me with some test case where my code fails.problem link :...
View ArticleSTANDUP - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYMEDIUMPREREQUISITESDynamic Programming, Simple MathPROBLEM(Although the problem is stated slightly differently, I believe this interpretation of the problem is...
View Articlehotel bytelandia easy
In this problem http://www.codechef.com/problems/HOTELthe 5th guest in the third sample input is arriving at 2 and leaving at 9 according to me there are 3 more guest arriving at the same time period...
View Articleracing horses easy
Dont know whats wrong with my solution pls help http://www.codechef.com/viewsolution/3500187algo i used is1>sorted the array2>found the minval from the sorted set by taking difference of each...
View ArticleDementia Problem MULFACT
What is wrong with my solution. I can't figure out what was wrong./* ashish1610 */ #include<bits/stdc++.h> using namespace std; #define mod 329885391853 /* fast input */ inline void inp(long long...
View ArticleTLE in DEMENTIA14 MULFACT
I have submitted the solution for the problem MULFACT but it got TLE.Here's my code :#include<`bits/stdc++.h`> using namespace std; #define MOD 329885391853 #define LL unsigned long long LL...
View ArticleLMATRIX2-Editorial
PROBLEM LINK:PracticeContestAuthor:Ivan ZdomskyTester:Hiroto Sekido, Gerald AgapovEditorialist:Ajay K. VermaDIFFICULTY:ChallengePREREQUISITES:Chinese Remainder TheoremPROBLEM:We are given a rectangle...
View Articletreasure hunting
can any one give me the algorithm how to solve the given problem???Treasure Hunting is a great computer game that has attracted generations of Bytelandian children.In the game, there is a maze divided...
View Articlegetting tle polo the penguin and test
problem link: www.codechef.com/problems/PPTESTmy code: http://www.codechef.com/viewsolution/3500235PLEASE HELP OPTIMIZE MY CODETHANKS IN ADVANCE!!
View ArticleDementia 2014: Snow leopard and addition of numbers
Please explain the logic of the problem http://www.codechef.com/DMNT2014/problems/REVADD/
View Articlefind prime numbers fast by Sieve of Eratosthenes method
please can anybody explain Sieve of Eratosthenes method for finding prime numbers fast in c
View ArticleHow do I submit a solution in Java?
The only example I can see is source code for a single class. My solution uses multiple classes. How do I submit this when only a single file can be uploaded? I have tried putting all source in a zip...
View ArticleIn Dementia2014/Mulfact how does one arrive at conclusion that that...
question link http://www.codechef.com/DMNT2014/problems/MULFACT. I got the concept(after the event :( ) but what I couldn't understand was as to how coders get to conclusion that after n=999983 all...
View ArticleQsort function in C
how does the qsort function work in Cqsort( s , n , sizeof(struct coord) , compare );how can one manipulate the compare function in qsort while sorting structure rather than a array like above and how...
View ArticleDementia 2014 SNOWWAVE
problem link Having a look at the AC submissions, it appears that the solution to this problem is (n - length of longest increasing sub-sequence). But how does it handle the cases like array : 3 1 2 3...
View ArticleA tutorial on the Extended Euclid's Algorithm
Hello @all,Following my previous tutorial on Repeated Squaring, I will now focus on the Extended Euclid's Algorithm, which as you will be able to see, can be seen as the reciprocal of modular...
View Article