Hi, first of all thanks for this great video but I don't think your solution works for c++ as pow(6,n) is very big and this will cause overflow. My solution is to store the probability in the dp array instead of the number of ways so your code will work perfictly with this three changes : 1 - Initiate arr[0][x] = 1.0/6 2 - When calculating the arr[x][i] += arr[x-1][i-j] / 6 3 - Calculating the res will be just the sum without the division
Pls continue this CSES series in python as long as you can solve it
Well Explained!!
Great video!!
Hi, first of all thanks for this great video but I don't think your solution works for c++ as pow(6,n) is very big and this will cause overflow.
My solution is to store the probability in the dp array instead of the number of ways so your code will work perfictly with this three changes :
1 - Initiate arr[0][x] = 1.0/6
2 - When calculating the arr[x][i] += arr[x-1][i-j] / 6
3 - Calculating the res will be just the sum without the division
Hi Sai Anish Mall, can you post Python interview questions for preparation all in 1 video, Thx
if some found solution of book shop problem with python 3 , every time i submit the code he give me runtime error
CSES has very strict online judge and it is difficult to get accepted for python
I do try to use C++ for most of them but tbh I'm way too comfortable with python so I just ended up using python for this.
@@saianishmalla2646 please make all videos of cses as these 300 questions are a grrat source of knowledge