Dice Probability | CSES problem set | Solution explained and Python code

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 9

  • @TarunKumar-qs9dj
    @TarunKumar-qs9dj 2 роки тому

    Pls continue this CSES series in python as long as you can solve it

  • @saithunga152
    @saithunga152 2 роки тому

    Well Explained!!

  • @ishayadav001
    @ishayadav001 2 роки тому

    Great video!!

  • @omaralzakout4100
    @omaralzakout4100 Рік тому

    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

  • @mallasatyanarayana1942
    @mallasatyanarayana1942 Рік тому

    Hi Sai Anish Mall, can you post Python interview questions for preparation all in 1 video, Thx

  • @TechWithOtmane
    @TechWithOtmane 11 місяців тому

    if some found solution of book shop problem with python 3 , every time i submit the code he give me runtime error

  • @consistentthoughts826
    @consistentthoughts826 2 роки тому

    CSES has very strict online judge and it is difficult to get accepted for python

    • @saianishmalla2646
      @saianishmalla2646  2 роки тому

      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.

    • @consistentthoughts826
      @consistentthoughts826 2 роки тому

      @@saianishmalla2646 please make all videos of cses as these 300 questions are a grrat source of knowledge