Hi, I am stuck at problem J of asc 29, and cant think of any solution. Can someone please guide me towards the solution.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Hi, I am stuck at problem J of asc 29, and cant think of any solution. Can someone please guide me towards the solution.
I am not getting WA for the sample case 2 ( an error of 0.01) for this question (Problem A — Casino) http://mirror.codeforces.com/gym/100357
My approach is as follows :-
Since player always chooses best bet possible , for any amount of money we have, loosing a bet and going back to smaller amount of money can never be the best bet. Suppose dp1[a] denotes the max prob. of winning using best bet and also stores the index of the best bet.
dp1[a] = max over a<j<=n {dp1[i + w[j]] * p[j]/s};
Now we have the best bets stored for every index. Let dp[a][b] denote that at "a" unit of time, if we have "b" units of money, then what is the probability of getting to this state. Now we can reach b amounts of money from any state if the money at that state + money won from best bet == b. Using this we can get a dp relation . Finally we can run this dp over some 10000 units of time or any other large number till it becomes stable for an error of 10^9. Or we can use matrix exponentiation over the dp and compute even for a much larger limit.
Please help me, i can't understand why my method is wrong. Even if you can not understand my approach, it would be great if you explain how to solve the question.
My team ranked 107 on snackdown el. round and we just missed the onsites with a time diff of <20 mins. However i checked one of my WA on the easiest question and i noticed this. Problem Link : www.codechef.com/problems/TTENIS
Code which gave WA during contest : http://www.codechef.com/viewsolution/7190656 Code which gave AC after contest : http://www.codechef.com/viewsolution/7248112 The only difference between these two codes is that "scanf("%d", &t);" is replaced by "cin>>t;"
Also another query , if someone can read the question and tell me why this logic fails: http://www.codechef.com/viewsolution/7191333 The logic is based on the fact that this is given in the question :- "(It is guaranteed that statistics always represent a valid , finished match.)"
Any help will be grateful. Thnx a lot :)
Name |
---|