Codeforces Round 882 Div 2 | A B C | Video Editorial C++

  Рет қаралды 2,046

cpwithcpp

cpwithcpp

Күн бұрын

Пікірлер: 16
@jumaelahmed9995
@jumaelahmed9995 Жыл бұрын
Please keep make videos after every contest.
@alfahimbin7161
@alfahimbin7161 Жыл бұрын
What do we mean by removing k-1 values in problem A. We will keep those k-1 values in individual groups right?
@codingalley6229
@codingalley6229 Жыл бұрын
yes
@cpwithcpp
@cpwithcpp Жыл бұрын
Consider that all adjacent elements have some links between them. Now each of those links will be contributing some value. If I remove one link the array will break into 2 parts. If I remove two links the array will break in to 3 parts and so on. So to have k parts in the final array I need to remove k - 1 links from them. And all the remaining links will be contributing some value to my answer. So it is optimal to remove the greatest k - 1 links.
@muhammadosamafahim7019
@muhammadosamafahim7019 Жыл бұрын
@@cpwithcpp Sir, it is mentioned regarding contiguous subgroups , so sorting the array or only getting the first k minimums would destroy the contiguous subarray nature won't it ? apart from that the question is clear but I am unable to get this part only intuitively Thankyou
@muhammadosamafahim7019
@muhammadosamafahim7019 Жыл бұрын
sir beautiful explanation of all the questions
@x_x3557
@x_x3557 Жыл бұрын
after obtaining a1, if we choose a4 and a5 we get (a1, a4, a5) and we cannot obtain this in only 2 operations? Is this correct or am I missing out something?
@cpwithcpp
@cpwithcpp Жыл бұрын
Please mention the question and the timestamp you are talking about.
@x_x3557
@x_x3557 Жыл бұрын
@@cpwithcpp Problem C. 19:04. For the example below, If we perform the operations in the following sequence: i=4, i=2, i=3, the final xor obtained will be c, e, f which is not contiguous. How is this possible? [a, b, c, d, e, f] (e, f) (c, d, e, f), (e, f) (d, e, f), (c, d, e, f), (e, f) final xor = c, e, f
@zeroanims4113
@zeroanims4113 Жыл бұрын
@@x_x3557 no i=3 should be = (d, e, f), (e, f), (c, d, e, f), (e, f) = c (u missed (e, f)) it should always be contiguous
@shankar1050
@shankar1050 Жыл бұрын
but 2 xor 5 is 7 which contradicts your statement at 16:28
@cpwithcpp
@cpwithcpp Жыл бұрын
Wrong choice of words. I meant to say the there will be no new bit introduced. That is why if we have 8 bits we are considering the maximum possible value with 8 bits and that is 256. I wanted to say that no new greater number can be formed in terms of new bits. I did not frame the sentence correctly there.
@shankar1050
@shankar1050 Жыл бұрын
@@cpwithcpp got it
@shankar1050
@shankar1050 Жыл бұрын
thankyou for responding
@CristianoRonaldo-ku1uz
@CristianoRonaldo-ku1uz Жыл бұрын
Can you help me with my code. Where does it fails and what should I update in code? #include using namespace std; typedef long long ll; #define V vector #define pb push_back #define pi pair #define forl(var,str,end) for(long long int var=str; var>t; while(t--) { ll n; cin>>n; ll a[n]; forl(i,0,n){ cin>>a[i]; } ll ans = a[0]; forl(i,1,n){ ans = (ans&a[i]); } if(ans!=0) cout
@MilanNakum
@MilanNakum Жыл бұрын
Do not have to sort the array
Codeforces Round 976 (Div 2) | Video Solutions - A to E | by Gaurish Baliga | TLE Eliminators
1:27:45
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 99 МЛН
I tricked MrBeast into giving me his channel
00:58
Jesser
Рет қаралды 24 МЛН
Sigma baby, you've conquered soap! 😲😮‍💨 LeoNata family #shorts
00:37
Codeforces Round 878 Div 3 | A B C D E | Video Editorial C++
41:41
Codeforces Round 882 Div 2| Video Solutions - A to D | by Sayeef | TLE Eliminators
1:11:53
TLE Eliminators - by Priyansh
Рет қаралды 3,1 М.
Viral Video of a Man's Crazy Job Interview
16:02
Darryl Vega TV
Рет қаралды 1,5 МЛН
Animation vs. Math
14:03
Alan Becker
Рет қаралды 72 МЛН
CF 882 (Div2) with commentary
2:18:43
umnik_team
Рет қаралды 3,2 М.
Codeforces Round 867 Div 3 | A B C D E G1 | Video Editorial C++
39:51
Codeforces Round 941 (Div 2)| Video Solutions - A to D | by Ankit Ghildiyal | TLE Eliminators
58:08
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 99 МЛН