Page 2 of 3
Posted: Tue Jul 10, 2007 9:18 am
by Rocky
yahh...some difference.check it..
my output for ur input
Code: Select all
22.506
64.587
3.715
12022.696
6511.038
8914.445
68.407
96.418
167.925
24725.716
338.349
6078.695
4.988
1.964
2038.864
GOOD LUCK
Rocky
Posted: Tue Jul 10, 2007 9:45 am
by Robert Gerbicz
Wei-Ming Chen wrote:thanks.. but my outputs are same as yours..
I tried some other inputs, can someone check my outputs for me?
input
Code: Select all
8 7
4 52
1 47
69 54
47 52
32 78
4 55
77 4
5 86
100 54
7 89
55 43
1 63
25 1
44 23
0 0
Lots of your input are invalid, because it is assumed that the input is w h, where w<=h is true.
Posted: Tue Jul 10, 2007 12:18 pm
by Wei-Ming Chen
Oh, I wasn't notice it, I will change it right now
And here are some others I/O
can someone check for me again?
inputs
Code: Select all
30 35
30 36
30 37
30 38
30 39
30 40
30 41
30 42
30 43
30 44
30 45
30 46
30 47
30 48
30 49
30 50
30 51
30 52
30 53
30 54
30 55
30 56
30 57
30 58
30 59
30 60
30 61
30 62
30 63
30 64
30 65
30 66
30 67
30 68
30 69
30 70
30 71
30 72
30 73
30 74
30 75
30 76
30 77
30 78
30 79
30 80
0 0
outputs
Code: Select all
1822.772
1894.392
1966.012
2037.632
2109.251
2197.841
2309.107
2423.120
2539.881
2659.388
2781.643
2906.645
3034.395
3164.892
3298.136
3434.127
3572.866
3714.352
3858.585
4005.566
4155.294
4307.769
4462.992
4620.962
4781.679
4945.143
5111.355
5280.314
5452.020
5626.474
5803.675
5983.623
6166.319
6351.762
6539.952
6730.889
6924.574
7121.006
7320.186
7522.112
7726.786
7934.208
8144.376
8357.292
8572.955
8791.366
Posted: Tue Jul 10, 2007 3:54 pm
by Kallol
here is the output of my AC code for ur input:
input:
Code: Select all
30 35
30 36
30 37
30 38
30 39
30 40
30 41
30 42
30 43
30 44
30 45
30 46
30 47
30 48
30 49
30 50
30 51
30 52
30 53
30 54
30 55
30 56
30 57
30 58
30 59
30 60
30 61
30 62
30 63
30 64
30 65
30 66
30 67
30 68
30 69
30 70
30 71
30 72
30 73
30 74
30 75
30 76
30 77
30 78
30 79
30 80
0 0
output:
Code: Select all
1822.772
1894.392
1966.012
2037.632
2109.251
2197.841
2309.107
2423.120
2539.881
2659.388
2781.643
2906.645
3034.395
3164.892
3298.136
3434.127
3572.866
3714.352
3858.585
4005.566
4155.294
4307.769
4462.992
4620.962
4781.679
4945.143
5111.355
5280.314
5452.020
5626.474
5803.675
5983.623
6166.319
6351.762
6539.952
6730.889
6924.574
7121.006
7320.186
7522.112
7726.786
7934.208
8144.376
8357.292
8572.955
8791.366
Not so simple?
Posted: Wed Jul 11, 2007 6:58 pm
by mpi
I think this problem is not so complicated, but i'm getting WA all the time. Here is the algo:
My program gives the right results to the inputs shown in this thread. Anyone can help?
Posted: Wed Jul 11, 2007 7:03 pm
by Adrian Kuegel
Your mistake is in this line:
if ((r1 * 2) > w) r1 = w / 2;
since w is integer, you use integer division here, rounding down if w is odd.
Use w / 2.0 instead.
And please delete your code when you got Accepted.
Posted: Wed Jul 11, 2007 7:24 pm
by mpi
Thanks a lot Adrian. It's difficult to see integers among so many floating point operations

Posted: Tue Jul 17, 2007 5:58 pm
by joeluchoa
I've got still WA. Please, help me.
Posted: Thu Jul 19, 2007 12:00 am
by Adrian Kuegel
Try your program on the test cases posted in this thread, then you see why you got WA. Many of your answers are too small. I believe your find method is incorrect, I am not completely sure I understand it, but it seems you combine the two ways to get the cylinder in one function and do a modified binary search on that function. But this function is not concave, it has two "peaks". If you notice this, you will see that there is a solution without any binary search.
Posted: Fri Jul 20, 2007 3:10 am
by joeluchoa
I found the solution without binary search! Thanks Adrian!
Posted: Mon Sep 03, 2007 7:32 pm
by Carunty
I am suffer from precision error in this problem.
Can anyone help me?
Posted: Mon Sep 03, 2007 8:52 pm
by sunny
Carunty wrote:I am suffer from precision error in this problem.
Can anyone help me?
For this problem I didn't care for any precision error at all.
Check your code again, may be you are doing some other mistakes.
Posted: Tue Sep 04, 2007 11:30 am
by Carunty
For this problem I didn't care for any precision error at all.
Check your code again, may be you are doing some other mistakes.
Thank you for you advice.
I have checked for the sample case posted here.
However,I find no bug to my program.
Posted: Tue Sep 04, 2007 11:48 am
by helloneo
How did you set PI value..?
I did..
Posted: Tue Sep 04, 2007 5:32 pm
by Carunty
I post my code here.
I will delete before the day after tomorrow.
Hope someone can help me debug it.
Remove because Acc