Longest Common subsequence
Supposing that we have a string not in the classic form but in a form like that A1B1C1D2E1G1F1 A1B1C1D2F1P1X1where the numbers are the frequencies of chars.How can i work the longest common...
View ArticleNot able to get the math behind this
I saw a solutions to this problem, but I'm not able to get the logic i.e. why gcd will answer this question ?
View ArticleWhy is my code not working?
QUES=> Write a recursive function using pointers to determine whether a string is palindrome, Capitalization and spacing are ignored. Test your with the following two palindromes and at least one...
View Articlesegment trees
hey hi!!! my code is giving WA for this spoj problem...http://www.spoj.com/problems/BRCKTS/my code... http://ideone.com/TcrDnAthanx in advance for the help///
View ArticleSmall Factorial Run time error SIGSEGV
My solution:#include<iostream> using namespace std; #define MAX 160 int a[MAX]; int main() { int n,j,x,index,temp,i; a[0]=1; index=0; cin>>x; for(j=1;j<=x;j++) { cin>>n;...
View ArticleSubarray 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 ArticleDivide by 0 contest
Hello @all,Sadly, I only saw that this contest was running when there were 15 min to its end... As such I couldn't submit a solution for a problem I really wanted to try out...Do you guys know if these...
View Articleprinting 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 Articlekgp summers
http://www.codechef.com/problems/NI02 constantly getting WA heres my code http://www.codechef.com/viewsolution/3323997
View ArticleHow 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 ArticleCodeCraft IIIT Hyderabad Editorials
Hi,Here are the link to the editorials:http://web.iiit.ac.in/~lalit.kundu/editorials.htmlhttp://web.iiit.ac.in/~lalit.kundu/editorials.pdfProblems are available for practice on spoj.ATOMS:...
View Articlerun time error
my program works perfectly on my compiler but if often shows runtime error when i submit to codechef can anyone suggest me to overcome this problem...
View ArticleFast 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 Articledivide by zero subtrees problem
http://www.codechef.com/DBYZ2014/problems/IITI16 can anybody explain idea to solve this problem
View ArticleArray Initilization
Hi all, my question is thatint a[2]={0}; cout<<a[1]; output is obut if i do int a[2]; a[0]=1; cout<<a[2]; output is a garbage value on g++ ubuntu 10.04in both case's it's partial...
View Articleproblems not added to practice
are problems of external contest (bytes 2014) will be added to practice..?
View ArticleHelp in MTRICK
Hello @all,As some people said that brute-force was possible for this problem, I decided to try and solve it that way and wrote the following code:#include <stdio.h> #include <algorithm>...
View ArticleSPOJ SIGABRT ERROR IN SPCS
My code is working fine for all the testcases in ideone and in mageia.... but when i submit in spoj it shows SIGABRT error... MY soln link :-- http://ideone.com/v0KuYL Question link :--...
View Article