2020-12-06から1日間の記事一覧

F1. Lightsabers (easy) ~[l,r)に値vはいくつありますか?に答える構造体~ (累積和を複数)

Quiz https://codeforces.com/problemset/problem/958/F1 AC https://codeforces.com/contest/958/submission/100475630 解説 範囲の全探索。colorごとの累積和を持てば各色の集計も高速にできる その他 汎用的に構造体で書けると以前から思っていたので、ち…

C. Mahmoud and Ehab and the wrong algorithm

Quiz https://codeforces.com/contest/959/problem/C AC https://codeforces.com/contest/959/submission/100473060 解説 N>=6なら間違う木を作れる。editorialの構築もいいですが、私は下記の図のように等分に分けた すると間違ったアルゴリズムでは解をN/2…