Search found 21 matches

by Ndiyaa ndako
Wed Jan 19, 2005 7:33 pm
Forum: Volume 108 (10800-10899)
Topic: 10803 - Thunder Mountain
Replies: 47
Views: 23577

My method.

The closure matrix is of integer type. To determine if two vertices are conected I check if the square of their distance is less or equal than 100 with integer arithmetic. After that I store in the adjacency matrix the square root of the number. The tag for infinite is -1. for(k=0;k<n;k++) for(i=0;i...
by Ndiyaa ndako
Tue Jan 18, 2005 12:42 pm
Forum: Volume 108 (10800-10899)
Topic: 10803 - Thunder Mountain
Replies: 47
Views: 23577

Wrong answer.

As far as I know, the Floyd Warshall algorithm computes also the transitive closure of a graph. That means that if D(i,j) is finite in the final adjacency matrix, then there exists a path between the vertex i and j of the graph. I deduce that if in the final matrix there is an entry with my tag for ...
by Ndiyaa ndako
Tue Dec 14, 2004 2:24 am
Forum: Volume 107 (10700-10799)
Topic: 10789 - Prime Frequency
Replies: 38
Views: 21163

Thank you!

Yes, the problem was with the output. Why

[cpp] putchar(j); [/cpp]

works while

[cpp] cout << (char) j; [/cpp]

does not? I really would like to know.
by Ndiyaa ndako
Sat Dec 11, 2004 5:49 pm
Forum: Volume 107 (10700-10799)
Topic: 10789 - Prime Frequency
Replies: 38
Views: 21163

10789 - Wrong Answer

This problem is driving me mad! Those who had got it accepted, how did you read the input?

In a part of my code, I do the following cast

[cpp]
u = (int)cadena[j];

cout << (char)j;
[/cpp]

Is this valid? Would it produce the right output?
by Ndiyaa ndako
Tue Sep 28, 2004 8:45 pm
Forum: Volume 1 (100-199)
Topic: 191 - Intersection
Replies: 103
Views: 17841

Slope

What happens if y1=y2?
by Ndiyaa ndako
Sat Sep 25, 2004 3:50 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 23276

Cul de sac.

My program from the very begining used all those tricks. Anyway, I get Wrong Answer. I think it is because of the input reading [c] int main() { unsigned long factores(unsigned long); unsigned long k,n,max,i,u,q,a,l; scanf("%ld",&l); for(a=0;a<l;a++) { scanf("%ld", &k); scanf("%ld", &n); max=factore...

Go to advanced search