■A - Zero Sum Game
難読総和*-1
■B - Commencement
mapで適当に
■C - Airport Code
耳dp
■D - Divide Interval
セグ木
■E - Weighted Tic-Tac-Toe
難実装
■F - Subsequence LCM
O(4^n)のdp
高速ゼータして高速メビウスでもOK
■G - Palindrome Construction
manacher
ABC348
■A - Penalty Kick
はい
■B - Farthest Point
はい
■C - Colorful Beans
map
■D - Medicines on Grid
priority_queue
■E - Minimize Sum of Distances
全方位
■F - Oddly Similar
bitset高速化
■G - Max (Sum - Max)
知らん
ARC174
■A - A Multiply
累積和
■B - Bought Review
賄賂のパターンは3通り
■C - Catastrophic Roulette
dp[i] = p0 * dp[i-1] +p1*(1+dp[i-1])+p2*(1 +dp[i]) + p3*(dp[i-2])
■D - Digit vs Square Root
実験
■E - Existence Counting
上手に数え上げ
ABC345
■A - Leftrightarrow
作れ
■B - Integer Division Returns
やれ
■C - One Time Swap
s[i]!=s[j]な数と
s[i] == s[j]なものが存在するか
■D - Tiling
左上からおいていく
未使用のものをbitで管理
■E - Colorful Subsequence
top2だけ持っておけばいいという典型
■F - Many Lamps
入力はグラフだが、木でいい。
あとは葉っぱから貪欲にする