A,B,C | Codeforces Round 934 Solutions | MEX Game 1 | Equal XOR | Destroying Bridges | Abhinav

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 71

  • @AbjSir
    @AbjSir 7 месяцев назад +1

    I was also able to do 3 problems (in 1 hour). This contest felt like codechef 😍(Bitwise and game theory), loved it

  • @raghavdiwakar9202
    @raghavdiwakar9202 7 месяцев назад

    Applied exactly same approach on q3 but instead of running loop 2 times for second smallest i was using a variable chance for maintaining the chance of alias and bob

  • @iftiifti4063
    @iftiifti4063 7 месяцев назад +2

    Your video is really helpful . Nice explanation . Take love from Bangladesh ❤❤❤❤.

  • @comedykhomedy
    @comedykhomedy 7 месяцев назад +1

    For no. 3,
    If v[i] is present 2 or more times,mex.push_back(v[i]);
    Else if v[i] is present 1 time ,take the min of them.
    After that insert it into mex vector and sort it and find from 0 to infinity that which element is not present in the mex array

  • @Rlxn5
    @Rlxn5 7 месяцев назад +7

    Nice explanation for every contest sir 🙌🫶....(denominator 😂..✌️)

    • @AbjSir
      @AbjSir 7 месяцев назад

      😂😂😂😂

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +1

      Thanks 😂

    • @Rlxn5
      @Rlxn5 7 месяцев назад

      @@AbhinavAwasthi sir am in one confusion that , am in 2nd yr 2nd sem , I started cp 1 month ago , can I go with it or to start web . Which is right time to start development as am in 2-2, please reply sir 🙂

    • @priyanshkumar17
      @priyanshkumar17 7 месяцев назад

      @@Rlxn5Hii ! I m too in 4th semester. Have you completed DSA??

    • @Rlxn5
      @Rlxn5 7 месяцев назад

      @@priyanshkumar17 yeah am following strivers sheet . completed upto BS

  • @priyanshkumar17
    @priyanshkumar17 7 месяцев назад +1

    Thanks a lot for your approach on C :) !!

  • @sumandey8257
    @sumandey8257 6 месяцев назад +1

    Can anyone help me by sharing important properties of XOR that generally used in the problem solving. Like,x^x=0,x^0=0.But what else xor properties needed?

    • @AbhinavAwasthi
      @AbhinavAwasthi  6 месяцев назад

      Check some articles of gfg and practice problems

  • @priyanshkumar17
    @priyanshkumar17 7 месяцев назад +1

    Nice explanation !! Keep up the good work !!! Sir, maine D ka code likha toh TLE aagya !!!..Please uska solution bhi dedo

    • @thisismr900
      @thisismr900 7 месяцев назад

      if u are using hashing based approach, try to hash them with two prime numbers and store result as a pair.By doing this , it will prevent hash collisions.

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад

      Thanks, sure I will try to upload it

    • @priyanshkumar17
      @priyanshkumar17 7 месяцев назад

      @@thisismr900No, I was using brute force that's why got tle

    • @thisismr900
      @thisismr900 7 месяцев назад

      @@priyanshkumar17 yes, brute gives tle definitely

  • @pratyushdubey5362
    @pratyushdubey5362 7 месяцев назад +2

    Sir I am not able to solve Div2B problems on codeforces which rating problms should I focus on and practice so that I can solve Div2B consistently and are ther any specfic topics i should study?

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +2

      Practice problems of rating 1100-1300

  • @Beingamanforever
    @Beingamanforever 7 месяцев назад

    instead of removing the last number you inserted using pop back in problem B what you could have done is that first you should add the numbers which occur twice and then just normally add those who occur once, in that case this case of checking wont be required

    • @jee6455
      @jee6455 5 месяцев назад

      but then there might be possiblity that in ans1 element of freq 2 is added and on ans2 only element with freq 1 is pushed so xor will not be equal a,=m i right?

  • @prakhargarg4166
    @prakhargarg4166 4 месяца назад +1

    Helpful

  • @preetu391
    @preetu391 7 месяцев назад +1

    Great editorials 🎉

  • @romtala
    @romtala 6 месяцев назад +1

    verey very heplful

  • @ujjwalofficial3849
    @ujjwalofficial3849 7 месяцев назад +1

    NICE

  • @akhileshagarwal5913
    @akhileshagarwal5913 7 месяцев назад +1

    I Just wanted to ask this question that in 2nd question if we Apply sliding window is there a case in which we might not get the required answer

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад

      How will you apply sliding window, can you send code?

  • @ronakkriplani1838
    @ronakkriplani1838 7 месяцев назад

    please explain D also

  • @renuawasthi385
    @renuawasthi385 7 месяцев назад +1

    ❤❤❤❤❤

  • @executelikeap403
    @executelikeap403 7 месяцев назад +1

    Same here sir
    Phele 3 ke baad Mai bhi adhe ghante phele utha gya
    Ho hi nhi rha tha

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад

      Koi nhi, hota hai
      Keep trying 🙌🏻

  • @hossain9410
    @hossain9410 7 месяцев назад +1

    if array a has the same elements twice then array b has 0 times that of elements ten why k-=2 from array b. please explain this.. thank you

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +1

      Array a has 0 times, but b has 2

  • @Immaybenotforthenextsecond
    @Immaybenotforthenextsecond 7 месяцев назад +1

    the contest is rated or unrated

  • @dharamvirsingh6422
    @dharamvirsingh6422 7 месяцев назад +1

    sir how can you do contest before time, your submission is on 18:02 but contest is started at 20:05

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +1

      How bro 😅🙆🏻‍♂️, where you see this?

    • @dharamvirsingh6422
      @dharamvirsingh6422 7 месяцев назад +1

      @@AbhinavAwasthi time stamp 11:39 last submission ke niche time me

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +1

      ​@@dharamvirsingh6422 It's UTC time, not IST, check your also

    • @dharamvirsingh6422
      @dharamvirsingh6422 7 месяцев назад

      @@AbhinavAwasthi thank very much sir 🙏😙

  • @mradultiwari9864
    @mradultiwari9864 7 месяцев назад +1

    Simple crisp code for C : (no need of map/array other than freq. array)
    int n;
    cin>>n;
    vector cnt(n+1);
    for(int i=0; i>x;
    cnt[x] += 1;
    }

    int mex = 0, ok = 0;
    for(int i=0; i

  • @dharamvirsingh6422
    @dharamvirsingh6422 7 месяцев назад +1

    sir why in second question both array xor are equal

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад

      Because for repeating elements xor will become zero and remaining are same in both side

  • @codecreateriitp4751
    @codecreateriitp4751 7 месяцев назад

    ❤🧡🧡💛💛

  • @comedykhomedy
    @comedykhomedy 7 месяцев назад +1

    Today's contest was way too difficult .whatever.
    Can you tell in one sentence what is locking a solution

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +1

      Yeah, locking means final submission of your question, you can't submit more, and if you locked a question, you can try hacking codes of others for that question

  • @kumkumslab5811
    @kumkumslab5811 7 месяцев назад +1

    sir i couldn't solved the second and third
    ....
    feeling sad

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад +1

      It happens sometimes, even today's contest was relatively tough
      No need to be demotivated, keep trying, all the best 🙌🏻

  • @Dadgdyb
    @Dadgdyb 7 месяцев назад +1

    I can do only 1 problem😢😢😢😢 evertime what must i do

  • @khuntjaimin2097
    @khuntjaimin2097 7 месяцев назад +1

    what is wrong with this solution?
    void solve(){
    int n;
    cin>>n;
    vector v(n),hash(n,0);

    for(int i=0;i>v[i];
    hash[v[i]]++;
    }
    int ans=0;
    int k=2;
    for(int i=0;i

    • @pretestpassed157
      @pretestpassed157 7 месяцев назад +2

      Let's suppose, if there will be test case :
      n= 1;
      arr= [0];
      Then for above test case your code will not going to print any thing, because you are running the for loop till

    • @khuntjaimin2097
      @khuntjaimin2097 7 месяцев назад

      thank you so much @@pretestpassed157

    • @AbhinavAwasthi
      @AbhinavAwasthi  7 месяцев назад

      Yes, well explained, thanks

  • @virinchibalusani5726
    @virinchibalusani5726 6 месяцев назад +1

    Helpful