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

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

X AlphA - Hard Algorithms

X AlphA - Hard Algorithms

Күн бұрын

Пікірлер: 7
@cp_with_vkd
@cp_with_vkd 4 ай бұрын
Problem C video solution (cat, fox and double maximum) : kzbin.info/www/bejne/jHTUdot4q92Liqcsi=9obFRxs5jW8LnrNk
@bishwashkumarsah171
@bishwashkumarsah171 4 ай бұрын
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 4 ай бұрын
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 4 ай бұрын
@@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 4 ай бұрын
@@cp_with_vkd good job thank you
@questions-answered
@questions-answered 4 ай бұрын
thanks
@gautambaranwal445
@gautambaranwal445 4 ай бұрын
Thanks.. :)
Hans Trashtalks Hikaru, Gets Absolutely DESTROYED
9:49
TightKnights
Рет қаралды 1,1 МЛН
How to win a argument
9:28
ajaxkmr
Рет қаралды 560 М.
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 99 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 21 МЛН
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 11 МЛН
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 21 МЛН
Fabiano Caruana Ranks The Best Olympiad Teams!!
18:52
C-Squared
Рет қаралды 191 М.
first Codeforces round in 2 years (Round 973)
1:39:57
William Lin PP
Рет қаралды 16 М.
D is for Destruction!!
13:25
agadmator's Chess Channel
Рет қаралды 108 М.
A. Chess For Three
8:45
marioumaCoding
Рет қаралды 102
Is Computer Science still worth it?
20:08
NeetCodeIO
Рет қаралды 222 М.
Codeforces Round 829 Div 2 | Problem D : Factorial Divisibility Solution | Explanation+Code | Hindi
26:07
Codeforces Round 947 (Div. 1 + Div. 2) A-C Explanation
22:54
X AlphA - Hard Algorithms
Рет қаралды 874
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 99 МЛН