## Search found 108 matches

Sat Dec 06, 2003 1:26 pm
Forum: Volume 105 (10500-10599)
Topic: 10578 - The Game of 31
Replies: 11
Views: 4635
That is exactly what you have to figure out in this problem! ;-) Perfect strategy means: If there IS a move that leads to a winning situation, you do that move, and no other. Imagine you are calculating all possible moves in the game, and determine if a move is winning, or loosing (or maybe undeterm...
Mon Nov 10, 2003 3:51 pm
Forum: Volume 4 (400-499)
Topic: 446 - Kibbles "n" Bits "n" Bits "n" Bits
Replies: 50
Views: 4073
What operating system / compiler do you use ? Mine doesn't fail at those cases.
Btw I use Editplus and it creates a template like the one above. That's why I define my main like that. It never gives me problem before.
Mon Nov 10, 2003 11:15 am
Forum: Volume 4 (400-499)
Topic: 446 - Kibbles "n" Bits "n" Bits "n" Bits
Replies: 50
Views: 4073
I get wrong answer on this problem too.. and I really don't understand why. I passed all the test cases above.. anything I forgot? Anyone please help me !! Here is my code: [cpp] #include <stdio.h> void binary( char *result, int n ) { int i; for( i=12; i>=0; i-- ) { result = '0' + (n & 1); n >>= 1; ...
Sun Nov 09, 2003 11:12 pm
Forum: Volume 101 (10100-10199)
Topic: 10127 - Ones
Replies: 32
Views: 11910
obayashi wrote:there's a simple solution;)
Does 'simple' mean O(1) solution? My solution is O(number of digits in result)
Sun Nov 09, 2003 3:12 pm
Forum: Volume 100 (10000-10099)
Topic: 10002 - Center of Masses
Replies: 59
Views: 25708
Btw, the definition of "Center of mass" is quite easy: Suppose you make the polygon out of wood (make it massive), and try to balance it on the tip of your finger. The center of mass is the single point where it will not fall off your finger. I think many people here are confused with the center of ...
Sun Nov 09, 2003 3:06 pm
Forum: Volume 100 (10000-10099)
Topic: 10002 - Center of Masses
Replies: 59
Views: 25708
bolster wrote:2) Sometimes, "-0.000" is probably displayed for small numbers that get rounded off, so must add some small value to all output.
This trick did it for me. I added some constant epsilon = 1e-15 to the final answer, and I got accepted right away.
Sun Nov 09, 2003 12:52 pm
Forum: Volume 105 (10500-10599)
Topic: 10578 - The Game of 31
Replies: 11
Views: 4635
hmm.. so it seems i'm completely wrong in my output... then i probably made a stupid mistake somewhere. Thanks for your help so far

-Edit-
Thanks, got accepted now. I made a really stupid mistake... they're usually the hardest to find
Sat Nov 08, 2003 8:25 pm
Forum: Volume 105 (10500-10599)
Topic: 10578 - The Game of 31
Replies: 11
Views: 4635

### 10578 - The Game of 31

Hi everyone! I tried to do 10578 and was surprised to get WA... First of all I'm a little unsure how to handle the input.. for example if there is an empty line at the end of the input I should treat it as being a test case, right ? And what if there is a \n at the end of the last line but nothing e...
Fri Nov 07, 2003 9:10 pm
Forum: Volume 1 (100-199)
Topic: 119 - Greedy Gift Givers
Replies: 145
Views: 23579
don't just post your code but tell us the method you're using.
Fri Nov 07, 2003 1:21 am
Forum: Volume 8 (800-899)
Topic: 847 - A Multiplication Game
Replies: 41
Views: 19398
why 13123 makes Stan the winner?
My AC program makes Ollie the winner for 13123. In fact, I'd like to know very much your strategy to make Stan win. Wanna play a game of multiplication with n=13123? I will play Ollie, anyone volunteer to play Stan?
Thu Nov 06, 2003 6:23 pm
Forum: Volume 105 (10500-10599)
Replies: 39
Views: 11072
my program gives the same answers as yours. But how about these:

10 5 0
5 10 0
Thu Nov 06, 2003 11:04 am
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 31219
( 1 ) can you use formatting tags to post code?
( 2 ) can you explain your algorithm?
Thu Nov 06, 2003 1:07 am
Forum: Volume 105 (10500-10599)
Replies: 39
Views: 11072
what i meant to say is: You calculate fa and fb in your loop but you never use them anywhere in the program. So then why do you calculate them?
Tue Nov 04, 2003 9:57 pm
Forum: Volume 105 (10500-10599)