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

Поделиться
HTML-код
  • Опубликовано: 29 апр 2024
  • A. Contest Proposal || B. Coin Games || C. Permutation Counting || D1. Reverse Card
    contest URL: codeforces.com/contest/1972
    Contact me:-
    LinkedIn - / swapnil-tayal-53a5b4221
    Instagram - / swapnil_tayal
    #codeforces #cp #cpp #educational #EducationalCodeforces #div2 #codeforcessolutions #editorial #educational #Codeforces942 #942

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

  • @spidermorgan03
    @spidermorgan03 22 дня назад

    Great explanation for problem C. I saw a lot of explanations, but yours was the only one that I actually understood. Thank you so much!

  • @nicspyy
    @nicspyy  Месяц назад +2

    C solution:
    void solve(){

    int n,k;
    cin>>n>>k;

    vi a(n);
    forn(i,0,n) cin>>a[i];
    sort(all(a));

    int maxi = a[0];
    for(int i=1; i

  • @paras6079
    @paras6079 Месяц назад +1

    21:48
    bro can you please clarify that how including 5 at end will make it permutation and contribute to the answer

    • @nicspyy
      @nicspyy  Месяц назад +1

      got it, the extra number must have freq greater than maxi, as you can also see in the code, that i am incriminating the ans for each number whose freq is greater then maxi,
      and let's suppose 5 is the number with more freq than maxi, so by creating seq from starting in such a way that after adding 5 in the end will increase the one more permutation,
      not for the case of only 5, like many numbers have more freq than maxi, and hypothetical you will permutation in such a way that after adding that numbers in end will contribute to the number of final permutations.
      HOPE IT HELPS ✌️

    • @paras6079
      @paras6079 Месяц назад +1

      @@nicspyy ooh got it
      thank u

    • @nicspyy
      @nicspyy  Месяц назад +1

      @@paras6079 welcome 😁

  • @mohamedtamer9041
    @mohamedtamer9041 Месяц назад +1

    amazing keep going

    • @nicspyy
      @nicspyy  Месяц назад +1

      thanks bro❤❤

  • @OnlyAyushAgarwal
    @OnlyAyushAgarwal Месяц назад +2

    Nice

    • @nicspyy
      @nicspyy  Месяц назад +1

      thanks, bro❤❤

  • @harikrushnasuhagiya3925
    @harikrushnasuhagiya3925 Месяц назад

    Thanks Bro

  • @PrashanthKumar-qb6im
    @PrashanthKumar-qb6im Месяц назад +2

    hey , whats your codeforces profile ?

    • @nicspyy
      @nicspyy  Месяц назад +1

      i will tell once i am expert 🥲✌️

    • @ahmedelkhouly8671
      @ahmedelkhouly8671 Месяц назад +1

      @@nicspyy
      how you can solve these problems and still not expert??
      you at least Master ?

    • @nicspyy
      @nicspyy  Месяц назад +4

      @@ahmedelkhouly8671 solving doesn't matter, solving faster than other matters