Introduction to Graphs: Definitions, Traversal, Depth-First Search
Hello @all,As I have mentioned on several posts here on forums, I am only now starting to learn graphs in a more educated, methodical and serious way, so, after I have studied DFS for few days and due...
View ArticleRIVPILE - approach
How did u guys solve RIVPILE? I was thinking of having n*m vertices where each vertex i,j represented reaching pile i with disk j. I used dijkstra to find min cost to reach such a vertex. But the...
View Articlehello sir...!! it is giving me runtime sigsegv error can u plzzz tell me why??
#include<stdio.h> //#include<conio.h> #include<string.h> #include<stdlib.h> const int size=400; char infix[400],postfix[400],stack[400]; int top=-1; int precedence(char ch);...
View ArticleHow to maintain running time in a program?
I want to know ,how can i know about running time of my program.For good performance ,I have to use an efficient algorithm,,but i want to know ,how can i tell about actual time taken by the...
View Articleruntime error
import java.io.*; class q { public static void main()throws IOException { InputStreamReader isr=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(isr); int arr[]=new int[5];...
View Articleruntime error
#include<stdio.h> #include<conio.h> #include<math.h> void main() { clrscr(); long unsigned int t=0,n1,n,count=0,n3,n4,num,n2; scanf("%lu",&n); n1=n-1; while(n1!=-1) {...
View Articlescanf error!!
Why the value of i an j are being printed ,even before the user is entering the char values?#include<stdio.h> #include<conio.h> int ans; int visited[101][101]={{0}}; char maze[101][101];...
View Articledata structure
please someone suggest me some good data structure books...so that i can implement it efficiently in the contest i want to learn more about hashing ,priorty queues and some useful data structures
View Articlewrong ans!!
plz....help me whats wrong in my code ?? which test cases i m missing?? heres the qus http://www.spoj.com/problems/HERDING/ and my sol #include<stdio.h> int ans;int p; int...
View Articlejuly cook off date
sir the page for july cook off has wrong date written .. it says 23rd july 21:30 (IST) but actually it is 21st July 21:30 (IST) .. so please kindly correct it .. even though the count down timer is...
View ArticleQuestions like RIVPILE
The question RIVPILE depicted a wonderful application of DIJKSTRA'S ALGORITHM! Can somebody post more questions like RIVPILE?
View ArticleHow to solve IOPC'12 Question GM Plants?
Looking at the submissions, it has been done by using three segment trees in x, y and z directions. The updates are ok but the query seems unusual. Also, how to obtain the formula r1r2r3 + r1g2g3 +...
View ArticleWA for FCTRL2.
#include<stdio.h> void B(int k); int a[200]; int sum,i; int main() { int k,n,o,l,t,j; scanf("%d",&t); for(j=1;j<=t;j++) {scanf("%d",&n); for(i=2;i<=170;i++) a[i]=0; a[0]=0; a[1]=1;...
View ArticleTLE with recursion in http://www.codechef.com/problems/CIRCUITS/
I applied binary search with a recursive checking routine,But i keep getting tle with that.But when i applied iterative checking function i got accepted. http://ideone.com/nxo2cn
View ArticleCHEFTEAM - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONSETTER'S SOLUTIONCan be found here.TESTER'S SOLUTIONCan be found here.
View ArticleGALACTIK - Editorial
PROBLEM LINKPracticeContestDIFFICULTYEASYPREREQUISITESDisjoint Set Data Structure, Simple MathPROBLEMThere are N nodes in a graph labeled from 1 to N. Each node has an associated cost with it, given by...
View ArticleBattleship V
http://www.codechef.com/problems/B3 I am stuck with this prob but i can't figure out. Can someone has explanation for this. Thnks
View Articlegalactik: wrong code being AC
It is quite strange that the case 5 0,-1,-1,-1,-1,-1 will give 0 while actual answer is -1..i don't think there was any constraint disallowing all negative costs or 0 connections ans still the code is...
View ArticleWeak test cases for TKCONVEX.
The test cases for the problem TKCONVEX are very weak. Even though the problem was rejudged during the contest, still I am able to find many solutions which fail very simple test case.8 4 1 2 3 6 6 6 6...
View Article