11241 - Humidex

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

bishop
New poster
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

11241 - Humidex

Post 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
sunny
Experienced poster
Posts: 124
Joined: Sun Sep 11, 2005 10:22 pm
Location: Civil-BUET

Post by sunny »

The values of any two items among T,D & H will be given. You have to find the missing one.
bishop
New poster
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

yes

Post by bishop »

that is what i understand

but my code gives me right output
but judge WA

why ........

Code: Select all



Last edited by bishop on Sun Jul 15, 2007 2:55 pm, edited 1 time in total.
sunny
Experienced poster
Posts: 124
Joined: Sun Sep 11, 2005 10:22 pm
Location: Civil-BUET

Post 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
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post 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:
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am

Post 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
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post 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)))]
Last edited by Wei-Ming Chen on Thu Jul 19, 2007 5:55 am, edited 1 time in total.
Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post 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.
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am

Post 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
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Why WA

Post by Debashis Maitra »

Can anybody say why its WA

Code: Select all

Removed
Thanx in advance
Last edited by Debashis Maitra on Thu Aug 02, 2007 6:20 am, edited 1 time in total.
Akash chhoyar swopno
Dream to touch the sky
David Kjaer
New poster
Posts: 9
Joined: Sat Jul 07, 2007 5:47 pm
Location: Denmark

Post 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...
Randers FC l
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra »

Thanks David Kjaer
Akash chhoyar swopno
Dream to touch the sky
abdullah<cse du>
New poster
Posts: 39
Joined: Mon Dec 04, 2006 2:18 pm
Location: Bangladesh(CSE DU)
Contact:

Post 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.
We were in past, we are in past and we will go in past.
kolpobilashi
Learning poster
Posts: 54
Joined: Mon Jan 02, 2006 3:06 am
Location: Dhaka,Bangladesh
Contact:

Post 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. :)
Sanjana
abdullah<cse du>
New poster
Posts: 39
Joined: Mon Dec 04, 2006 2:18 pm
Location: Bangladesh(CSE DU)
Contact:

Post by abdullah<cse du> »

kolpobilashi,

Thanks for i/o. I got accepted.

ABDULLAH
We were in past, we are in past and we will go in past.
Post Reply

Return to “Volume 112 (11200-11299)”