A. Chess For Three (Explanation) - Codeforces Round 945 (Div. 2)

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

X AlphA - Hard Algorithms

X AlphA - Hard Algorithms

Күн бұрын

Пікірлер: 7
@cp_with_vkd
@cp_with_vkd 7 ай бұрын
Problem C video solution (cat, fox and double maximum) : kzbin.info/www/bejne/jHTUdot4q92Liqcsi=9obFRxs5jW8LnrNk
@bishwashkumarsah171
@bishwashkumarsah171 7 ай бұрын
other youtubers were just using the one liner but i couldnot understand that. ans = min(p1+p2,(p1+p2+p3)//2). can you explain this solution too that is in the editorial. Nice sol
@cp_with_vkd
@cp_with_vkd 7 ай бұрын
If you want the explanation for the O(1) solution, it goes like this: As, we are always increasing p1+p2+p3 by 2 (1,1 in case of draw and 2,0 in case of win), the invariant is pretty clear, i.e.., (p1+p2+p3)%2=0 for a valid game. Now, we have p1≤p2≤p3, so we can always have atleast p1 draws. Thus, from p2 and p3, we have to remove p1 points, leaving us with p2+p3−p1 points. Obviously, in the most optimal case, we could have (p2+p3−p1)/2 more draws (if we had equal points left for both), but this is not necessarily the case as it is possible that p2
@dipteshraj9169
@dipteshraj9169 7 ай бұрын
@@cp_with_vkd Absolutely awesome , Now I got it... couldn't understood this o(1) approach by watchinng other yt videos on internet
@TruongBao-z5k
@TruongBao-z5k 7 ай бұрын
@@cp_with_vkd good job thank you
@shankdubs
@shankdubs 7 ай бұрын
thanks
@gautambaranwal445
@gautambaranwal445 7 ай бұрын
Thanks.. :)
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 2,4 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 118 М.
Coding in a Random Programming Language Everyday (Huge Mistake)
17:17
A. Chess For Three
8:45
marioumaCoding
Рет қаралды 118
D . Counting Pairs | Codeforces Round 995 (Div. 3) | Solution in Bangla
17:37
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 122 М.
Jagged Swaps | Codeforces | TLE's CP31 | 800 Rated | Q-5
14:19
Kathan Vakharia
Рет қаралды 2,8 М.
B. Substring and Subsequence - Educational Codeforces Round 167
8:09
X AlphA - Hard Algorithms
Рет қаралды 1,1 М.
I made maps that show time instead of space
10:44
Václav Volhejn
Рет қаралды 1 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН