10215 - The Largest/Smallest Box ...
Moderator: Board moderators
-
- Experienced poster
- Posts: 161
- Joined: Tue Oct 25, 2005 8:38 pm
- Location: buet, dhaka, bangladesh
i still cannot understand the problem. from observation V=(W-2x)(L-2x)x. for V(max), x has only one value, it has no trouble. but for V(min), x = 0, W/2, L/2; so to determine V(min), i printed 3 values of x, while W != L, and 2 values of x, while W = L, and i got WA. then i checked the board and found that, the program is accepted only for 2 values of x; x = 0 and x = min(W,L)/2. but why not x = 0, min(W,L)/2 and max(W,L)/2, while W != L ?
ishtiak zaman
----------------
the world is nothing but a good program, and we are all some instances of the program
----------------
the world is nothing but a good program, and we are all some instances of the program
-
- New poster
- Posts: 12
- Joined: Thu Nov 09, 2006 11:49 am
Rejudge
Rejudgement makes this problem very very difficult one. Now, accept rate is only 2.0%, of cource I got WA too 
http://acm.uva.es/p/problemstat.php?p=:10215
I checked the board, however, judges have just delete some tricky inputs.
http://online-judge.uva.es/board/viewtopic.php?t=12778
Why everybody got wa? I think if judges only delete inputs, programs which got accept first time should be accepted. So there must be some brandnew inputs.
Help! I need somebody, not just anybody but have got accept this time.
Here is my code.
Thanks in advance 

http://acm.uva.es/p/problemstat.php?p=:10215
I checked the board, however, judges have just delete some tricky inputs.
http://online-judge.uva.es/board/viewtopic.php?t=12778
Why everybody got wa? I think if judges only delete inputs, programs which got accept first time should be accepted. So there must be some brandnew inputs.
Help! I need somebody, not just anybody but have got accept this time.
Here is my code.
Code: Select all
cut after got ac

Last edited by DIR EN GREY on Tue Nov 28, 2006 12:15 am, edited 1 time in total.
Do you understand my English???
-
- New poster
- Posts: 12
- Joined: Thu Nov 09, 2006 11:49 am
Thanks Jan!! I got accept immediately, but I can't understand that why I must use eps before printing? How eps works? I always use cout, setiosflags() and setprecision() when round off is required, and they works fine without EPS...Jan wrote:Add eps before printing anything. I used 1e-7. Hope it helps.
What input is crtical?? When I should use EPS??
thanks in advance

Do you understand my English???
Imagine that the output is 1.05, but due to floating point calculation, your output became 1.049999999999. Now if you print only one digit after the decimal point your output is 1.0 but the real output is actually 1.1.
Thats why almost all problems that have floating point output are judged with a special judge program (marked by a yellow flag). But some problems dont have the special judge, for those problems its better to add eps before printing any floating point number. And eps should be as small as possible. Using 1e-7 to 1e-11 is sufficient.
The output will show .1, which is obviously not correct. But if you add eps before printing 'a', you will see .2, which is the correct output.
Thats why almost all problems that have floating point output are judged with a special judge program (marked by a yellow flag). But some problems dont have the special judge, for those problems its better to add eps before printing any floating point number. And eps should be as small as possible. Using 1e-7 to 1e-11 is sufficient.
Code: Select all
double a;
a=0.15;
printf("%.1lf\n",a);
Ami ekhono shopno dekhi...
HomePage
HomePage
-
- New poster
- Posts: 12
- Joined: Thu Nov 09, 2006 11:49 am
PLEASE HELP!!!
Code: Select all
CODE ACCEPTED!!!



@Mr. Jan
max+=0.0000001 is that what you meant when you said add eps??? If not, please tell me what you meant. Thanks a lot.[[/b]
Confused
I really didn't undertand why your code print 3 numbers as output for some inputs. My WA code printed the following for the last 3 cases of the first post:
If the minimum volume is 0 and the volume is (L-2x)(M-2x)x, I got:
- L - 2x = 0;
- M - 2x = 0;
- x = 0.
Where is my mistake?
Thanks,
Willian.
Code: Select all
1666.500 0.000 4999.500
0.250 0.000 0.500 4999.500
0.250 0.000 0.500 4999.500
- L - 2x = 0;
- M - 2x = 0;
- x = 0.
Where is my mistake?
Thanks,
Willian.
"Don't let the day go by
Don't let it end
Don't let the day go by, in doubts
The anwser lis within"
Don't let it end
Don't let the day go by, in doubts
The anwser lis within"
why is my programm giving WA
here's my code....it seems right but gives WA...also suggest me how to use eps???
Code: Select all
CODE Deleted after AC
Last edited by fR0D on Mon Feb 25, 2008 8:09 pm, edited 1 time in total.