matthew as a q.

競技プログラミングメイン

Atcoder Beginner Contest 121

atcoder.jp

A. White Cells

残りは長方形やるだけ。

B. Can you solve this?

各行計算、判定。

C. Energy Drink Collector

価格の低いほうから買えるだけ買う。

D. XOR World

XOR演算の性質に気付ければO(1)。

詳しくはeditorial参照。

ポイントは以下。

  • 同じ要素のXORは0(自身が単位元)。

    • x ^ x -> e
  • 偶数nに対してn ^ (n + 1) -> 1

競技プログラミングにおけるXORのTips - Qiita