Search found 108 matches

by Maarten
Thu Oct 30, 2003 12:15 pm
Forum: Volume 1 (100-199)
Topic: 132 - Bumpy Objects
Replies: 38
Views: 4406

there's a whole thread about problem 132.. it might help you. It helped me in the end. As for problem 143, I haven't tried it yet
by Maarten
Wed Oct 29, 2003 12:23 pm
Forum: Volume 1 (100-199)
Topic: 106 - Fermat vs. Pythagoras
Replies: 138
Views: 11895

Code: Select all

0 1
1 4
16 27
158 205
1593 1669
15919 14844
159139 133926
P.S. Please next time state the problem NAME along with the number. I think it makes you get more replies
by Maarten
Wed Oct 29, 2003 10:28 am
Forum: Off topic (General chit-chat)
Topic: What does it mean
Replies: 1
Views: 1332

it means you will be notified (by e-mail) if someone posts a message in the thread. Try it for yourself! :P
by Maarten
Wed Oct 29, 2003 12:07 am
Forum: Volume 100 (10000-10099)
Topic: 10049 - Self-describing Sequence
Replies: 33
Views: 13002

I got my runtime down to 0.021 seconds and all the sudden the judge says i'm only using 64k of memory... but i'm still using 700000 int array... anyone knows how this is possible ? After all, 700000 * 4 = 2.8 million bytes isn't it ?
by Maarten
Tue Oct 28, 2003 11:51 pm
Forum: Volume 100 (10000-10099)
Topic: 10049 - Self-describing Sequence
Replies: 33
Views: 13002

i didn't use formula but just a double for loop to generate the points where the sequence changes (so I store the values 1,2,4,6,9,12,16,20,24, ....). My program runs in 0.1 seconds using 3MB of memory. I think I can improve the running time a bit, but don't know about the memory. I was wondering ho...
by Maarten
Tue Oct 28, 2003 12:37 pm
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14808

I assume you're not supposed to bend or break sticks :D
Anyway, sounds like a nice problem.. I am going to have a try at it
by Maarten
Tue Oct 28, 2003 12:29 pm
Forum: Volume 5 (500-599)
Topic: 591 - Box of Bricks
Replies: 80
Views: 11123

Did you notice this:
Output a blank line after each set.
by Maarten
Tue Oct 28, 2003 12:27 pm
Forum: Volume 5 (500-599)
Topic: 543 - Goldbach's Conjecture
Replies: 109
Views: 23962

If I'm correct, %lld is only used with long long data type. For long you should use %ld. Not sure if it matters though. For the rest I haven't been able to spot a mistake
by Maarten
Sun Oct 26, 2003 2:02 pm
Forum: Off topic (General chit-chat)
Topic: Should cutted source code
Replies: 13
Views: 4288

does it matter? I think if someone wants to solve a problem he won't copy/paste someone else's solution. And if he does, and it gives him satisfaction, it really doesn't matter to me.
by Maarten
Sun Oct 26, 2003 2:00 pm
Forum: Volume 105 (10500-10599)
Topic: 10522 - Height to Area
Replies: 32
Views: 15257

the thing i hate about this problem is that one can interpret certain inputs in different ways. For example: negative heights: this is either invalid, or one is supposed to use only absolute value of height. Both are equally probable. 2 zeros: It is possible to form a 'triangle' in which two heights...
by Maarten
Sun Oct 26, 2003 1:52 pm
Forum: Volume 5 (500-599)
Topic: 543 - Goldbach's Conjecture
Replies: 109
Views: 23962

Check your GeneratePrime() function... the only prime numbers it generates are 2,3,5,7.
Also, I am surprised you don't get TLE. Your method of generating primes and checking for primality is very inefficient. Have you ever heard of Erasthostenes Sieve (how the hell do you write it??)
by Maarten
Sun Oct 26, 2003 1:38 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 21043

not if you don't provide us with some details about your program, algorithm, or implementation
by Maarten
Fri Oct 24, 2003 10:53 am
Forum: Volume 105 (10500-10599)
Topic: 10522 - Height to Area
Replies: 32
Views: 15257

never mind me.. i made a stupid mistake: [cpp] else if( ha == 0.0 || hb == 0.0 ) printf( "These are invalid inputs!\n" ); else { [/cpp] it should be [cpp] else if( ha == 0.0 || hb == 0.0 ) { printf( "These are invalid inputs!\n" ); i++; } else { [/cpp]
by Maarten
Thu Oct 23, 2003 10:41 am
Forum: Volume 105 (10500-10599)
Topic: 10522 - Height to Area
Replies: 32
Views: 15257

negative heights ??? what the hell does that mean?
and when two of ha, hb, and hc are zero, then we have no triangle but something like a line, which obviously has are 0.000. I don't think it is invalid input. However, when only one of ha, hb, hc is zero, then the input is invalid.

Am I right here ?
by Maarten
Tue Oct 21, 2003 9:21 pm
Forum: Volume 105 (10500-10599)
Topic: 10522 - Height to Area
Replies: 32
Views: 15257

well i'm sorry i can't really help you as i still got WA too... so maybe someone else can help us out ?

Go to advanced search