i used the following heuristic to solve the problem:
find the node with minimum degree put it in the solution vector and delete it and all the nodes connected to it and so on till u finish all the nodes.
it generates the right answer for the test cases so can any body points out what is wrong with ...
Search found 3 matches
- Sun Jan 19, 2003 8:13 pm
- Forum: Volume 1 (100-199)
- Topic: 193 - Graph Coloring
- Replies: 93
- Views: 36759
- Sun Jan 19, 2003 7:55 pm
- Forum: Algorithms
- Topic: Miller-Rabin test
- Replies: 2
- Views: 3093
- Mon Jan 06, 2003 3:34 am
- Forum: Volume 102 (10200-10299)
- Topic: 10299 - Relatives
- Replies: 57
- Views: 20764
10299
i solved the problem and got it accepted and after rejudging i got time limit exceeded. here is the code
[cpp]
#include<iostream>
#include<cmath>
#include<fstream>
using namespace std;
int powerl(int,int);
bool primetest(int n);
int main()
{
//ofstream outs;
ifstream ins;
//outs.open("in.txt ...
[cpp]
#include<iostream>
#include<cmath>
#include<fstream>
using namespace std;
int powerl(int,int);
bool primetest(int n);
int main()
{
//ofstream outs;
ifstream ins;
//outs.open("in.txt ...