Search found 284 matches

by Stefan Pochmann
Sat Jun 15, 2002 4:07 am
Forum: Other words
Topic: creating an online bulletin board system
Replies: 14
Views: 5040

Uuh, that's a tough question. I'd say it highly depends on whay you're interested in. If you'd like to do some web stuff and maybe learn Java's web interface and database models or even XML, then a webboard is certainly a very interesting playground. There may be better ideas, but I can't tell you w...
by Stefan Pochmann
Fri Jun 14, 2002 1:45 am
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 17295

I don't believe you that you exceed double range with that program. (2*3*5)^15 is way smaller than what doubles can hold.
by Stefan Pochmann
Fri Jun 14, 2002 1:34 am
Forum: Other words
Topic: creating an online bulletin board system
Replies: 14
Views: 5040

I think Perl has database access built in too...
by Stefan Pochmann
Thu Jun 13, 2002 7:48 am
Forum: Other words
Topic: creating an online bulletin board system
Replies: 14
Views: 5040

Don't know much about JSP, sorry. Java Servlets work like this: You need a webserver program that supports them, for example Tomcat (http://jakarta.apache.org/tomcat/). Then you write Java classes that inherit the class "Servlet" (I think) and that produce HTML code. There are also ways to get param...
by Stefan Pochmann
Thu Jun 13, 2002 1:10 am
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3057

If I remember it correctly, this is covered on page 181 in the second edition of the CLRS book. Don't know about the first edition. Look up "catalan numbers" in the index, it's a "problem", I believe. The problem brings you step by step to a nice formula that I think makes it easy to step from C(n) ...
by Stefan Pochmann
Thu Jun 13, 2002 1:00 am
Forum: Other words
Topic: creating an online bulletin board system
Replies: 14
Views: 5040

As if you couldn't do something server-side with Java. Ever heard of Servlets (http://java.sun.com/products/servlet/) or JSP (http://java.sun.com/products/jsp/) ???

And via CGI you can easily use *any* programming language to produce web pages, i.e. Perl, Java, C, Shellscript, Lisp, ...
by Stefan Pochmann
Wed Jun 12, 2002 7:38 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 176879

I quickly rewrote your program to use a simple loop that tries the whole interval and got it accepted.
by Stefan Pochmann
Wed Jun 12, 2002 6:20 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 176879

What are you doing in "maxlenij"? All this dividing by 2 and 3 and stuff... is that really necessary?
by Stefan Pochmann
Tue Jun 11, 2002 5:28 am
Forum: Volume 1 (100-199)
Topic: 131 - The Psychic Poker Player
Replies: 34
Views: 5095

I see you got it right... what was the mistake? Btw, I thought Caesum had posted an answer, too. Did he delete it?
by Stefan Pochmann
Tue Jun 11, 2002 12:14 am
Forum: Volume 1 (100-199)
Topic: 199 - Partial differential equations
Replies: 15
Views: 4288

The sample output is wrong! b should be
-35 -188 -189 -315
instead of
-8 -152 -198 -333
by Stefan Pochmann
Tue Jun 11, 2002 12:07 am
Forum: Volume 1 (100-199)
Topic: 131 - The Psychic Poker Player
Replies: 34
Views: 5095

By your command, master.

There are two things I noticed:
+ My own solution says "straight flush" only if I got 10 to Ace, not for any other sequence.
+ What if you set (1<<5) with one hand and (1<<4) with a different one?
by Stefan Pochmann
Mon Jun 10, 2002 10:49 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21634

A history of the problem and the one-dimensional case of this problem are also discussed in "Programming Pearls" of Jon Bentley, just in case anybody's interested. I believe it's chapter 8 or 9...
by Stefan Pochmann
Mon Jun 10, 2002 12:29 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 176879

Why does this matter? Btw, it's *your* program and you want *us* to tell you what it does?
by Stefan Pochmann
Mon Jun 10, 2002 12:21 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21634

Ming Han: "jrydh" is a name, which means I addressed the other guy, not you. Your own mistake might be that you index the arrays from [1][1] to [n][n], but declare them as size [100][100], so you grab data out of bounds, which is a bad bad technique in general and in particular with 2-dimensional ar...
by Stefan Pochmann
Mon Jun 10, 2002 10:15 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21634

LOL! jrydh, I hope you realize that you have an O(n^6) algorithm there, and that n can get as large as 100. No wonder you time out :-)

Go to advanced search