Search found 284 matches

by Stefan Pochmann
Sun Jan 05, 2003 11:27 pm
Forum: Algorithms
Topic: A difficult problem which no one haven't solve
Replies: 4
Views: 3711

I recently analyzed a similar problem: How many boolean NxN matrices are there that don't contain the same value three times in a row (horizontally or vertically)? Examples for n=4: 0010 0010 1101 0010 (good) 0001 0010 1101 0010 (bad because of the three 0's in the first row) So far I've only attack...
by Stefan Pochmann
Sun Dec 01, 2002 12:17 am
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

1+4) I agree, volunteers might be easy to find. But then the admins have to trust them, not only because someone could intentionally do bad stuff, but maybe even more importantly because of unintended accidental stuff. Plus, if you add a C++ thing that's only slightly better than the Java equivalent...
by Stefan Pochmann
Sat Nov 30, 2002 2:38 pm
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

1) Who's gonna do the work to add the BigInt library? Who's gonna add the regular expression library? Who's gonna add the polygon library? Who's... 2) I agree, you shouldn't be forced to write your own BigInt class. You should be able to get a BigInt class for free by using Java. 4) You're right, if...
by Stefan Pochmann
Sat Nov 30, 2002 12:08 pm
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

Yes, in a perfect world all languages would be equally well-suited for problem solving. Really? That would mean that the old languages would've to be constantly updated and extended, because the new ones are. You know, there was a reason people created C++. They thought C was not as good as they wan...
by Stefan Pochmann
Fri Nov 29, 2002 6:44 pm
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

It's not Java's fault that C++'s library is not as rich, so why should it be punished? If a language is not as good for some task as another one, then don't use it.
by Stefan Pochmann
Thu Nov 28, 2002 4:14 pm
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

Hmm, we don't agree totally, though. While I do advocate the support of the java.math package here at UVA, I do *not* advocate support for gmp. Why? Because java.math is part of the Java standard library and it was ripped out of it. gmp on the other hand is a totally different story. Here we're talk...
by Stefan Pochmann
Thu Nov 28, 2002 2:35 am
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

Yeah, since the author even admits that "high performance was not one of the main design goals", what's the point to use C++ if not operator overloading ;-) If I just want portable, small and free big number support then I'd use Java's standard library, which has the additional advantage o...
by Stefan Pochmann
Thu Nov 14, 2002 2:55 pm
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 38697

1) It is linear. 2) It is not exactly like mine. 3) It is better than mine. Why? 1) Your whole work is done inside the loop, which is executed k-1 (or n-1, we called used to call it n) times. Inside you have two constant time commands and three loops. In one iteration of the outer loop, each inner l...
by Stefan Pochmann
Thu Nov 14, 2002 6:56 am
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 38697

No hash and no arrays as large as the numbers. Here's a spoiler: I have three queues, one for each prime factor, and the total number of numbers added to the queues doesn't exceed 3n.
by Stefan Pochmann
Wed Nov 13, 2002 8:15 pm
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 38697

epsilon0, you're very close to my linear time solution. The big difference is that I don't search for mul2, mul3 and mul5. I know where to look them up in constant time. No idea about a logarithmic solution and I doubt that there is one. It's easy to see that an O(n) solution is optimal for the repo...
by Stefan Pochmann
Tue Nov 12, 2002 7:14 pm
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 38697

Yeah, show me your linear time algorithm. I'd be happy to talk about our solutions.
by Stefan Pochmann
Tue Nov 05, 2002 5:02 pm
Forum: Algorithms
Topic: Generating Combinations
Replies: 5
Views: 4437

I've written a tutorial on this topic a while ago that also includes several algorithms:

http://www.cs.ubc.ca/~pochmann/topcoder ... index.html
by Stefan Pochmann
Sun Nov 03, 2002 2:32 am
Forum: C
Topic: malloc
Replies: 17
Views: 10280

I'd be *very* surprised if that works. Yep, my compiler seconds this opinion. He says "no way I'll compile that for you".
by Stefan Pochmann
Sat Oct 26, 2002 12:04 pm
Forum: C++
Topic: Bigint
Replies: 37
Views: 21048

Classes can make code cleaner and take *less* time to code. And why should they take more memory? And you can get run-time errors and TLE without classes just as well.
by Stefan Pochmann
Thu Oct 24, 2002 5:38 am
Forum: Volume 103 (10300-10399)
Topic: 10368 - Euclid's Game
Replies: 14
Views: 7505

Santiago Zanella wrote:do you know you only need a winning strategy for Stan, don't you?
Does that make the solution easier somehow?

Go to advanced search