Dynamic Programming
I would like to know if I have overlapping subproblems in my solution for the problem http://www.geeksforgeeks.org/dynamic-programming-set-3-longest-increasing-subsequence/Here is my recursive solution...
View ArticleLEDIV WA error on judge n correct on ideone
i am getting correct answer on ideone and my compiler but on judge it gives WA..please help..#include<stdio.h> long int a[100000]={0}; int main(void) { long int t,n,i,min,flag,j,res; min=100000;...
View ArticleSIGSEGV:NUKES. Can someone please point out why my code gives SIGSEGV
Here's the code../*NUKES*/ #include<stdio.h> int main(void) { unsigned long long a,n,k; unsigned int arr[105]={0}; unsigned int i=0,j; scanf("%llu%llu%llu",&a,&n,&k); while(a) {...
View ArticleAPPROX2 getting WA
Can somebody give me a test case for which my code is not giving correct answer? My code http://www.codechef.com/viewsolution/4110093
View ArticleKNPSK - Editorial
PROBLEM LINK:PracticeContestAuthor:Konstantin SokolTester:Tasnim Imran SunnyEditorialist:Praveen DhinwaDIFFICULTY:EASY-MEDIUMPREREQUISITES:greedy, sortingPROBLEM:You are given N items, each item has...
View ArticleCOMPILER - Editorial
PROBLEM LINK:PracticeContestAuthor:Bruno OliveiraTester:Sergey KulikEditorialist:Lalit KunduDIFFICULTY:EASY PREREQUISITES:AD-HOC PROBLEM:Given a bracket sequence, print the length of largest prefix...
View Articleturbo sort. I am getting a time limit exceeded for my code. how should i...
include<stdio.h>int main() { int t,i,j,temp=0; scanf("%d",&t); int a[t]; for(i=0;i<t;i++) {="" scanf("%d",&a[i]);="" }="" for(i="0;i<t;i++)" {="" for(j="0;j<t-1;j++)"...
View ArticleLEBLOCKS - Editorial
PROBLEM LINK:PracticeContestAuthor:Vitaliy HerasymivTester:Shiplu HawladerEditorialist:Praveen DhinwaDIFFICULTY:MediumPREREQUISITES:expectation value, dynamic programming, simple...
View Articlethe lead game ..why am i getting wrong answer ...??? plzzz help :(
include<stdio.h>int main() { int n,i,leader,sum1=0,sum2=0,largest,l=0; scanf("%d",&n); int ply1[n],ply2[n],lead[n]; for(i=1;i<=n;i++) { scanf("%d",&ply1[i]); scanf("%d",&ply2[i]);}...
View ArticleCount of Maximum... Why my code is not accepted? Please help... :)
My Code...http://www.codechef.com/viewsolution/4087597
View Articleplz help...how to solvethis question..???(abc string)
http://www.codechef.com/problems/ABCSTR (link of question)
View ArticleHow to delete my CodeChef user name / account
I would like to delete my CodeChef user name/ account, please let me about the same ?
View ArticleCIEL8STR - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONLet S[a..b] denote the substring from a-th character to b-th character of S.One of the solutions for this problem is to use the fact that 1000 is...
View Articlethe lead game.....why am i getting wrong answer for my code..???
include<stdio.h>int main() { int n,i,leader,sum1=0,sum2=0,largest; scanf("%d",&n); int ply1[n],ply2[n],lead[n]; for(i=0;i<n;i++) { scanf("%d",&ply1[i]); scanf("%d",&ply2[i]);}...
View ArticleWA in FLIPCOINS
problem :: http://www.codechef.com/problems/FLIPCOIN/ SOLUTION :: http://www.codechef.com/viewsolution/4168860I am again and again getting wa... initially i used segmented trees with no lazy...
View ArticleMSTICK - 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 ArticleHow to use meet in the middle technique?
Can anyone write a tutorial on this technique?
View Articlegetting WA in lebombs
here is my code. pl tell me where its going wrong. tried all test cases I could think of.code
View ArticleMAXPR - Editorial
PROBLEM LINK:PracticeContestAuthor:Sergey NaginTester:Shiplu HawladerEditorialist:Praveen DhinwaDIFFICULTY:EasyPREREQUISITES:dynamic programming, simple combinatorics.PROBLEM:Given an array A. You have...
View Article