Search found 5 matches

by tadeu
Thu Apr 13, 2006 10:21 pm
Forum: Volume 110 (11000-11099)
Topic: 11023 - Multisets and Sequences
Replies: 10
Views: 4864

Algorithm

Is there an algorithm that, given a set (1,2,3,4,5,...), gives it's n-th permutation in lexicographical order, without needing to compute all permutations before it? I.e, if I want the 6th permutation, it would give me (1,3,2,4,5) directly, without the need to compute:

(1,2,3,5,4)
(1,2,4,3,5)
(1,2 ...
by tadeu
Thu Apr 13, 2006 4:09 pm
Forum: Volume 110 (11000-11099)
Topic: 11021 - Tribles
Replies: 15
Views: 7100

Still the same problem with doubles or floats, but I'm getting the right results here with my tests.

I am printing the numbers with fixed a precision of 8 (using iostream). Can it be a rounding problem?? Does the judge only ignore the numbers after the 7th place after the dot, or does it compare ...
by tadeu
Thu Apr 13, 2006 5:11 am
Forum: Volume 110 (11000-11099)
Topic: 11021 - Tribles
Replies: 15
Views: 7100

Precision

I think I'm getting W.A.'s because of floating point precision, although I'm using long doubles all around, and pow() instead of multiplications =(

Can someone check my implementation, please?
by tadeu
Tue Apr 04, 2006 5:34 pm
Forum: Volume 110 (11000-11099)
Topic: 11018 - Mars Buggy
Replies: 6
Views: 3877

Thanks Ivan!
I have already fixed the problem with source==destination, the outputs are identical now, but I am still getting WA! :(
I'll try to test with more complicated/singular/degenerate cases later..
by tadeu
Tue Apr 04, 2006 8:44 am
Forum: Volume 110 (11000-11099)
Topic: 11018 - Mars Buggy
Replies: 6
Views: 3877

Testing

I'm getting WA's, can anyone check it the following input/output pair is correct?

input:

100
aa -0.189153 2.263902
ab -0.502504 3.446408
ac -0.583654 1.644747
ad -0.423869 3.753228
ae -0.335398 0.309623
af 0.287535 3.588060
ag -1.194601 4.403616
ah -1.451011 6.046235
ai -0.130068 4.715645
aj 1 ...

Go to advanced search