Codeforces Round 948 (Div. 2) || Editorial for Problem A,B,C

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

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

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

    Thank you so much Nicspyy for posting these helpful explanations ❤️

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

      It's my pleasure

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

    In C, why the answer for explained testcase is not 5 for the subsequence -> 3 2 10 20 1
    LCM is 60, which is not present.

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

      60 is there

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

    It would be better if the volume was a bit higher.

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

      will try to speak much louder from next time 😉

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

    I would be lost if I didn’t have your help 🙇‍♂️

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

      thank you for the compliment 😊

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

    Bhaiya, I want to ask How will we get intuition behind finding whole array LCM and then finding all divisors of that and all those divisors which are not present in the array finding their LCM and and then checking again whether that LCM is present in array or not and if not taking maxLength as answer.

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

      non-present divisors is the candidate which can generate a number of his multiple not in the array, because main goal is the lcm of selected text must not present, and that number can generate as its not there in array at the first place

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

    Your chrome theme name pls ?

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

      you can try searching "colors" on the web themes

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

    B solution:
    void solve(){
    int n;
    cin>>n;
    int m = n;
    vi a(32, 0);
    forn(i,0,32){
    a[i] = m%2;
    m /= 2;
    }
    forn(i,0,32){
    if(a[i] == 1 and a[i+1] == 1){
    a[i] = -1;
    i++;
    while(a[i] == 1) a[i++] = 0;
    a[i] = 1;
    i--;
    }
    }
    int ind = 31;
    while(a[ind] == 0) ind--;
    cout

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

    I managed to scrape a 1984 MS solution for C -> 15 MS away from TLE LOL

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

      great 👍❤

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

    what is ur rating?

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

      Less than an expert, 😊

    • @manishkumar-uw5mw
      @manishkumar-uw5mw 7 месяцев назад +2

      ​@@nicspyywhy don't give u codeforces I'd....so that it can help us

    • @Abc-lr4bf
      @Abc-lr4bf 7 месяцев назад +3

      @@manishkumar-uw5mw +1

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

      @@manishkumar-uw5mw help in what manner 🙃🤔

    • @manishkumar-uw5mw
      @manishkumar-uw5mw 7 месяцев назад +1

      @@nicspyy like looking soln help to understand thinking approach

  • @KhushalMidha-be6jc
    @KhushalMidha-be6jc 7 месяцев назад +1

    1 4
    3 8889 14815 44445 getting error on this test case i had implemented your logic

    • @KhushalMidha-be6jc
      @KhushalMidha-be6jc 7 месяцев назад

      here is my code int n;
      cin>>n;
      vectora(n);
      sets;
      ll lcm=1;
      mapm;
      for (int i = 0; i < n; i++)
      {
      cin>>a[i];
      s.insert(a[i]);
      lcm=(lcm*a[i])/__gcd(lcm,a[i]);
      m[a[i]]++;
      }
      if(s.find(lcm)==s.end()){
      cout

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

      bro taking reference from the code

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

      same bro according to his logic this test case fails

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

      ​@@BombSquadHindiTipsTricks send submission link