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

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 10

  • @nicspyy
    @nicspyy  3 місяці тому +2

    D's intution
    1. If Array is non decreasing then we know first value is minimum and last value is maximum and you if you perform any operation then this will lead to increase in difference between minimum and maximum value
    2. make all the non increasing subarray as non decreasing
    3. for example 1 3 can't be changed as its non decreasing, but 3 1 can became 2 2, by make any non increasing array as all equal it will make sure that minimum and maximum values are as near as possible
    4. Conclusion
    in non decreasing array minimum is first and maximum is last, and this is the best option possible
    but in non increasing array you can make all the elements as equal , thus (prefix / cnt) works

  • @manishkumar-uw5mw
    @manishkumar-uw5mw 3 місяці тому +1

    Can you give prove for D that how how both max and min be occur simultaneously for some sequence of operation??

    • @nicspyy
      @nicspyy  3 місяці тому

      u can check the comment I have explained D

  • @hunter-bf4ek
    @hunter-bf4ek 3 місяці тому +1

    nice exlplanation!! can you suggest a way to practice efficiently (stuck in pupil )

    • @nicspyy
      @nicspyy  3 місяці тому +2

      @@hunter-bf4ek thanks,
      start practicing questions rating wise like start from 1200 then do atleast 40, 50 questions of same rating, then increase the rating and repeat,
      and don't skip any contest

  • @nicspyy
    @nicspyy  3 місяці тому +1

    C solution:
    void solve(){

    int n;
    cin>>n;

    if(n == 1){

    int x = -1;
    int num = 1;
    while(x != 1){
    num = 1-num;
    cout

  • @mihs05
    @mihs05 3 місяці тому +1

    What is problem b says?
    Dont understood your explanation.
    Can you Simply elaborate plz

    • @nicspyy
      @nicspyy  3 місяці тому +2

      last figher will always win, it can't be defeated, to make it as large as possible make sure 2nd last element is as small as possible , to make 2nd last element , smallest just subtract all the elements form 0...n-3 from 2nd last element and then subtract that number from last one

  • @mridu299
    @mridu299 3 місяці тому +1

    first one here to comment.

    • @nicspyy
      @nicspyy  3 місяці тому +1

      @@mridu299 ♥️