Search found 27 matches

by andresw1
Mon Apr 10, 2006 11:28 pm
Forum: C++
Topic: about hash_set and hash_map
Replies: 4
Views: 2417

I can't get a few lines here. Is there a way to use some buildin hash function. And how do you se the memory limits for the hash_set? What about that "string" in the init part. Why is that? And what is that
return hash< const char* >()( x.s );
by andresw1
Thu Apr 06, 2006 11:19 pm
Forum: C++
Topic: about hash_set and hash_map
Replies: 4
Views: 2417

Hello,

Can somebody give some example source code how to use them (and some comments... are they reliable, how can you change the size of the hash array (if you can...)) . I tried to use them some time ago but I couldn't even compile...

Thank you!
by andresw1
Sun Apr 02, 2006 10:19 am
Forum: Volume 110 (11000-11099)
Topic: 11024 - Circular Lock
Replies: 14
Views: 4263

You are wrong. Think again:)
by andresw1
Sun Apr 02, 2006 10:17 am
Forum: C++
Topic: Print a long duble
Replies: 3
Views: 1956

Hello, You can use the stdio.h instead of iostream. With stdio.h you can print long double in the following way: long double d = 100.0; printf("%Lf",d); -> This wil print something like 100.00000000 To cut the 0's in the end you can modify the %lf in the following way printf("%.3Lf",d); -> The numbe...
by andresw1
Sun Mar 26, 2006 1:31 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17742

misof,
As far as I know good hash is the one which uses nice primes... 2^32 is not one of them as far as I know. In addition Cho mentioned that you can use two different hashings and make a pair. This way you minimise the chance of wrong answer. Is it smart to use int and unsigned int as pair of mods?
by andresw1
Sun Mar 26, 2006 1:02 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17742

Hello,

David,
What do you mean by saying this is slow? Do you use double hashing or something more complex that makes it slow? I can imagine how it can bi done faster...
by andresw1
Sun Mar 26, 2006 12:58 am
Forum: Algorithms
Topic: Weighted bipartite matching?
Replies: 10
Views: 4588

Hi, I'll try to help:) There are a number of algorithms for min-const-maxflow (and weighted matching). The best (fastest) (as far as I know) is the Hungarian algorithm. However it is very complex and hard to impelement. Well, not "very" complex but hard for me. You can also do min-cost-max-flow the ...
by andresw1
Sat Mar 25, 2006 5:42 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17742

Very interesting...

So if we don't get AC with one prime, we change it... in the we will hit the right prime number which would give us AC:)))
by andresw1
Sat Mar 25, 2006 5:35 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17742

Hello,

So the solution is based on hashing the patern? What if we have the same hash for a different set of letters ot this is impossible?
by andresw1
Thu Mar 23, 2006 10:12 pm
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8738

Hello,

Kalinov,
Thank you very much! Now I get it:)))
by andresw1
Thu Mar 23, 2006 10:05 pm
Forum: Volume 110 (11000-11099)
Topic: 11020 - Efficient Solutions
Replies: 14
Views: 5571

Hello,

Wook,
Can you explain a bit more about your idea. Where can I find some information for the trees you mentioned?
by andresw1
Thu Mar 23, 2006 10:04 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17742

Hello, Cho, You have very nice idea but I have some doubts that this will give TLE. After you find the same hash as the patern you will need to do the slow compare to see if the matching is valid. For the test case that krijger mentioned (a lot of 'A's) this will give TLE. Do you do something else w...
by andresw1
Wed Mar 22, 2006 1:20 am
Forum: Volume 110 (11000-11099)
Topic: 11020 - Efficient Solutions
Replies: 14
Views: 5571

Thanks kalinov,

However, if someone doesn't know STL what should he/she do? :)
I'm just curious if there is some other O(N lg N) approach.
by andresw1
Tue Mar 21, 2006 1:22 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17742

Very nice... what if you don't use bitmasks. Will it give TLE?
by andresw1
Mon Mar 20, 2006 10:57 pm
Forum: Volume 110 (11000-11099)
Topic: 11016 - Square Counting
Replies: 19
Views: 7141

After I spend a lot of time I found that it is useless here:) So what is the approach?

Go to advanced search