Codeforces Round 959 by NEAR (Div. 1 + Div. 2) - Official Solution Discussion

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ย. 2024

ความคิดเห็น • 29

  • @user-kp1tc1zd2q
    @user-kp1tc1zd2q 2 หลายเดือนก่อน +7

    Its insane how i almost immediately understand how to solve D and E problem, but I've been reading C for about half an hour. Idk why problem setters always doing poor problem statements nowadays. Maybe these are measures against ChatGPT.

    • @fantastic-b2m
      @fantastic-b2m หลายเดือนก่อน

      only half an hour???? nah, it's way harder

    • @azmainfaiak8111
      @azmainfaiak8111 หลายเดือนก่อน +1

      I solved C faster than A

  • @sarveshborole389
    @sarveshborole389 หลายเดือนก่อน +2

    I went from specialist to pupil 😭😭, Please tell me how many DIV 2 C I need to solve to be comfortable???

  • @mahmoudbassem1434
    @mahmoudbassem1434 หลายเดือนก่อน +1

    Nice job mate! One thing I think the cuts are annoying, that needs to be worked on, or just don't do it.

  • @supriya_codes
    @supriya_codes 2 หลายเดือนก่อน +1

    was eagerly waiting for this! Thnkyuh @shayan

    • @CPwithShayan
      @CPwithShayan  หลายเดือนก่อน +1

      Thank you, Supriya!

  • @Epictetus777
    @Epictetus777 2 หลายเดือนก่อน +1

    @shayan please sir can you explain this : PROBLEM D: we are using f[] array to make the node dead and lets say we get node z and node y' for operation x then we make node y' as dead .How are we ensuring that down the line for any other x ,node y' will be not be critical node(only node forming pair with some other node divisible by operation number )??? or in simple words please prove choosing any node among two would be fine.

  • @mayankkharb4164
    @mayankkharb4164 2 หลายเดือนก่อน +1

    I was waiting for this only. I have a question regarding problem D, i understood that we're processing decreasing order of x but if we take x in increasing order it can create some problems and we might not get our solution, can you explain why is that? I can't understand why we can't take x in increasing order.

    • @jotsinghbindra8317
      @jotsinghbindra8317 2 หลายเดือนก่อน

      is this your username mayank5102002?

    • @darshanrajpattanaik2154
      @darshanrajpattanaik2154 2 หลายเดือนก่อน +2

      As already said by Shayan, if we have to choose the one having difference say `x`, if only we have x+1 vertices left, we can ensure that by pegionhole principle, we are guaranteed to get one's modulo x will be same as another one.
      If say you take the vertices in increasing order, while you get till n-1, you only have one choice which does not guarantee you to give two numbers having same modulo (n-1)

    • @chandranshpandey1929
      @chandranshpandey1929 หลายเดือนก่อน +1

      icreasing order me you will be having less pigeons and more number of boxes so ye condition ki ek box me do pigeon honge does not hold true

  • @shri9229
    @shri9229 หลายเดือนก่อน

    can we also solve C like, we keep the count of subarrays from l to r such that the value of 'g' becomes zero, and then subtract them from total number of arrays i'e n*(n+1)/2 so we do the DP where dp[l] = 1 + dp[l + r], where dp[l] holds number of subarray starting form l and having the 'g' as zero, so we can find r in log(n) time so time complexity becomes n log n , and in the end we summate the dp's and we can have our answer.

  • @Randomuser7890
    @Randomuser7890 9 วันที่ผ่านมา

    nice

  • @akashsuryavanshi7026
    @akashsuryavanshi7026 2 หลายเดือนก่อน

    Bro, you are true legend.

    • @CPwithShayan
      @CPwithShayan  หลายเดือนก่อน

      Thanks man! Means a lot

  • @pankajbhanwala-
    @pankajbhanwala- หลายเดือนก่อน

    n Problem E, the editorial says that if we have a bit set in sizes of two trees then we can set all other lower bits using that but this case is not possible if we can't always break the tree in desired size. For example for test case
    1
    2
    8
    1 1 1 1 1 1 1
    8
    1 1 1 1 1 1 1
    there are two trees with size 8. but by breaking the second tree we can only obtain 1 tree of size 4 and 4 tree of size 1. Thus breaking that tree into tree of size 4 and size 2 simultaneously is not possible. So the answer for this case should be 13 (8 | 4 | 1). Can you please explain

  • @tusharsingh9346
    @tusharsingh9346 2 หลายเดือนก่อน

    Thanks for the solutions. 🙏🙏

  • @solosoul3910
    @solosoul3910 หลายเดือนก่อน

    Problem D
    why is it always better to start with X = N -1 instead of X = 1 ?
    why do we decide to kill the node with higher numbre i ?

  • @mmmnmmmmmmmm
    @mmmnmmmmmmmm 2 หลายเดือนก่อน

    Thank you!!

  • @hdcutz2936
    @hdcutz2936 2 หลายเดือนก่อน +2

    It seems you made this video in hurry. I came to see how Problem D works but couldn't understand anything . Your last video was good but not this one. try to take actual examples and explain with edge cases. Not intuitive video it's like you are explaining from editorial section

    • @CPwithShayan
      @CPwithShayan  หลายเดือนก่อน +1

      I'm sorry if that is the case. We'll try to improve the content next time.

  • @ankit21309
    @ankit21309 2 หลายเดือนก่อน

    buy a mike dude

    • @CPwithShayan
      @CPwithShayan  หลายเดือนก่อน +1

      a Mike or mic?

    • @ankit21309
      @ankit21309 หลายเดือนก่อน

      @@CPwithShayan we already have Mike Mirzayanov so a mic 😂😂

    • @CPwithShayan
      @CPwithShayan  หลายเดือนก่อน +1

      @@ankit21309 Yes 😂 I will do that then. Thanks for feedback. ❤️