Search found 34 matches

by afonsocsc
Fri Jul 29, 2005 11:46 am
Forum: Volume 4 (400-499)
Topic: 411 - Centipede Collisions
Replies: 8
Views: 1638

Great!
Glad that I could help :)
by afonsocsc
Thu Jul 28, 2005 1:36 pm
Forum: Volume 4 (400-499)
Topic: 411 - Centipede Collisions
Replies: 8
Views: 1638

Hi 1. The collision occurs when 1, that moves first, hits 2, and since when a centipede segment collides with a collision site it becomes part of the collision, the answer will be: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X . . . . . . . . . . . . . . . . . . . . . . ....
by afonsocsc
Tue Nov 02, 2004 1:42 am
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 37538

Why are you storing the input in an array?
If the input has more than 10 lines (excluding the last), your program will have an ArrayIndexOutOfBoundsException

You should process each line as you read it.
by afonsocsc
Wed Oct 27, 2004 1:52 am
Forum: Volume 1 (100-199)
Topic: 160 - Factors and Factorials
Replies: 205
Views: 26732

Hi,
Check out inputs from 47 to 52.
by afonsocsc
Wed Oct 27, 2004 1:32 am
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 37538

Hi,
I did a diff with your output and mine and here's the result:
Your program is printing one extra blank line in the beginning, and is adding one extra space at the end of each line.

Hope it helps
by afonsocsc
Wed Oct 27, 2004 1:04 am
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 37538

Hello,
try this input:
10 99999999
10 12345678
by afonsocsc
Wed Sep 15, 2004 3:15 pm
Forum: Volume 1 (100-199)
Topic: 105 - The Skyline Problem
Replies: 160
Views: 29582

Hello, You have an array of 10000, but you use 2*L and 2*R, since the numbers for L and R will be as high as 9999, your program will be accessing memory outside of the array. for example, with this input: 4090 5000 5000 your program gives: 4090 5000 5000 1073833120 5000 -1073744880 5001 -1073744764 ...
by afonsocsc
Sat Jul 24, 2004 2:27 am
Forum: Volume 7 (700-799)
Topic: 706 - LCD Display
Replies: 221
Views: 37538

Try this:
10 99999999
by afonsocsc
Sat Jul 17, 2004 12:06 pm
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 25103

Ok, sorry, I was confusing gets() with fgets(), gets() doesn't put the newline in the string...
But I found a bug in the code, try this input:
999999999999999999 * 1
by afonsocsc
Fri Jul 16, 2004 5:51 pm
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 25103

gets() also gets the newline from input, so if you use puts() it will have two newlines, if you want to use puts(), you simply have to remove the '\n' of the string retrieved by gets().
by afonsocsc
Fri Jul 16, 2004 2:56 pm
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 25103

Hi,
In the manpage of puts:
"puts() writes the string s and a trailing newline to stdout."
You're putting a newline at the end of each line of the input, so you should use either fputs or printf...

Hope it helps!
by afonsocsc
Tue Jun 03, 2003 1:08 am
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 22050

sneeze, I ran your program with my input and here's the results... input: 12 5 10 A 12 34 123 456 1 2 10 2 10 36 35 Z 0 0 your output: 12 (base 3) = 5 (base 6) 10 (base 10) = A (base 11) 12 (base 17) = 34 (base 5) 123 is not equal to 456 in any base 2..36 1 is not equal to 2 in any base 2..36 10 (ba...
by afonsocsc
Tue May 20, 2003 5:11 pm
Forum: Volume 2 (200-299)
Topic: 258 - Mirror Maze
Replies: 18
Views: 3249

Yes, the maze is always rectangular with only two entry/exits, there are no leading spaces, all spaces are dots, I think there can be black holes inside the maze anywhere.
by afonsocsc
Tue May 20, 2003 4:38 pm
Forum: Volume 2 (200-299)
Topic: 258 - Mirror Maze
Replies: 18
Views: 3249

I don't think so, the exits must lead outside the maze...
by afonsocsc
Sat Apr 26, 2003 2:21 pm
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 22050

with input:
0 0
your output is:
0 (base 1) = 0 (base 1)
but should be:
0 (base 2) = 0 (base 2)

Go to advanced search