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
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!
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
21:48
bro can you please clarify that how including 5 at end will make it permutation and contribute to the answer
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 ✌️
@@nicspyy ooh got it
thank u
@@paras6079 welcome 😁
amazing keep going
thanks bro❤❤
Nice
thanks, bro❤❤
Thanks Bro
hey , whats your codeforces profile ?
i will tell once i am expert 🥲✌️
@@nicspyy
how you can solve these problems and still not expert??
you at least Master ?
@@ahmedelkhouly8671 solving doesn't matter, solving faster than other matters