Search found 60 matches

by Miguel Angel
Thu Jan 02, 2003 10:04 am
Forum: Algorithms
Topic: Min-Max Heap
Replies: 2
Views: 2706

I think

I think just make two heaps, one to min and the other one to max, when you make a push, push it to both heaps, and when you do a min_pop, pop the first data from min and remove from max, the same applies to max_pop
by Miguel Angel
Tue Dec 10, 2002 7:20 am
Forum: Volume 101 (10100-10199)
Topic: 10136 - Chocolate Chip Cookies
Replies: 6
Views: 4399

10136 - Chocolate Chip Cookies

Someone can give me a hint, i have no idea on how to solve it? :(
by Miguel Angel
Wed Dec 04, 2002 11:03 pm
Forum: Algorithms
Topic: Minimum Cost Transport Algorithm
Replies: 3
Views: 2725

Yeah, but how can i solve it?
by Miguel Angel
Mon Dec 02, 2002 12:38 am
Forum: Algorithms
Topic: Minimum Cost Transport Algorithm
Replies: 3
Views: 2725

Minimum Cost Transport Algorithm

Someone has an implementation of it, or can anyone explain me the algorithm to solve that problem. Thanks in advance.
by Miguel Angel
Sun Dec 01, 2002 9:52 am
Forum: Algorithms
Topic: How to solve binary search tree in O(n^2) ??
Replies: 2
Views: 2268

This one

The O(n^2) algorithm, as i have heard, comes in Donald Knuth by Art of Computer Programming. Here it's an implementation, maybe itsn't the better, because without recursion it will be faster. Greetings :). [cpp] #include<iostream.h> #define INF 2147483647 #define MaxN 10 long m[MaxN+1][MaxN+1]; int ...
by Miguel Angel
Sat Nov 30, 2002 4:48 am
Forum: Algorithms
Topic: Traveling Salesmen Problem
Replies: 1
Views: 2047

None

O (n^2 (2^n) ) with DP, although is NP as u can see by the number of operations :)
by Miguel Angel
Sat Nov 23, 2002 11:10 pm
Forum: Algorithms
Topic: I think it's a very hard problem
Replies: 2
Views: 2388

Very interesting

I saw the problem, it's very interesting, i think there's a solution if: Let Xi the length of the i triangle you can cut from it. Let Yi the number of triangles of side Xi. Let L the length of the side of the hex. 6*L^2 = Sum ( Yi * Xi^2 ) Of course, imposing some conditions like: Yi = k Yi+1 Where ...
by Miguel Angel
Sat Nov 23, 2002 10:57 pm
Forum: Algorithms
Topic: About Dynamic Programming
Replies: 5
Views: 3734

DP

Well, I think that DP is a very(VERY) general approach, which must meet the following conditions: (Let A and B two distinct events) * A and B must be independent events (that is, changes on A doesn't affect changes on B) * There's exist some precedence or order between A and B And the most important...
by Miguel Angel
Thu Nov 21, 2002 5:09 am
Forum: Algorithms
Topic: Prime Factors !!!!!!
Replies: 12
Views: 6018

Interested too.

The best that i know is
O (sqrt(N) / log (sqrt(N)))
[which is divide with all the primes betwen 1 and sqrt(N)]
I know there'r exist exact methods to find primes of a composite number when it's a product of two distinct primes, such a Pollard Algorithm and they are very fast, but i don't know more :)
by Miguel Angel
Thu Nov 21, 2002 5:03 am
Forum: Algorithms
Topic: difficult problem
Replies: 3
Views: 2572

Don't understand your statement of the problem

Tell how many 2x2 matrix there are with the condition above or
Tell how many AxB matrix there are such that doesn't contain a 2x2 matrix with the condition above?
by Miguel Angel
Sun Oct 20, 2002 11:05 am
Forum: Volume 102 (10200-10299)
Topic: 10290 - {Sum+=i++} to Reach N
Replies: 27
Views: 13161

Having doubts...

I know it can speed up the problem by using a table with primes, but can be another way?
by Miguel Angel
Tue Oct 15, 2002 2:50 am
Forum: Other words
Topic: A difficult problem
Replies: 2
Views: 2032

But seems simple, isn't?

Get the first 500 fibonacci numbers(think f(500) will be more than 200 digits) and then use binary search to find your number :)
by Miguel Angel
Mon Sep 16, 2002 6:24 am
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 38
Views: 21352

10181 - 15-Puzzle Problem

can i know the following without doing full search????

If the given initial configuration is not solvable you just need to print the line &#8220;This puzzle is not solvable.&#8221;

Thanks 8)
by Miguel Angel
Thu Aug 15, 2002 2:38 am
Forum: Volume 8 (800-899)
Topic: 811 - The Fortified Forest
Replies: 12
Views: 7614

Re: 811 "The fortified forest" Is correct???

There's more than answer, they don't have a special program for multiple answer on that problem :evil:
by Miguel Angel
Tue Aug 13, 2002 2:43 am
Forum: Volume 8 (800-899)
Topic: 811 - The Fortified Forest
Replies: 12
Views: 7614

811 - The Fortified Forest

Think my program is correct even though i always get WA. There are some details in redaction but i contemplate. Is there something i must do??

Go to advanced search