Search found 60 matches

by Miguel Angel
Mon Aug 25, 2003 8:10 pm
Forum: Algorithms
Topic: Permutation of a string
Replies: 9
Views: 3310

I think

I think the recursive approach is nice because lets you make permutations of n elements taken r at time in a very easy way.
by Miguel Angel
Thu Aug 07, 2003 11:30 pm
Forum: Volume 105 (10500-10599)
Topic: 10531 - Maze Statistics
Replies: 8
Views: 5178

Could you give me some advice on how to calculate the probabilities?? :oops:
by Miguel Angel
Thu Aug 07, 2003 4:58 pm
Forum: Algorithms
Topic: Who know Maximal Matching Problems O(n) solution?
Replies: 4
Views: 2466

Noup

I don't think so, actually O(N^3) is well to solve it even 'cause that algorithm is called pseudopolynomial.
The unique way will be that the problems offers you some constraints that make such problem trivial and so a O(N) solution can be applied, but i can't figure out right now :).
by Miguel Angel
Thu Aug 07, 2003 4:52 pm
Forum: Algorithms
Topic: Can anyone suggest an algorithm for this Clock Synchro Prob?
Replies: 4
Views: 2202

Yeap yeap

Yeap, sorry, but as well it's only B^3, not (B*3)!.
Other way to solve it is to do Gauss Jordan modulo 3, but i won't explain it :).
by Miguel Angel
Tue Aug 05, 2003 7:01 pm
Forum: Algorithms
Topic: Heap and hash...
Replies: 3
Views: 1990

Jeje

Sip!, Como est
by Miguel Angel
Tue Aug 05, 2003 2:07 am
Forum: Algorithms
Topic: Can anyone suggest an algorithm for this Clock Synchro Prob?
Replies: 4
Views: 2202

But it's easy :(

You have a max of B moves, so you may try all the posible permutations of B, which are without repetitions 2^B = 2048, that's too too few, and then aply it to C.
by Miguel Angel
Mon Aug 04, 2003 1:42 am
Forum: Algorithms
Topic: Need code of "Combinations" in "c"
Replies: 1
Views: 1618

Combinations of n elements taken r at time

[cpp]int n, r; int C[5]; char used[5]; void combine(int pos, int h) { int i; /*If we have taken the r elements, print and exit*/ if (pos==r) { for (i=0; i<r; i++) cout<< C ; cout<< endl; return; } /*The elements must be sorted, otherwise sort them, in this case we combine index (i)*/ /*For all not u...
by Miguel Angel
Sun Aug 03, 2003 10:50 am
Forum: Algorithms
Topic: Heap and hash...
Replies: 3
Views: 1990

Heap - A data structure which is used to do Priority Queues, is like a queue, but instead of poping the first element you pushed, you pop the first element with biggest priority. You can do this with O(log N) steps. Hash - It's a search structure, you may have a function f(x) for x data, and then st...
by Miguel Angel
Thu Jun 05, 2003 8:11 am
Forum: Volume 6 (600-699)
Topic: 605 - The Rotating Disk
Replies: 8
Views: 4953

605 - The Rotating Disk

How to solve it?. I can think about Greedy, but some cases my heuristhics don't work. Or search, but won't be too large store partial permutations?
by Miguel Angel
Wed May 28, 2003 4:15 am
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 19023

But..

But your answers are incorrect, because my program output for example, for this

500 13
CASE 2:
2+3+5+11+11+13+13+17+17+101+101+103+103

is
500 13
CASE 2:
2+3+3+5+5+7+7+11+11+13+13+127+293
by Miguel Angel
Sat Jan 25, 2003 6:53 am
Forum: Other words
Topic: acm solve sites
Replies: 51
Views: 27045

My opinion

My vote was NO, my reassons: * Well, like someone said it's an ability contest, so I think some resources must be keept, for example maybe i won't share my solution about very hard problems like "Bigger Square Please..", because it's not intended to be solvable by all the authors in the si...
by Miguel Angel
Mon Jan 20, 2003 6:00 am
Forum: Algorithms
Topic: Miller-Rabin test
Replies: 2
Views: 2770

Just..

Just change int by long,
it doesn't work for example when n = 997 (return 0), i think it maybe to the (z*z), in such case will be (10^3)*(10^3) > 2^15-1
by Miguel Angel
Sun Jan 19, 2003 6:07 am
Forum: Volume 103 (10300-10399)
Topic: 10385 - Duathlon
Replies: 16
Views: 7626

I can answer my question..

Km. / H
BTW, i did a mistake in my implementation which got me shock and got me confused about if it was Km/H.
by Miguel Angel
Sun Jan 19, 2003 5:18 am
Forum: Volume 103 (10300-10399)
Topic: 10385 - Duathlon
Replies: 16
Views: 7626

10385: POOR description

I was doing 10385, then i found something that i need to know
The speed of the contestants is km/h, m/s ??
Without this my algo cannot know the answer.

thanks in advance if someone can tell me :)
by Miguel Angel
Tue Jan 07, 2003 4:33 am
Forum: Volume 100 (10000-10099)
Topic: 10020 - Minimal coverage
Replies: 57
Views: 21916

Mmm

My algorithm is the following * At given left end, take the biggest right end. * Fill an array of char's to see if they cover the segment at all * if there's a way to fill the M segment, then DP to get the minimal number of segments.. BUT WA!!! I have some doubts, Can the lines overlap?? I have saw ...

Go to advanced search