## Search found 193 matches

Fri Apr 25, 2003 7:49 pm
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14928
Vitor, try this:

Code: Select all

``````1
8 9 3 3 1 1 1 1 1``````
Also, regarding your tentar() function, don't you think you need a return -1 at the end of it ... I don't quite understand your algo, though ... probably I'm wrong ....

-turuthok-
Thu Apr 24, 2003 7:57 pm
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14928
Vitor, ... I'm sorry for the confusion, ... No, I don't use graph nor tree. Actually, my code looks pretty similar than yours, it's just that we have to prevent the recursive function from going deeper and deeper unless it's necessary. The way I prevented it was to record all combination that I pass...
Wed Apr 23, 2003 11:19 pm
Forum: Volume 103 (10300-10399)
Topic: 10310 - Dog and Gopher
Replies: 47
Views: 17433
For problems like this, logically, it's straightforward to solve using floating-points operations (i.e.: using doubles). But, if you're skeptical about it because of precision stuff ... use integer operation. I think this problem is very doable using integer operation ... (e.g.: multiply the input n...
Wed Apr 23, 2003 9:44 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 50316
Did you submit as C or C++ ... ??? If you're using C, ... "//" will cause an error ...

-turuthok-
Wed Apr 23, 2003 9:15 pm
Forum: Volume 1 (100-199)
Topic: 144 - Student Grants
Replies: 21
Views: 3576
I probably missed it, but I didn't see new line printed out in your code.

And BTW, ... you can use printf("%3d", n) instead of computing the padding yourself.

-turuthok-
Wed Apr 23, 2003 8:09 pm
Forum: Volume 5 (500-599)
Topic: 594 - One Little, Two Little, Three Little Endians
Replies: 46
Views: 13523
Make sure you reverse it 8-bits at a time ...

-turuthok-
Wed Apr 23, 2003 8:05 pm
Forum: Java
Topic: Very annoying difference between Windows and Linux
Replies: 2
Views: 1948
Have you tried cygwin ???

I got the same problem months back, I installed cygwin that includes vi and gcc ... The problem went away since ...

PS: And the vi can recognize if it's DOS format or not (extra '\r' before '\n').
Wed Apr 23, 2003 7:59 pm
Forum: Volume 2 (200-299)
Topic: 272 - TEX Quotes
Replies: 136
Views: 35840
When you use System.in.read() and it returns a negative value ... assume it's EOF ...

By the way, '\n' is newline, ... it's not EOF.

-turuthok-
Wed Apr 23, 2003 7:49 pm
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14928
Hello Vitor, I used backtracking to solve this problem. In order not to unnecessarily process a known sub-tree that has no solution, I also keep track of what combination of objects we have visited. If my recursive function is entered with an already visited combination, that means it is useless to ...
Mon Apr 21, 2003 9:40 pm
Forum: Volume 1 (100-199)
Topic: 140 - Bandwidth
Replies: 49
Views: 7678
Titid, ... you misunderstood the problem. The sample output is correct. You're asked to print the optimal ordering of the nodes, ... you need to understand the pictures that describe ABCDEHGF and ABCDGFHE orderings ...

-turuthok-
Thu Apr 17, 2003 10:11 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 39978
Hello TangentZ, in your case, "pile 0 onto 1" must be ignored. It's explicitly mentioned in the problem-statement.

-turuthok-
Thu Apr 17, 2003 6:59 pm
Forum: Volume 100 (10000-10099)
Topic: 10048 - Audiophobia
Replies: 27
Views: 9661
Deddy, perhaps it's the following ...

[c]printf ("Case #%d:\n",++set);[/c]

The output doesn't have ':' there ...

-turuthok-
Thu Apr 17, 2003 10:24 am
Forum: Volume 100 (10000-10099)
Topic: 10048 - Audiophobia
Replies: 27
Views: 9661
Deddy, ... I haven't solved this problem yet, but I noticed that you will get a WA when there is an input with 0 dB. For some reason, you replaced it with 9999 ... Why don't you fill out with 9999 first and then read the input.

Good luck,

-turuthok-
Wed Apr 16, 2003 2:43 am
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14928
Okay, based on your code, looks like you're implementing a greedy-algorithm ... it won't work for this problem. Consider these parts: 5 5 5 5 4 4 4 4 3 3 3 3 Just by looking at it, you know it's possible to construct 4 x (5 + 4 + 3) square. But, using greedy, you will be forced to take 5 and 5 first...
Tue Apr 15, 2003 1:59 am
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14928
They are correct.

-turuthok-