Hi, I am stuck at problem J of asc 29, and cant think of any solution. Can someone please guide me towards the solution.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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://codeforces.net/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 :)
Название |
---|