Page 1 of 1

11291 - Smeech

Posted: Sat Sep 29, 2007 10:23 pm
by Piklu_sust
Can anyone explain what should do in this problem?
I cannot find the meaning of the following statement:
With probability p, (p e1 e2) represents x+y where x is the value of e1 and y is the value of e2; otherwise it represents x-y.
How can be p used for the statement?

Posted: Sat Sep 29, 2007 10:30 pm
by helloneo
I understood it this way..
the expected value of (p e1 e2) is p*(x+y) + (1-p)*(x-y)..

wa

Posted: Sun Sep 30, 2007 10:25 am
by tanvir
can anyone check this code. im getting wa again again :(

Code: Select all

cut
best regard
tanvir

Posted: Sun Sep 30, 2007 10:34 am
by helloneo
Try this case..

Code: Select all

(0.3 2 (1 1 -10))
()
My output is..

Code: Select all

5.60

Posted: Mon Oct 01, 2007 12:26 am
by sclo
Hint: My code is only about 30 lines long!

Posted: Mon Oct 01, 2007 7:17 am
by tanvir
sorry i was not considering the negetive numbers there...
but now im considering the negetive numbers here....
but also wa wa wa :roll:
can any one check the code or give sample input output....

Code: Select all

cut aft ac
regard
tanvir

Posted: Mon Oct 01, 2007 7:39 am
by sclo
I'm not sure, but how do you know the format of the real numbers that is in the judge input?

Posted: Mon Oct 01, 2007 8:37 am
by helloneo
Another test case..

Code: Select all

(1.0 (1.0 (1.0 -1 -2) (1.0 -1 -2)) (1.0 (1.0 1 2) 2))
()
My output is..

Code: Select all

-1.00

Posted: Mon Oct 01, 2007 10:37 am
by tanvir
thnx helloneo
i was really making dumping things in nested area.
got ac last. :lol:
tanvir