Search found 34 matches

by broderic
Wed Jul 31, 2002 8:10 pm
Forum: C++
Topic: Can I use a 64bit-length number?
Replies: 2
Views: 1988

have you tried using long long's?
don't forget that to read or write with them using printf and scanf you have to use %lld instead of the usual %d.

Broderick
by broderic
Tue Jul 30, 2002 5:18 am
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20616

I solved this problem using the exact same algorithm you
did. I used C and it finished in 0.270 seconds.
by broderic
Tue Jul 30, 2002 1:01 am
Forum: Volume 8 (800-899)
Topic: 839 - Not so Mobile
Replies: 21
Views: 8531

hmm,
wouldn't one of the "if (!mobile()) return 0;" catch the case where
a subsequent mobile is not in equilibrium?
by broderic
Tue Jul 30, 2002 12:30 am
Forum: Volume 8 (800-899)
Topic: 839 - Not so Mobile
Replies: 21
Views: 8531

839 - Not so Mobile

Hello...besides the sample input being wrong, is there something else tricky with this question? Somebody in the ranklist said to use pascal if it doesn't work, but people did solve it using c++. I'll post my code since it's so short (in case I did something really dumb), but I'll only keep it up ti...
by broderic
Sat Jul 06, 2002 3:00 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 12019

yes, like the previous poster said, it looks like your algorithm is correct but there could be a small error in there. SPOILER!!! Personally, i found this problem much easier if you create an array with as many elements as minutes in 24hours. then, for each element, you assign a 0 if that time is in...
by broderic
Fri Jul 05, 2002 7:53 pm
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 12019

Hmm, I think the input is in the correct format.
What kind of algorithm are you using to determine the cost of each
call? If you are using if's, I found it can get a little messy (and easily
prone to little mistakes).

Also, did you copy the given table of prices exactly?

Broderick
by broderic
Fri Jul 05, 2002 7:26 pm
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 12019

The mistake I made when I did this problem was to forget that the
length was <= 24 hours, not < 24 hours.
Did you handle the 24 hour case?
Besides that, i can't think of anything that is tricky about it.
by broderic
Tue Jul 02, 2002 11:54 pm
Forum: Volume 103 (10300-10399)
Topic: 10313 - Pay the Price
Replies: 42
Views: 19673

heh, i don't know what i was thinking earlier. the algorithm i posted above misses all sorts of possible ways... for instance: (1,1,1,10),(1,1,2,9),(1,2,2,8),(2,2,2,7)...but this misses (1,1,3,8),(1,1,4,7),... doh! anyway, i know how to do it now. Sheesh, seems like i've been making a lot of mistake...
by broderic
Tue Jul 02, 2002 6:51 pm
Forum: Volume 103 (10300-10399)
Topic: 10312 - Expression Bracketing
Replies: 22
Views: 4876

a binary operation is one that accepts two arguments as input. so +,-,*,/ are all binary operators. A binary bracketing is a bracketing such that all operations are binary. think of the x's as arguments to an operator. if we have xxxx, then the operator is getting 4 arguments. however, if we put bra...
by broderic
Tue Jul 02, 2002 5:13 pm
Forum: Volume 103 (10300-10399)
Topic: 10313 - Pay the Price
Replies: 42
Views: 19673

hehe, well, i'm obviously wrong.
not only that, i'm apparently waaay wrong. :)

could anybody give me a hint as to how i should
go about this problem?

(for some reason, that 2977866 looks like a really familiar number.
I can't remember where i've seen it before though :P )
by broderic
Tue Jul 02, 2002 8:44 am
Forum: Volume 103 (10300-10399)
Topic: 10313 - Pay the Price
Replies: 42
Views: 19673

well, what i did was this. say you want to sum to 10 with 4 coins. you can do it this way: (1,1,1,7), (1,1,2,6),(1,2,2,5),(2,2,2,4),(2,2,3,3). every other way is just a permutation of the above. (from the example given in the problem i assumed we don't count permutations). so in this case there are ...
by broderic
Tue Jul 02, 2002 6:01 am
Forum: Volume 103 (10300-10399)
Topic: 10313 - Pay the Price
Replies: 42
Views: 19673

10313 - Pay the Price

can anybody give me a case where this fails, or help me
find the bug? :)

I'm pretty sure my algorithm is correct. however, what's the output
for n=0 supposed to be? (i tried 0 and 1, but got WA both times. :( )

Thanks for any help.
by broderic
Thu Jun 27, 2002 12:10 am
Forum: Volume 2 (200-299)
Topic: 297 - Quadtrees
Replies: 16
Views: 2391

297 - BUG?

doh!
you're so right, got it accepted first try.
well, it goes to show:if you get an error, almost EVERY time
it's your own fault.

thanks for helping me out.
by broderic
Wed Jun 26, 2002 8:53 pm
Forum: Volume 2 (200-299)
Topic: 297 - Quadtrees
Replies: 16
Views: 2391

297 - BUG?

Hello. I'm getting really frustrated with 297. Ok, here's my code. It's pretty straightforward, but i'm getting an invalid memory reference. however, i checked (by doing infinite loops), and i'm pretty sure it's not referencing outside the p[33][33] array, or off the end of the tree[1024] strings. H...
by broderic
Mon Jun 24, 2002 6:08 am
Forum: Volume 103 (10300-10399)
Topic: 10309 - Turn the Lights Off
Replies: 19
Views: 8995

not sure what was wrong, but i just got it accepted.
probably something dumb. :-?

Go to advanced search