Page 1 of 2

11241 - Humidex

Posted: Sun Jul 15, 2007 1:54 pm
by bishop
i think it is easy problem
my steps are
1. if input is "D" then calculate as given
2. if input is "H" then calculate "D" as new form of getting D from given
3. if input is "E" end

it gives my output as example
but result
WA

what can i do for it

Posted: Sun Jul 15, 2007 2:07 pm
by sunny
The values of any two items among T,D & H will be given. You have to find the missing one.

yes

Posted: Sun Jul 15, 2007 2:15 pm
by bishop
that is what i understand

but my code gives me right output
but judge WA

why ........

Code: Select all




Posted: Sun Jul 15, 2007 2:27 pm
by sunny
You think that the first number will be always 'T'. Which is not the case always.
Suppose, these inputs:

Code: Select all

D 25 H 45
D 25 T 25

Posted: Mon Jul 16, 2007 1:08 pm
by Wei-Ming Chen
forgive my poor English..

But what is the meaning of
where exp(x) is 2.718281828 raised to the exponent x
Or can someone tell me how can I know H=42.3 of the input

Code: Select all

T 30.0 D 25.0
I count H=39.8... :oops:

Posted: Mon Jul 16, 2007 7:43 pm
by Rocky
i use direct the equation that said in the problem statement and calculate the value directly....no special check for precission.

so use the equation....even u use it check it or post ur code.

GOOD LUCK
Rocky

Posted: Tue Jul 17, 2007 10:16 am
by Wei-Ming Chen
Well, I use

Code: Select all

e = 6.11 * 2.718281828 * [5417.7530 * ((1/273.16) - (1/(D+273.16)))]
I think it is very strange..


EDIT:

Yes, that's right, thanks Darko

Code: Select all

e = 6.11 * 2.718281828 ^ [5417.7530 * ((1/273.16) - (1/(D+273.16)))]

Posted: Tue Jul 17, 2007 3:53 pm
by Darko
That is different from

Code: Select all

e = 6.11 * 2.718281828 ^ [5417.7530 * ((1/273.16) - (1/(D+273.16)))]
"raised to the exponent" means "multiply 2.71... x times". It is a built-in function.

Posted: Tue Jul 17, 2007 9:57 pm
by Rocky
i use that darko mean.....

Code: Select all

e = 6.11 * exp (5417.7530 * ((1/273.16) - (1/(dew+273.16))))
and it work.

GOOD LUCK
Rocky

Why WA

Posted: Mon Jul 30, 2007 7:39 pm
by Debashis Maitra
Can anybody say why its WA

Code: Select all

Removed
Thanx in advance

Posted: Wed Aug 01, 2007 12:03 am
by David Kjaer
I think your problem might be precision... Consider the following lines from your program..

a=e/6.11;
a=log(a)/log(2.718281828);

First, since log is the natural logarithm, log(exp(x))=x.. Second there actually is a way to totally avoid log...

Posted: Thu Aug 02, 2007 6:21 am
by Debashis Maitra
Thanks David Kjaer

Posted: Thu Aug 02, 2007 4:55 pm
by abdullah<cse du>
Hi all,

If any one accepted this problem can give me some i/o to check my code. I got several wrong answer.

ABDULLAH.

Posted: Thu Aug 02, 2007 7:44 pm
by kolpobilashi
input:

Code: Select all

T 55.55 D 45.67
H 19.28 D 23.6
T 49.0 D 39.0
D 100 T 100
H 78.8 D 88.98
T 0.0 D 0.0
T -20.0 H -5.0
D 27.4 T -20.08
output:

Code: Select all

T 55.5 D 45.7 H 108.1
T 8.4 D 23.6 H 19.3
T 49.0 D 39.0 H 83.9
T 100.0 D 100.0 H 784.7
T -359.4 D 89.0 H 78.8
T 0.0 D 0.0 H -2.2
T -20.0 D 27.3 H -5.0
T -20.1 D 27.4 H -4.9
best wishes. :)

Posted: Fri Aug 03, 2007 3:53 am
by abdullah<cse du>
kolpobilashi,

Thanks for i/o. I got accepted.

ABDULLAH