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

printing optimal solution of DP

Could someone please explain or post some code to help me understand how to use parent pointers in DP to print the optimal solution.Like printing the longest common subsequence not just its length...

View Article


kgp summers

http://www.codechef.com/problems/NI02 constantly getting WA heres my code http://www.codechef.com/viewsolution/3323997

View Article


Subarray XOR Problem

How to solve this problem http://www.codechef.com/CDCRFT14/problems/SUBBXOR I solved this problem with O(n^2) but got TLE . Please explain the efficient algorithm used in this problem .

View Article

SMHTC - Editorial

PROBLEM LINK:www.codechef.com/SMHT2014/problems/SMHTCDIFFICULTY:MEDIUM-HARDPREREQUISITES:Brute Force , BFS.EXPLANATION:The constraints make the problem to be solved by a Brute Force approach....

View Article

O(N) solution required

Given an array of numbers find all such triplets that satisfy the given condition.Condition: a[i] < a[j] < a[k] where I < j < k.

View Article


Where do I register for Codechef ID?

From where does i get the id required to participate in the contests ??

View Article

SMHTE - Editorial

PROBLEM LINK:http://www.codechef.com/SMHT2014/problems/SMHTEDIFFICULTY:CAKEWALKPREREQUISITES:None.EXPLANATIONThis problem can be solved by Brute Force. Dividing the number by 2 in a loop and checking...

View Article

Difference between sort(begin(),end()) and sort(begin(),end(),compare)

what is the exact difference between them?

View Article


Why is my Answer wrong??

All submissions for this problem are available.For help on this problem, please check out our tutorial Input and Output (I/O) Your program is to use the brute-force approach in order to find the Answer...

View Article


Why is my answer wrong for The Guessing Game (Easy)?

include <stdio.h>include <string.h>int main(int argc, const char * argv[]) { int j,t;scanf("%d",&t); for(j=0;j<t;j++) { int k,i,truth=0,lie; char str[90]; char a; int b,n;...

View Article

Fast Multiplication - explanation

I will try to explain the working of the fast multiplication function in brief.If we want to do an operation like 10^18 * 10^18 % MOD, where MOD is also of the order of 10^18, direct multiplication...

View Article

Confusion regarding modulo operaor

Referring to this solution http://www.codechef.com/viewsolution/3331816 (got AC) for the question http://www.codechef.com/problems/CLMBSTRS, i came across teh confusion regarding modulo operator. I...

View Article

How to find the most SUITABLE root for a given tree?

Hi,There are a number of problems involving trees in which we have to find LCA, distances etc. Such problems require that a node is assigned as a root node of the tree.Like in case of LCA-Dist(a,b) =...

View Article


SuperFunction

Can someone please explain the logic for (for SUBTASK 3 AND 4) http://www.codechef.com/LTIME07/problems/SFUNC of this question?! I m unable to get the same form editorial.

View Article

problem code:Flipcoin

i want to ask I don't know what algorithm to implement in this problem can you explained it. i almost give up on this.... i tried using array of bool that give me TLE for sure. i think about bitset too...

View Article


DP easy problems

Plz provide the link to easy DP problems on codechef/spoj

View Article

Maximum GCD of all pairs

I was thinking of problem : http://www.codechef.com/problems/BYTES4Given N integers, output the maximum value of GCD for all the pairs possible. How to approach this question? Please Help.

View Article


how to implement tutte matrix.?

i know that tutte matrix is used to check perfect matching in a given graph? and we make a skew symmetric matrix in it. but how to implement it? can anybody help me out.? Thanks in advance :) (PS : I...

View Article

Testing of own code.

Problems given has examples of very small size, when you try that you get correct answer and in less time. but, when the expected range is so long how to check that one. My question is can i get the...

View Article

A doubt in Java

I saw many programs containing objects but in all of them object was declared in static method. So, I have a following doubt.How to use the objects which are not defined in static methods ? Can you...

View Article
Browsing all 40121 articles
Browse latest View live


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