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

Поделиться
HTML-код
  • Опубликовано: 16 май 2024
  • A. Chess For Three || B. Cat, Fox and the Lonely Array || C. Cat, Fox and Double Maximum
    contest URL: codeforces.com/contest/1973
    Contact me:-
    LinkedIn - / swapnil-tayal-53a5b4221
    Instagram - / swapnil_tayal
    #codeforces #cp #cpp #educational #EducationalCodeforces #div2 #codeforcessolutions #editorial #educational #Codeforces945 #945

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

  • @sabaokangan
    @sabaokangan 13 дней назад

    Thank you for solving division 2 problems. Praying we can do division 1 one day 🙇‍♂️

  • @manishkumar-uw5mw
    @manishkumar-uw5mw 19 дней назад

    Mic on the pen 🖊️....nice effort bro

  • @lakshyasharma3723
    @lakshyasharma3723 21 день назад +2

    Nice Explanation bro.

    • @nicspyy
      @nicspyy  21 день назад +2

      Thank you 🙂

  • @sdmfslkdm
    @sdmfslkdm 21 день назад +2

    bhai how did you get the intution of the fact that ans of k is monotonic ?

    • @nicspyy
      @nicspyy  20 дней назад +1

      I didn't understand the context of K begin monotonic here

  • @nicspyy
    @nicspyy  21 день назад +2

    B solution:
    void opr(vi &val, int x, int g){
    int i = 0;
    while(x > 0){
    if(g) val[i] += (x%2);
    else val[i] -= (x%2);
    x /= 2;
    i++;
    }
    }

    bool f(vi &arr, int n, int k) {

    int i = 0;
    int j = 0;
    vector val(64, 0);
    set st;

    while(j < n){

    opr(val, arr[j], 1);
    if(j-i+1 < k){
    j++;
    }else{

    vector newVal;
    for(auto &k: val){
    if(k) newVal.pb(1);
    else newVal.pb(0);
    }

    st.insert(newVal);
    opr(val, arr[i], 0);
    i++;
    j++;
    }
    }
    return (st.size() == 1);
    }

    void solve(){

    int n;
    cin >> n;
    vi arr(n);
    forn(i,0,n) cin>>arr[i];

    int l = 1;
    int r = n;
    int ans = n;

    // cout

  • @Entertainmentexe
    @Entertainmentexe 20 дней назад +2

    was problem a bit harder than usual?

    • @nicspyy
      @nicspyy  20 дней назад +1

      A was 😂, B and C was fine I guess

  • @bishwashkumarsah171
    @bishwashkumarsah171 21 день назад +2

    problem A?

    • @nicspyy
      @nicspyy  20 дней назад +2

      B and C took 30min plus time so I remove it 🥲