MSTICK - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYSIMPLEPREREQUISITESRange Minimum Query, Simple MathPROBLEMYou are given N matchsticks arranged in a straight line, with their rearends touching each other. You are...
View Articlecompute a^b^c mod p
found this problem in a book to compute a ^ b ^ c mod p where p is prime and a, b, c are long longs.what can be the best way??
View ArticleCORRCHK - Editorial
Problem link: contestpracticeDifficulty: CakeWalkPre-requisites: Numeral systemsProblem: You're given a lot of statements of the form "A+B=C" (quotes for clarity). How many statements has a numeral...
View Articlecalculate f(n) = a*f(n-1) + b*f(n-2) matrix exponentiation
Given f(1)=1 , f(2)=1 , and f(n) = 100*f(n-1)+200f(n-2) . Now , i have to calculate f(n) rof n upto 10^9 , so obvious approach id to use matrix exponentiation .. I came up with this logic , but it...
View ArticleSHGAME - Editorial
Problem link:contestpracticeDifficulty: EasyPre-requisites: Nim gameProblem: Determine the number of winning positions for the first player in a two player game, described by the...
View ArticleWA IN SUBSGM
What is wrong with the following code http://ideone.com/0UVmG0 for the problem http://www.codechef.com/LTIME10/problems/SUBSGM.As per the subtask 1 (i.e. 1 <= N <= 100, 1 <= M <= 1000) is...
View ArticleFind the Bug in the logic
http://www.codechef.com/viewsolution/3659313 My code was able to pass all test cases except one...i used the sum=k/2(2a+(k-1)d) logic to find first term ... can u tell me why this logic has failed?(see...
View ArticleWA in A1 !
I am solving this problem.This is my solution : codeFor every case I could make, it gives correct answer. But on submission I get wrong answer.Please help what's wrong in the code. For which cases does...
View ArticleSUBSGM - Editorial
Problem link:contestpracticeDifficulty: EasyPre-requisites: Greedy, Segment treeProblem: Given an array. Handle queries of updating it's elements and output the size of the largest "nice" it's...
View Articlewap in c# for the following question.
wap to identify the occurrence of 3 consecutive integer in n numbers and replace them with middle value by deleting the other two
View ArticleSEQCOUNT - Editorial
Problem link:contestpracticeDifficulty: Easy-MediumPre-requisites: DPProblem: Count the number of increasing sequences of K natural numbers, where adjacent numbers differ no more than by D, the first...
View Articlemike3 how it can be solved using dynamic programming
hi the solution proposed by officials on mike 3 is good but some guys have applied knapsack on it in their codes so how can it be solved using dp plz help i devoted those days in order to find a dp...
View ArticleCodeforces Round #239 (Div. 2), problem: (D) Long Path solution
info: this post is for total noobs. dont waste your time if you are not gray on CF. btw, post below may have some errors.Codeforces Round #239 (Div. 2), problem: (D) Long Path: Codeforces Round #239...
View ArticleSPOON - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYHARD!! // Actually it is CAKEWALK !! Nice Scare :DEXPLANATIONThis was the easiest problem of the set. All one had to do is to examine all start positions (i,j) and...
View ArticleAd Infinitum - Math Programming Contest March'14 ---help
hackerrank.com currently organizing above mentioned contest...in this contest there are complex modulo related problems ....maximum problem gives TLE....can any one tell how to solve these (modulo...
View ArticleSuggest new features/updates for Codechef Ranking site
Hello most of you might be knowing about Codechef Ranking site : http://www.okrdx.com/DescriptionPluginFrom time to time the back-end and plugin was updated to suit the purpose of promoting...
View ArticleMAXCOUNT WA
For the problem MAXCOUNT, the code below gives Wrong answer. Kindly explain the error.http://www.codechef.com/viewsolution/3661072
View ArticleBIT(Binary Indexed Tree /Fenwick Tree )
Hey just studied BIT from http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees but couldnot understand how to know to calculate tree[idx],it must be question...
View ArticleHow to solve pow pow problem of spoj??
What woulde be the approch for this http://www.spoj.com/IPC07/problems/POWPOW/ question on spoj
View ArticleConverting adjacency matrix to adjacency lists
Hi guys,I'm now experimenting with Ford-Fulkerson Algorithm, which I am using to print the min-cut (as in, edges which comprise the min-cut).However, I am having some issues with memory and I wanted to...
View Article