## Search found 8 matches

Mon Apr 05, 2004 2:34 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25173
Do you sort the letters, like this AaBbCcDdEeFfGgHhIiJj ... ??? Try this, :wink: : 2 ds ;/ds';[ ds a ;; ; ;; // // ''' a a a a a a a aa My AC program gives the following output : dddsss ddsdss ddssds ddsssd dsddss dsdsds dsdssd dssdds dssdsd dsssdd sdddss sddsds sddssd sdsdds sdsdsd sdssdd ssddds ss...
Sat Apr 03, 2004 11:49 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20468
This is my code, for search of the max black nodes, starting for all nodes: [c]initList(&list); for ( i = 0; i < vertices; i++ ){ cleanGraph(&graph); makeColors(&graph, (i+1)); vertex = graph.first; while ( vertex ){ if ( !vertex->visit ) makeColors(&graph, vertex->num); vertex = vertex->next; } if ...
Fri Apr 02, 2004 9:24 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25173
Do you clean the strings, before makes the anagram?? (e.g spaces, points... etc)

Fri Apr 02, 2004 7:03 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20468

1
4 5
1 2
2 3
3 4
1 4
2 4
My output:
2
1 3
Is correct??
Fri Apr 02, 2004 5:10 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20468
This example a fully connected graph:

Input :
1
5 10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
Possible output's
1
1

1
2

1
3

1
4

1
5
My output:
1
5
It's correct... I'm crazy with this problem...

What out this in??

In:
1
1 1
1 1
Fri Apr 02, 2004 5:23 am
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20468
I use this algo, but I get WA, :evil: [c]TColors vertexColor(TVertex *vertex) { TEdge *edge; edge = vertex->edges.first; while ( edge ){ if ( edge->dest->color == clBlack ) return clWhite; edge = edge->next; } return clBlack; }; void makeColors(TGraph *graph, int start) { TVertex *vertex; TEdge *edg...
Wed Mar 31, 2004 4:07 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20468
Thanks sohel.

I found my error.

I am using BFS, but in this case I think i will have to use Backtracking. Is this correct ?

Do you know any other solution, more simple than that?
Wed Mar 31, 2004 1:37 am
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20468

### 193 WA why? What's wrong in my algorithm??????

Somebody can help me? Where it can be the error? Follows mine in/out My input: 15 6 8 1 2 1 3 2 4 2 5 3 4 3 6 4 6 5 6 10 12 1 2 1 3 1 4 2 3 2 5 3 4 4 6 5 8 6 8 7 8 8 9 9 10 14 21 1 2 1 3 1 4 2 3 2 4 2 5 2 6 3 5 3 10 4 6 4 12 5 7 6 7 7 9 7 8 9 14 8 14 12 13 13 14 14 11 11 10 14 24 1 2 1 3 1 4 2 3 2 4...