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

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 Article


Editorial : 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 Article


Little 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 Article

a-"maze"-ing

Can everyone please discuss the logic for this problem. I find the submissions a bit difficult to understand.

View Article

DBOY-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 Article


STANDUP - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYMEDIUMPREREQUISITESDynamic Programming, Simple MathPROBLEM(Although the problem is stated slightly differently, I believe this interpretation of the problem is...

View Article

hotel 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 Article

racing 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 Article


Dementia 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 Article


TLE 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 Article

LMATRIX2-Editorial

PROBLEM LINK:PracticeContestAuthor:Ivan ZdomskyTester:Hiroto Sekido, Gerald AgapovEditorialist:Ajay K. VermaDIFFICULTY:ChallengePREREQUISITES:Chinese Remainder TheoremPROBLEM:We are given a rectangle...

View Article

treasure 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 Article

getting 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 Article


Dementia 2014: Snow leopard and addition of numbers

Please explain the logic of the problem http://www.codechef.com/DMNT2014/problems/REVADD/

View Article

find prime numbers fast by Sieve of Eratosthenes method

please can anybody explain Sieve of Eratosthenes method for finding prime numbers fast in c

View Article


How 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 Article

In 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 Article


Qsort 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 Article

Dementia 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 Article

Image may be NSFW.
Clik here to view.

A 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
Browsing all 40121 articles
Browse latest View live


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