Codeforces Round 793 (Div-2) | Solutions | A-B-C-D

  Рет қаралды 5,471

Naman Bansal

Naman Bansal

Күн бұрын

Codeforces: codeforces.com...
LinkedIn: / namanbansal013
Instagram: / namanbansal013

Пікірлер: 21
@pratickbhowmick6409
@pratickbhowmick6409 2 жыл бұрын
Thank you for the explanation of B.
@abhisheksingh767
@abhisheksingh767 2 жыл бұрын
Please make discord server, people will be easily get notified when you are streaming.
@giaok-p1y
@giaok-p1y Жыл бұрын
genious
@aryanjoshi8144
@aryanjoshi8144 2 жыл бұрын
thank thank thank 😊you so much
@TECHADVICETEAM
@TECHADVICETEAM 2 жыл бұрын
In B Why are we not takinh help from elements which are in sorted place? There might be chance that they can help to make X greater
@rajatsingh9537
@rajatsingh9537 2 жыл бұрын
because we are performing and operation and while performing and if any bit is 0 the in X it will always be 0 hence it will not be the maximum X
@TECHADVICETEAM
@TECHADVICETEAM 2 жыл бұрын
@@rajatsingh9537 ok got it
@rachitagrawal5068
@rachitagrawal5068 2 жыл бұрын
Thanks for explaining D :)
@gauravchhetri6441
@gauravchhetri6441 7 ай бұрын
aww he looks so cute .. :
@ayushanandtripathi352
@ayushanandtripathi352 2 жыл бұрын
for (int i = 1; i < int(ones.size()); i++) { std::cout
@Mutant23
@Mutant23 2 жыл бұрын
this is basically connecting last even edges root to all the other remaining roots as one[0] is the first odd edge root and one[0]-1 is the first even edge root and +n is done just for the modulo thing. suppose the string is 01001 then you will connect the first 0 with other remaining zeroes which comes before 1 so basically you will connect the (1-1)+1 --> with (4-1)+1
@cheforces4053
@cheforces4053 2 жыл бұрын
sombody explain how B is done ex - 0 1 2 3 6 5 4 8 7 4&6 is clearly not equal to 4&6&8&7
@divakarchouhan612
@divakarchouhan612 2 жыл бұрын
Basically, we have to sort the array and have to find the maximum X and the only way of sorting is if a[i]&a[j]=X. suppose the array is 1 2 3 6 4 5. Now the element 6,4 and 5 are in the wrong positions so to sort them we have to swap them but to put 4 in the correct position we have to swap 4 and 6 and 4&6=x1 now to put 5 and 6 to their correct position we have to swap them i.e 5&6=x2. as we know x1 may or may not be the same. But we want a single value of X and it must be maximum so basically, to find the maximum value of x we have to calculate the '&' of all the elements that are in their wrong positions i.e ans=6&4&5.
@cheforces4053
@cheforces4053 2 жыл бұрын
@@divakarchouhan612 yeah thanks man
@ashfaqurrahmanpapon8364
@ashfaqurrahmanpapon8364 2 жыл бұрын
problem no:C n-5:: 2 2 3 4 4 how it possible?
@vardhmanjain1630
@vardhmanjain1630 2 жыл бұрын
arr = 2 4 3 4 2 , ans = 3 , both side 2,3,4
@divakarchouhan612
@divakarchouhan612 2 жыл бұрын
Problem no C: Can anyone explain how this test case will give the correct answer for the above approach The test case is: n=7 2 2 5 5 7 6 4 According to my understanding of the explained logic, the answer will be 4 i.e. 2 repeating elements and 2 elements whose freq. is 1 whereas the correct answer will be 3. Can anyone explain?
@yathinrasineni9089
@yathinrasineni9089 2 жыл бұрын
2 4 5 7 6 5 2
@divakarchouhan612
@divakarchouhan612 2 жыл бұрын
Thanx a lot I got it.
Codeforces Round 802 (Div-2) | Solutions | A-B-C-D
47:36
Naman Bansal
Рет қаралды 9 М.
Codeforces Round 793 Div 2 B: AND Sorting - Bit Manipulation
13:51
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 68 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 14 МЛН
Codeforces Round 781 (Div-2) | Solutions | A-B-C
33:35
Naman Bansal
Рет қаралды 3,5 М.
TypeDB Forces 2023 (Div-1 +) Div-2 | Solutions
1:00:47
Naman Bansal
Рет қаралды 5 М.
Educational Codeforces Round 127 (Div-2) | Solutions | A-B-C-D
48:15
Codeforces Round #858 (Div-2) | Solutions | A-B-C-E
42:35
Naman Bansal
Рет қаралды 2,9 М.
Codeforces Round 786 (Div-3) | Solutions | A-B-C-D-E-F
1:07:25
Naman Bansal
Рет қаралды 4,8 М.
Codeforces Round 887 Div 2 | A B | Video Editorial C++
18:58
cpwithcpp
Рет қаралды 3,4 М.
how to study less and get higher grades
11:16
Gohar Khan
Рет қаралды 702 М.
Codeforces Round 785 (Div-2) | Solutions | A-B-C-D
1:09:38
Naman Bansal
Рет қаралды 4,3 М.
Educational Codeforces Round 129 (Div-2) | Solutions | A-B-C-D
1:11:45
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56