## Search found 3 matches

Sun Jan 19, 2003 8:13 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 21383

### problem 193

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 t...
Sun Jan 19, 2003 7:55 pm
Forum: Algorithms
Topic: Miller-Rabin test
Replies: 2
Views: 2644
[cpp] int Prime(int n, int alpha) // Returns 1 if n is a prime and 0 otherwise. // alpha is the probability parameter. { int q = n-1; for (int i=1; i<=(alpha*log(n)); i++) { int m = q, y = 1; int a = random() % q + 1; // Choose a random number in the range [1, n-1]. int z = a; // Compute a^{n-1}mod ...
Mon Jan 06, 2003 3:34 am
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 14255

### 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"); int ...