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 ...
Search found 4 matches
- Tue May 08, 2007 2:17 pm
- Forum: Volume 1 (100-199)
- Topic: 195 - Anagram
- Replies: 242
- Views: 58289
- Wed Jul 26, 2006 3:47 pm
- Forum: Algorithms
- Topic: longest path
- Replies: 7
- Views: 3524
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
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
- Thu Jun 15, 2006 9:49 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318253
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 ...
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 ...
- Thu Jun 15, 2006 5:55 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318253
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 ...
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 ...