Educational Codeforces Round 169 | Video Solutions - A to D | by Abhinav Kumar | TLE Eliminators

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

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

  • @TLE_Eliminators
    @TLE_Eliminators  4 месяца назад

    Please fill the Feedback form for PCD: forms.gle/RQ7jiZvgqU8NXK1a6

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

    Great explanation!!

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

    🔥🔥🔥

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

    In problem - c
    Why line83 if(n%2) ans+=a[n+1];
    Came after
    Line82 ans=max(ans-k,0LL);
    Test case:
    3 k=1
    4 4 1
    In this solution it is mentioned about an odd case but unable to figure it out through what basis from that question this an odd case is generated.

  • @udaytripathi623
    @udaytripathi623 3 месяца назад

    Hi,
    Regarding Problem D,
    Can anyone explain why did we considered only the 'i' from query for calculating 'l' and 'r', do we not need the index which is just greater than 'j'? If so why?

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

    Sir when will the TLE 12.0 will be launched. can u please give me the expected month of launching 12.0 plz. consider this comment🙏🙏🙏🙏

  • @AnkitRaj-ux7lv
    @AnkitRaj-ux7lv 4 месяца назад +1

    Sir can I solve D without graph concept ????????

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

      yes

    • @surajmishra6900
      @surajmishra6900 4 месяца назад

      yes, it's easily solvable using binary search

    • @shubh625
      @shubh625 4 месяца назад

      @@faiqueibrahimi6359 ok

    • @akshatsharma5426
      @akshatsharma5426 4 месяца назад

      yup this is how I solved it using binary search
      #include
      #include
      #include
      #include
      #include
      #include
      #include
      #include
      #include
      #define ll long long int
      using namespace std;
      int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      int t=1;
      cin>>t;
      while(t--){
      int n,q;
      cin>>n>>q;
      //mapm;
      mapm;
      vectorv(n+1);
      for(int i=1;i>v[i];
      m[v[i]].push_back(i);
      //m[v[i][0]].push_back(i);
      //m[v[i][1]].push_back(i);
      }
      //vectorans
      while(q--){
      int a,b;
      cin>>a>>b;
      int x=min(a,b);
      int y=max(a,b);
      if(v[x][0]==v[y][0] || v[x][1]==v[y][1] || v[x][0]==v[y][1] || v[x][1]==v[y][0]){
      cout