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

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 Article


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


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

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

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


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

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

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


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


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

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

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

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


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

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


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

MAXCOUNT WA

For the problem MAXCOUNT, the code below gives Wrong answer. Kindly explain the error.http://www.codechef.com/viewsolution/3661072

View Article


BIT(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 Article

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

Converting 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
Browsing all 39796 articles
Browse latest View live


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