11909 - Soya Milk
Moderator: Board moderators
11909 - Soya Milk
I am getting WA for this problem. I get the exact ans for the sample I/O.
plz help.
plz help.
-
- Experienced poster
- Posts: 110
- Joined: Tue May 06, 2008 2:18 pm
- Location: CSE-DU, Bangladesh
- Contact:
Re: 11909 - Soya Milk
large angle with L > H 

You should not always say what you know, but you should always know what you say.
-
- Experienced poster
- Posts: 147
- Joined: Mon Jun 07, 2010 11:43 am
- Location: University Of Dhaka,Bangladesh
- Contact:
Re: 11909 - Soya Milk
UVa stats: http://felix-halim.net/uva/hunting.php?id=63448
My blog on programming: http://www.shafaetsplanet.com/planetcoding/
My blog on programming: http://www.shafaetsplanet.com/planetcoding/
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11909 - Soya Milk
I am confused about the process of solving. Can anyone discuss about that?
If you have determination, you can do anything you want....

-
- New poster
- Posts: 50
- Joined: Tue May 25, 2010 9:10 am
- Contact:
Re: 11909 - Soya Milk
Suparb problem...!! for the condition where l>h && Angle is very large... we have to check whether the surface of the milk is in between 'h' or not...that is if (l*tan(ang))>h
then only the portion of milk that is Volume of the Triangle is the result....
then only the portion of milk that is Volume of the Triangle is the result....

I'll keep holding on...Until the walls come tumbling down...And freedom is all around ..... 

Re: 11909 - Soya Milk
I solved this in my first try. I must agree with everyone else, this is a really great problem. Please don't underestimate the problem. Although the problem description says that it may not perfectly match the real-life situation, I am going to advice you to visualize this as a real-life situation. Here are some test cases if you get WA.
2 8 9 85
17 32 87 5
17 9 87 82
Output should be:
28.346 mL
46923.452 mL
4786.891 mL
respectively
2 8 9 85
17 32 87 5
17 9 87 82
Output should be:
28.346 mL
46923.452 mL
4786.891 mL
respectively
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson
Why 11909 is WA, help please
Hello all I'm getting WA. But Why
, though I test the cases 9 6 19 20 & 89 5 10 80, have any more critical input? or let see the code mine below:
[/color]

Code: Select all
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <deque>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include<stdio.h>
#include<stdlib.h>
#define PI 4*atan(1)
int main()
{
float l, w, h, th, vol, tvol, v, o, result, area, res;
while(scanf("%f%f%f%f", &l,&w, &h, &th)==4)
{
if(l<=h)
{
result=cos (th*PI/180);
o=l/result;
v=sqrt(o*o-l*l);
vol=.5*l*v*w;
tvol=l*w*h;
res=tvol-vol;
}
else if(l>h)
{
result=tan((90-th)*PI/180);
v=h*result;
vol=.5*v*h*w;
res=vol;
}
printf("%.3f mL\n",res);
}
return 0;
}
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: Why 11909 is WA, help please
Try using double instead of float.
Check input and AC output for thousands of problems on uDebug!
Re: Why 11909 is WA, help please
For double the problem gives o/p 0.000 but for long double gives correct answer at my compiler but UVA gives me WA. What can I do now?
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: Why 11909 is WA, help please
Try the cases in this thread: http://acm.uva.es/board/viewtopic.php?t=51535
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 1
- Joined: Sat Feb 15, 2014 11:41 pm
-
- New poster
- Posts: 10
- Joined: Sat Sep 06, 2014 12:44 pm
Re: 11909 - Soya Milk
Last edited by nasim.ruet on Tue Sep 23, 2014 8:12 pm, edited 1 time in total.
Re: 11909 - Soya Milk
My advice to you -> always copy/paste output format from sample or problem description.
Input
Sample Output
Your Output
Don't forget to remove all your codes after getting accepted. 
Input
Code: Select all
9 6 19 20
Code: Select all
937.555 ml
Code: Select all
937.555 mL

A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Re: 11909 - Soya Milk
Input
Acc Output
Code: Select all
9 6 19 20
89 5 10 80
2 8 9 85
1 1 1 89
17 32 87 5
17 9 87 82
1 2 3 45
34 56 23 23
45 23 89 78
32 12 28 1
4 7 1 70
Code: Select all
937.555 mL
44.082 mL
28.346 mL
0.009 mL
46923.452 mL
4786.891 mL
5.000 mL
30052.599 mL
19362.096 mL
10644.756 mL
1.274 mL
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman