AgOH

Codeforces Round #822 (Div. 2) 题解

字数统计: 184阅读时长: 1 min
2022/10/04

A. Select Three Sticks

\(O(n^3)\) 暴力枚举 \(i<=j<=k\),取 \(j-i+k-j=k-i\) 的最小值即可。

B. Bright, Nice, Brilliant

手玩发现每行两边是 \(1\),中间是 \(0\) 即可。

C. Removing Smallest Multiples

贪心地从小往大删模拟即可。

E. Rectangular Congruence

\[a_{r_1, c_1} + a_{r_2, c_2} \not\equiv a_{r_1, c_2} + a_{r_2, c_1} \pmod n \leftrightarrow a_{r_2, c_2} - a_{r_2, c_1} \not\equiv a_{r_1, c_2} - a_{r_1, c_1} \pmod n\]

故使得每行是一个公差不等的等差数列即可,第 \(i\) 行的公差取 \(i\)

CATALOG
  1. 1. A. Select Three Sticks
  2. 2. B. Bright, Nice, Brilliant
  3. 3. C. Removing Smallest Multiples
  4. 4. E. Rectangular Congruence