Search found 4 matches

by reemuskumar
Tue May 08, 2007 2:17 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 27254

pbm 195

What is wrong with this code ? I'm getting signal error while submitting, it is runs fine in my system. Pls let me know what is the stress input. #include <iostream> #include <cstring> #include <cstdlib> using namespace std; int charmap[256]; void print_str(char*); class node { private: char data[10...
by reemuskumar
Wed Jul 26, 2006 3:47 pm
Forum: Algorithms
Topic: longest path
Replies: 7
Views: 2546

longest path

Hi all,

I'm tring to solve 103 Box Stacking problem. I have a graph representation of the boxes in adjacency list.

Is there is any good algorithm to find the longest path ? (any reference)

Thanks,
Reemus Kumar
by reemuskumar
Thu Jun 15, 2006 9:49 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 186343

I'm getting Wromg answer for 100

I've posted many programs for 100. But I'm getting "Wrong Answer". I have handled i>j and in display also it is on the order of the input. Pls tell me what am I missing ? #include <iostream> using namespace std; int max_cyclic(int,int); int cyclic(int); int main() { int i[10],j[10],count=0,x=0; whil...
by reemuskumar
Thu Jun 15, 2006 5:55 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 186343

100 What is wrong with this code ?

#include <iostream> using namespace std; int max_cyclic(int,int); int cyclic(int); int main() { int i,j; while(!cin.eof()) { cin>>i>>j; if (i<j) cout<<i<<" "<<j<<" "<<max_cyclic(i,j)<<endl; else cout<<i<<" "<<j<<" "<<max_cyclic(j,i)<<endl; } return 0; } int max_cyclic(int num1, int num2) { int cyc,m...

Go to advanced search