Codeforces Round 966 (Div. 3) || Editorial for Problem A,B,C,D,E
HTML-код
- Опубликовано: 12 сен 2024
- A. Primary Task || B. Seating in a Bus || C. Numeric String Template || D. Right Left Wrong || E. Photoshoot for Gorillas
contest URL: codeforces.com...
Contact me:-
LinkedIn - / swapnil-tayal-53a5b4221
Instagram - / swapnil_tayal
#codeforces #cp #cpp #educational #EducationalCodeforces #div3 #div2 #codeforcessolutions #editorial #educationalstory #Codeforces966 #966
nice explanation bro keep it up
@@mr.kamina3364 thanks bro ✨
good explaination
thanks bro💕💕
good job
@@blackvelta1913 thanks ✨
nice explanation bhaiya
@@ashish3487 thanks bro ✨
Hey bro , could you make a video on how to get started with competitive programming? It would be great if you could also share how you manage to solve all four questions in LeetCode contests, along with tips for improving problem-solving skills and practicing effectively. If making a video isn't possible, a detailed reply would be much appreciated!
@@GAGGZz Hii,
actually I was planning to make such video from long time ago, will be releasing too, but I guess not now,
Instead we can talk on LinkedIn I will surely help you in the way I can
Ok bro
I will message you on LinkedIn
@@GAGGZz sure
Expected difficulty level of D and E?
@@Entertainmentexe D 1200, E 1400-1500
I have doubt in e can't I right bottom as min(n,i+k-1)
@@AnshGupta-cq2rr think once more like we are calculating the bottom value, not necessarily every time bottom will be in "bottom of the current cell" but can be above also
@@AnshGupta-cq2rr hope you get it 🤔
@@nicspyy sorry but I couldn't get it
@@AnshGupta-cq2rr dm on LinkedIn we will discuss
D solution:
void solve(){
int n;
cin>>n;
vi a(n);
forn(i,0,n) cin>>a[i];
string s;
cin>>s;
vector pre(n, 0);
pre[0] = a[0];
for(int i=1; i= 0) sum -= pre[i-1];
i++;
j--;
}
}
cout m >> k;
int w;
cin >> w;
vector heights(w);
for (int i = 0; i < w; ++i) {
cin >> heights[i];
}
sort(rall(heights));
vector contributions(n * m, 0);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
int top = max(0ll, i - k + 1);
int bottom = min(n - k, i);
int left = max(0ll, j - k + 1);
int right = min(m - k, j);
// cout