Search found 284 matches

by Stefan Pochmann
Sat Jul 13, 2002 11:05 am
Forum: Volume 1 (100-199)
Topic: 139 - Telephone Tangles
Replies: 66
Views: 8064

Can you handle names that have spaces, like "Los Angeles"?
by Stefan Pochmann
Fri Jul 12, 2002 7:36 pm
Forum: Other words
Topic: Thanks Everybody
Replies: 7
Views: 2883

It's also important to think the way Judge can solve this problem. Yeah right. Since when can I look into your head?!? So there is no problem with input output. 1 out of 84 submissions was accepted. And the person who got it needed three attempts. I consider this a major problem. Don't you think yo...
by Stefan Pochmann
Thu Jul 11, 2002 5:33 pm
Forum: C
Topic: about output of floating point numbers
Replies: 7
Views: 3592

80 bits are about 24 decimal digits. Your number has 66. I'm not surprised at all that you lose precision. I'm not sure if the modulo operator works on doubles&Co. There's the function double fmod(double x, double y); but maybe they just added it for other reasons. Really don't know... You can get P...
by Stefan Pochmann
Wed Jul 10, 2002 11:01 am
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3079

I think you should really start with the formula mentioned in CLRS. Here it is:

c(n) = 1/(n+1) * (2n choose n)

Then rewrite the "choose" part with something more useful and try it like this:

c(n+1) = ... = and-here-something-that-includes-c(n)-and-not-much-more.
by Stefan Pochmann
Sun Jun 30, 2002 7:39 am
Forum: Other words
Topic: Graph problems
Replies: 5
Views: 1883

Hmm, I might be wrong, but I think what you mean with the brute force method might be more appropriately be called backtracking. When I think DFS, then I see the O(V+E) algorithm that traverses every part of the graph exactly once, without taking back choices made (i.e. the DFS tree is only extended...
by Stefan Pochmann
Sat Jun 29, 2002 9:25 pm
Forum: Other words
Topic: Graph problems
Replies: 5
Views: 1883

You couldn't be more wrong. DFS rules, it's one of the fastest and most versatile algorithms out there and because of that one of my favourite algorithms. In particular for the detection of cycles, please name another algorithm that solves it faster or is easier to code. I think I can't name one.
by Stefan Pochmann
Wed Jun 26, 2002 8:38 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 179954

maybe "while( current <= j )" will work?
by Stefan Pochmann
Wed Jun 26, 2002 8:36 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21979

What does the judge answer?
What is your runtime complexity?
Could you please use the bbtags to format the code?
by Stefan Pochmann
Mon Jun 24, 2002 11:27 pm
Forum: Volume 6 (600-699)
Topic: 681 - Convex Hull Finding
Replies: 60
Views: 20285

Somebody wrote the hint that n can be much larger than 512. Maybe that's it?
by Stefan Pochmann
Mon Jun 24, 2002 10:05 pm
Forum: Volume 8 (800-899)
Topic: 835 - Square of Primes
Replies: 22
Views: 11386

So how long would your non-precalced version run on the judge? Btw, please mark precalc solutions with a "precalc" comment, so that others don't waste time to search for the superior algorithm that doesn't exist. Well, I have to admit that I've just made up this rule for me ;-) (never thought about ...
by Stefan Pochmann
Mon Jun 24, 2002 9:15 am
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3079

Yep, just solved it. Starting with the formula of CLRS, you can get an easy recurrence relation of the form c[0] = 1 c[n+1] = f( n, c[n] ) where f is really a simple function. Let's ignore that working with large numbers takes more time than with simple ints, i.e. let's assume the arithmetic operati...
by Stefan Pochmann
Mon Jun 24, 2002 7:12 am
Forum: Volume 4 (400-499)
Topic: 402 - M*A*S*H
Replies: 56
Views: 13229

mido: yes

10153EN: "left" as in "left out" and "right?" like in "am I right?"
by Stefan Pochmann
Mon Jun 24, 2002 3:05 am
Forum: Volume 8 (800-899)
Topic: 835 - Square of Primes
Replies: 22
Views: 11386

Ha! Not anymore! I took the lead again ;-) Unfortunately my program became bigger and uglier now. But beware: I could easily make it even bigger and uglier, and it would probably be even faster, too, harhar :-)
by Stefan Pochmann
Sun Jun 23, 2002 11:44 pm
Forum: Volume 1 (100-199)
Topic: 138 - Street Numbers
Replies: 93
Views: 6731

Ok, I see... you're right, the sums are of course out of int-range. What you could do is use "long long" or "double", both should work. Don't use "long", because that's usually the same as "int", even though they have different names.
by Stefan Pochmann
Sun Jun 23, 2002 7:15 am
Forum: Volume 8 (800-899)
Topic: 835 - Square of Primes
Replies: 22
Views: 11386

Re: Mail me if you want hints

I must confess my first approach was similar to yours, using the notion of prefix, and I needed some hints (this program has been studied by some people) to make an accpetable solution. Hmm, that sounds like if there's some mathematical insight behind it... My solution is just a brute force one, bu...

Go to advanced search