All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
Rocky
Experienced poster
Posts: 124 Joined: Thu Oct 14, 2004 9:05 am
Post
by Rocky » Tue Jul 10, 2007 9:18 am
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
Robert Gerbicz
Experienced poster
Posts: 196 Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek
Contact:
Post
by Robert Gerbicz » Tue Jul 10, 2007 9:45 am
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.
Wei-Ming Chen
Experienced poster
Posts: 122 Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan
Post
by Wei-Ming Chen » Tue Jul 10, 2007 12:18 pm
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
Kallol
Learning poster
Posts: 100 Joined: Sun Nov 13, 2005 8:56 am
Post
by Kallol » Tue Jul 10, 2007 3:54 pm
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
Syed Ishtiaque Ahmed Kallol
CSE,BUET
Bangladesh
mpi
New poster
Posts: 46 Joined: Fri Nov 03, 2006 7:53 pm
Location: Madrid
Post
by mpi » Wed Jul 11, 2007 6:58 pm
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?
Last edited by
mpi on Wed Jul 11, 2007 7:19 pm, edited 1 time in total.
Adrian Kuegel
Guru
Posts: 724 Joined: Wed Dec 19, 2001 2:00 am
Location: Germany
Post
by Adrian Kuegel » Wed Jul 11, 2007 7:03 pm
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.
mpi
New poster
Posts: 46 Joined: Fri Nov 03, 2006 7:53 pm
Location: Madrid
Post
by mpi » Wed Jul 11, 2007 7:24 pm
Thanks a lot Adrian. It's difficult to see integers among so many floating point operations
joeluchoa
New poster
Posts: 28 Joined: Sat Jul 31, 2004 12:11 am
Location: Brasil
Post
by joeluchoa » Tue Jul 17, 2007 5:58 pm
I've got still WA. Please, help me.
Last edited by
joeluchoa on Fri Jul 20, 2007 3:11 am, edited 1 time in total.
Adrian Kuegel
Guru
Posts: 724 Joined: Wed Dec 19, 2001 2:00 am
Location: Germany
Post
by Adrian Kuegel » Thu Jul 19, 2007 12:00 am
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.
joeluchoa
New poster
Posts: 28 Joined: Sat Jul 31, 2004 12:11 am
Location: Brasil
Post
by joeluchoa » Fri Jul 20, 2007 3:10 am
I found the solution without binary search! Thanks Adrian!
Carunty
New poster
Posts: 18 Joined: Sat Jul 08, 2006 2:40 am
Post
by Carunty » Mon Sep 03, 2007 7:32 pm
I am suffer from precision error in this problem.
Can anyone help me?
sunny
Experienced poster
Posts: 124 Joined: Sun Sep 11, 2005 10:22 pm
Location: Civil-BUET
Post
by sunny » Mon Sep 03, 2007 8:52 pm
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.
Carunty
New poster
Posts: 18 Joined: Sat Jul 08, 2006 2:40 am
Post
by Carunty » Tue Sep 04, 2007 11:30 am
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.
helloneo
Guru
Posts: 516 Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea
Post
by helloneo » Tue Sep 04, 2007 11:48 am
How did you set PI value..?
I did..
Carunty
New poster
Posts: 18 Joined: Sat Jul 08, 2006 2:40 am
Post
by Carunty » Tue Sep 04, 2007 5:32 pm
I post my code here.
I will delete before the day after tomorrow.
Hope someone can help me debug it.
Remove because Acc
Last edited by
Carunty on Wed Sep 05, 2007 2:29 pm, edited 1 time in total.