Good Bye 2024: 2025 is NEAR || Editorial for Problem A,B,C,D

  Рет қаралды 1,286

NICspy

NICspy

Күн бұрын

Пікірлер: 18
@sashibhushanarajput1194
@sashibhushanarajput1194 2 күн бұрын
I am the 1000th subscriber. Hope to see more of your content. Keep going buddy !!!
@nicspyy
@nicspyy 2 күн бұрын
@@sashibhushanarajput1194 🎊🎊🎊🎊🎉🎉🎉🎉 thanks buddy
@ananyerawat-m6f
@ananyerawat-m6f 6 күн бұрын
6:46 it should be 0110.
@nicspyy
@nicspyy 5 күн бұрын
rigth
@mohdkashif9830
@mohdkashif9830 6 күн бұрын
thanks a lot bro well explained!!
@nicspyy
@nicspyy 6 күн бұрын
@@mohdkashif9830 thanks
@kushwanthaddepalli5236
@kushwanthaddepalli5236 6 күн бұрын
Nice explanation. Thanks bhai!
@nicspyy
@nicspyy 5 күн бұрын
thanks
@barman1734
@barman1734 6 күн бұрын
How did the formula for C came ??? Dont call a "reading out" of solution an editorial.
@nicspyy
@nicspyy 5 күн бұрын
I am not denying that proof is not there, but during contest I saw this pattern, so didn't aimed for finding proof also
@theslimeoxidizer3308
@theslimeoxidizer3308 6 күн бұрын
brother youre doing really great . how can we perform good in contests
@nicspyy
@nicspyy 6 күн бұрын
@@theslimeoxidizer3308 it's just "not giving up on a question to early" maybe 🤔
@_hacker-rz2pk
@_hacker-rz2pk 6 күн бұрын
nice work brother
@nicspyy
@nicspyy 6 күн бұрын
@@_hacker-rz2pk thanks
@suryxnz
@suryxnz 6 күн бұрын
Great explanation brother
@nicspyy
@nicspyy 6 күн бұрын
@@suryxnz thanks
@nicspyy
@nicspyy 6 күн бұрын
please see this image for c's case with k==2 drive.google.com/file/d/1YTUALw1qMOlqAcJeX4855HkIq0pgIqXU/view?usp=sharing B solution: void solve() { int n; cin>>n; map mp; vpp a(n); set st; forn(i,0,n){ cin>>a[i].ff; cin>>a[i].ss; if(a[i].ff == a[i].ss){ st.insert(a[i].ff); mp[a[i].ff]++; } } vi temp (all(st)); vector ans(n); for(int i=0; i 1){ ans[i] = 0; }else{ ans[i] = 1; } }else{ int ind1 = lower_bound(all(temp), a[i].ff) - temp.begin(); int ind2 = lower_bound(all(temp), a[i].ss) - temp.begin(); if(ind1 != temp.size() and ind2 != temp.size() and temp[ind1] == a[i].ff and temp[ind2] == a[i].ss and ind2-ind1+1 == a[i].ss - a[i].ff + 1 ){ ans[i] = 0; }else{ ans[i] = 1; } } } for(auto i: ans){ coutk; cout q; vector v1 , v2; for(int i = 0 ; i < n ; i ++ ){ cin >> a[i]; v1.pb(a[i]); } for(int i = 0 ; i < n ; i ++ ){ cin >> b[i]; v2.pb(b[i]); } sort(v1.begin() , v1.end()); sort(v2.begin() , v2.end()); map lastA , lastB , cntA , cntB; int res = 1; for(int i = 0 ; i < n ; i ++ ){ lastA[v1[i]] = i; lastB[v2[i]] = i; cntA[v1[i]] ++ ; cntB[v2[i]] ++ ; res = res * min(v1[i] , v2[i]); res = res % mod; } vector ans; ans.pb(res); while(q--){ int type, ind; cin>>type>>ind; ind-- ; if(type == 1){ int x = a[ind]; int i = lastA[x]; cntA[x]--; if(cntA[x] == 0) lastA[x] = -1; else lastA[x]--; res = (res * powmod(min(v1[i] , v2[i]) , mod-2)) % mod; v1[i]++; a[ind]++; cntA[v1[i]]++; if(cntA[v1[i]] == 1) lastA[a[ind]] = i; res = res*min(v1[i] , v2[i]); res %= mod; } else{ int x = b[ind]; int i = lastB[x]; cntB[x] -- ; if(cntB[x] == 0) lastB[x] = 0; else lastB[x] -- ; res = res * powmod(min(v1[i] , v2[i]) , mod - 2) % mod; v2[i]++; b[ind]++; cntB[v2[i]]++; if(cntB[v2[i]] == 1) lastB[b[ind]] = i; res = res *min(v1[i] , v2[i]); res %= mod; } ans.pb(res); } for(auto x : ans) cout
Winning Facebook (Meta) Hacker Cup Qual Round 2022?
53:55
Neal Wu
Рет қаралды 2,6 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Journey to become Grandmaster | 2800+ on CF ft. Dominator069
1:06:40
Codeforces Good Bye 2024 | Video Solutions - A to E | by Pradyumn Kejriwal | TLE Eliminators
2:31:50
You are doing Codeforces Wrong way  🤔😱 || Codeforces
6:09
Winning Google Kickstart Round A 2020 + Facecam
17:10
William Lin (tmwilliamlin168)
Рет қаралды 10 МЛН
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 144 М.
How He Got $600,000 Data Engineer Job
19:08
Sundas Khalid
Рет қаралды 192 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН