Search found 80 matches

by Quantris
Thu Oct 26, 2006 8:12 pm
Forum: Volume 111 (11100-11199)
Topic: 11118 - Prisoners, Boxes and Pieces of Paper
Replies: 7
Views: 3342

I've been looking for that proof of optimality -- do you have a specific place I could find it (was it published somewhere)?
by Quantris
Wed Oct 11, 2006 11:32 pm
Forum: C++
Topic: access to a vector witout ->at() function;
Replies: 5
Views: 2836

I think v->operator[](2) works too (but it's somewhat ugly). I'm not sure what you mean when you say iterators are slow, because something like *(v->begin() + 2) is still constant-time. I do prefer the pass-by-reference method here though - don't use a pointer unless there is a specific reason to (e...
by Quantris
Mon Jun 05, 2006 8:45 am
Forum: Volume 1 (100-199)
Topic: 174 - Strategy
Replies: 8
Views: 4292

I understood what you meant the first time.

But what I meant was that the grammar simply defines the form of the expression, and not it's meaning (since that is all that a grammar is supposed to do).
by Quantris
Mon Jun 05, 2006 8:20 am
Forum: Volume 1 (100-199)
Topic: 174 - Strategy
Replies: 8
Views: 4292

It is not a given (in my opinion) that the operator associativity is determined by the grammar -- they are separate (in other words, I would see nothing wrong with having the same grammar definition, plus a statement that the operators are left-associative).

Anyway, thanks for your answer :)
by Quantris
Fri Jun 02, 2006 1:23 am
Forum: Volume 110 (11000-11099)
Topic: 11037 - Point of View in Flatland
Replies: 15
Views: 7990

For a pair of "planets", you can show that the isoobservation points lie on a circle (if the planets have equal radius, they lie on the perpendicular bisector of the line connecting the centers -- consider this a circle of "infinite" radius and the statement is true for this case as well). You can p...
by Quantris
Thu Jun 01, 2006 4:51 pm
Forum: Volume 110 (11000-11099)
Topic: 11037 - Point of View in Flatland
Replies: 15
Views: 7990

I did it geometrically as well (around 160 lines), though I didn't use "other curves", only points, lines, and circles. I did some algebra on paper to prove a certain fact, which it turns out would be well known to a classical geometer :)
by Quantris
Thu Jun 01, 2006 7:46 am
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10631

When I switched to VS .NET 2003, I discovered that %lld works (%I64d is still a valid alternative), which was nice.
by Quantris
Thu Jun 01, 2006 4:20 am
Forum: Volume 110 (11000-11099)
Topic: 11037 - Point of View in Flatland
Replies: 15
Views: 7990

Sure, I sort of remember :)

I did that problem after getting back, but not on the live archive. I really should have been able to get it the first time :o
by Quantris
Thu Jun 01, 2006 1:54 am
Forum: Volume 110 (11000-11099)
Topic: 11037 - Point of View in Flatland
Replies: 15
Views: 7990

Not fair, all I have to go on is "Darko", and that doesn't ring a bell.

I'll be watching the ranklist for this problem ;)
by Quantris
Wed May 31, 2006 7:55 pm
Forum: Volume 110 (11000-11099)
Topic: 11037 - Point of View in Flatland
Replies: 15
Views: 7990

I get the same absolute numbers, but where you have -1.15 1.15, I have 1.15 -1.15... So it looks like you have an extra negative sign for both coordinates? Incidentally I output -0.00 on the last case there :o My 2nd points for the cases (which should not be output because they give a smaller angula...
by Quantris
Wed May 31, 2006 12:20 am
Forum: Volume 110 (11000-11099)
Topic: 11025 - Mr. And Mrs. Hamilton
Replies: 21
Views: 8173

I'd just like to chime in about submitting on your own problem: I see absolutely no reason to be upset over this. It's not like it's a secret that this was Frank's problem, and the contest is not for a prize (as Mr. Manzoor pointed out). Rather, the contest was for practice, and all that really matt...
by Quantris
Tue May 30, 2006 11:08 pm
Forum: C++
Topic: Run-time polymorphism
Replies: 0
Views: 1371

Run-time polymorphism

Wondering if anyone knows how to do this (or can say if it is not possible): Suppose I have an abstract base class "Shape" with two subclasses "Line" and "Circle". What I want to be able to do is call a function like "intersect(a, b)" where a and b are references of type Shape instantiated with the ...
by Quantris
Fri May 26, 2006 12:09 am
Forum: Volume 1 (100-199)
Topic: 174 - Strategy
Replies: 8
Views: 4292

Anyone know what precedence to use for compound boolean operations in this problem?

meaning suppose I have <cond> AND <cond> OR <cond>

do I interpret as (<cond> AND <cond>) OR (<cond>) (left-to-right)

or as (<cond>) AND (<cond> OR <cond>) (right-to-left)
by Quantris
Sat May 13, 2006 2:50 am
Forum: Algorithms
Topic: stl dijkstra
Replies: 9
Views: 3586

What makes you say that? AFAIK, fibonacci heaps are better for dijkstra (asymptotically) because they support decreasing a key value in constant amortized time (binomial is O(log n) ). They are also substantially more difficult to code than the straightforward priority-queue implementation (which us...
by Quantris
Tue May 09, 2006 10:43 pm
Forum: Volume 1 (100-199)
Topic: 188 - Perfect Hash
Replies: 9
Views: 5343

I'm pretty sure you can make the required C exceed signed 32-bit.

EDIT:

zzzzz zzzzy fafa zdfdz dfazz zzxf s

gives 2532818294, which fits in unsigned but not in signed.

Go to advanced search