A-E Codeforces Round 938 Div 3 | Long Inversions | Inaccurate Subsequence Search | Abhinav Awasthi

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

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

  • @AbhinavAwasthi
    @AbhinavAwasthi  6 หลายเดือนก่อน +3

    Visit coding75.com

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

      sir website not working!!

  • @code37official
    @code37official 25 วันที่ผ่านมา

    problem E can be simplified
    just keep a variable cnt which will be storing active flips
    how ?
    just increase cnt when you insert into set and decrease it when you reach that index
    if cnt is odd , it means at current index flip is going to happen
    if cnt is even it means the there is no need to flip
    code :
    void
    solve ()
    {
    int n ;
    cin >> n ;
    string s ;
    cin >> s ;
    int ans = 0 ;
    for (int i = n ; i >= 1 ; i--)
    {
    string temp = s ;
    set st ;
    int cnt = 0 ;
    for (int j = 0 ; j < n ; j++)
    {
    if (cnt & 1)
    {
    if (temp[j] == '0') temp[j] = '1' ;
    else temp[j] = '0' ;
    }
    char curr = temp[j] ;
    if (curr == '0' && j + i - 1 < n)
    {
    cnt++ ;
    temp[j] = '1' ;
    st.insert(j+i-1) ;
    }
    if (st.find(j) != st.end()) cnt-- ;
    }
    bool flag = true ;
    fl(j,n)
    {
    if (temp[j] == '0') flag = false ;
    }
    if (flag)
    {
    ans = i ;
    break ;
    }
    }
    cout

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

    IN PROBLEM C, WHY HOW YOU GET THE IDEA OF SUM>K,THEN ALL THE SHIPS WILL BE DESTROYED AND IF SUM

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

      if number of attacks is greater than the total health of all ships then obviously all ships will be destroyed regardless of the order

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

      N-1 because we know lb1 and lb2 are at same ship, means all other ships are destroyed, we have to just check for that one ship

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

    what might be the rating of the Problems, c d e in your opinion?

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

      Around specialist to expert

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

    Is it okay to say that we dont need m1 map for D question because it is not used in any conditional statements or in any increment of ans?

  • @GauravDuseja-t6q
    @GauravDuseja-t6q 6 หลายเดือนก่อน +1

    How sir you think implementation of d problem for me its very difficult

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

      Keep trying, you will also improve your problem solving skills

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

    can anyone tell me why when i used dequeue in C ques it gave me TLE?

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

      k upto 1e15 that's why

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

      can you send your code

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

      ​@@AbhinavAwasthi #include
      using namespace std;
      void solve() {
      int n, k;
      cin >> n >> k;
      deque q;
      for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      q.push_back(a);
      }
      int f = 0;
      while (k > 0&&!q.empty()) {
      if (f == 0) {
      int a = q.front();
      q.pop_front();
      a--;
      if (a > 0)
      q.push_front(a);
      f = 1;
      k--;
      } else {
      int a = q.back();
      q.pop_back();
      a--;
      if (a > 0)
      q.push_back(a);
      f = 0;
      k--;
      }
      }
      cout t;
      while (t--) {
      solve();
      }
      return 0;
      }

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

    Amazing channel with amazing tutor

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

      Glad you think so!

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

    Great explanation 🎉

  • @dumpster-jackson
    @dumpster-jackson 6 หลายเดือนก่อน +1

    I could solve first 2 ques
    A and B in 1 hour, what will my rating be?

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

      Can't say, may be pupil or 1100

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

      Can say, can be pupil or 1100

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

      .

    • @dumpster-jackson
      @dumpster-jackson 6 หลายเดือนก่อน +1

      @@AbhinavAwasthi Thanks. It was my second contest, my rating increased from 400 to 600 lol

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

      in any division if you able to solve A and B in 1 hr...then your rating would be around 1000-1100 not greater than 1100 at any cost bro

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

    sir why CP Sheet website not working??

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

      it's working from my side, what's the problem you are facing? please fill the feedback form in case of any problem

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

      I don't know sir why i can't access the website.Its reload and show website not found. I tried with my laptop and phone, and also with some friends but they are also facing the same things

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

      @@karnelchakma3498 can you send screenshot on telegram? Also the site url you are using

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

      @@karnelchakma3498 WhatsApp me here: 9956217210

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

      @@AbhinavAwasthi sir i checked with VPN, it's working now. Sir I am from Bangladesh 🇧🇩

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

    bhai kya kar rha hai again problem e kuch samajh nhi aaya
    please explain not upload video for views

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

      so sorry, may be i was little fast in this video, will improve this for sure

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

    Great explanation!

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

    True legend❤❤

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

      Thanks ❤

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

      ​@@AbhinavAwasthi Apne code chef ke solutions nhi banaye?

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

      Was travelling last week

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

    Sir in your website there is an issue kindly fix it

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

      Please tell

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

      @@AbhinavAwasthi Sir while solving cp sheet i found that when i click on next page of question and click the question then it will back to the previous page

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

      @@adarshsinghparihar7321 hey, we are fixing this issue, will be done by today

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

    Helpful ❤

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

    sir please improve the flow of explaining the logic and also do some dry run

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

      Sure, thanks for suggesting, will work on it

    • @VISHALSHARMA-nf7kl
      @VISHALSHARMA-nf7kl 6 หลายเดือนก่อน

      ​@@AbhinavAwasthipls do not directly jump on the implementation, first explain the logic, so that we can try implementing on our own.

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

      he used to do that ...but nowadays i think he is getting busy...he making the logical part of problerm little less, the way he explains is really amazing ...

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

    helpful

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

    i have just answered the A problem and ans got accepted , mujhe kuch raating milega kya?

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

      No, only for during contest

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

      @@AbhinavAwasthi yes i answered during the contest

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

    ❤❤❤❤

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

    your volume is low

  • @rajkansagra2208
    @rajkansagra2208 6 หลายเดือนก่อน +3

    worst explaination ever seen. dont explain code bro, just explain logic.

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

      Getting very bad reviews for this video 🥲 sorry

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

      @@AbhinavAwasthi its okay, improve next time

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

    For the problem c why is this code giving wa?
    #include
    using namespace std;
    int main(){
    int t;
    cin>>t;
    for(int i=0;i>n>>k;
    long long a[n];
    for(int j=0;j>a[j];
    }
    int start=0,end=n-1;
    while(start

    • @YangKai-yj9bk
      @YangKai-yj9bk 6 หลายเดือนก่อน

      Because it was alternate but in your implementation, you first remove first index then last but it should be that first index -1 then last-1 then first -2... Urs is doing first -first, last -last....

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

      @@YangKai-yj9bk yeah, I am decrementing the first index by 1 and then the last index by 1 until the element at the particular index disappears. It is being decremented like mentioned in the question.

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

      Try to have a dry run

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

      Try to have a dry run

    • @YangKai-yj9bk
      @YangKai-yj9bk 6 หลายเดือนก่อน

      @@AbhinavAwasthi yeah The thing he is lacking mainly is that whenever start gets 0 then he just goes to next start instead of decreasing the next start by 1.similar for the end