AgOH

Codeforces Round #818 (Div. 2) 题解

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

A. Madoka and Strange Thoughts

打表发现有循环节,设 \(\{a\} = 0,1,4,7,10,11\),答案即为 \(16 \times \lfloor \cfrac{n}{6} \rfloor+a[n \bmod 6]\)

B. Madoka and Underground Competitions

\(i+j \equiv r+c \pmod k\) 时输出 X,否则输出 .

C. Madoka and Formal Statement

以下两种情况会寄:

  • \(b_i < a_i\)\(a_i\) 只能变大);
  • \(b_i \neq a_i \land b_i-b_{(i+1) \bmod n}>1\)(最多只能当 \(b_i = b_{(i+1) \bmod n}\) 时使 \(b_i\) 加一,也就是说最多只能差 \(1\)

D. Madoka and The Corruption Scheme

手玩发现 \(k<=n\) 时即求:

\[\sum\limits_{i=0}^{k} \binom{n}{i}\]

\(k>n\) 相当于 \(k=n\)

CATALOG
  1. 1. A. Madoka and Strange Thoughts
  2. 2. B. Madoka and Underground Competitions
  3. 3. C. Madoka and Formal Statement
  4. 4. D. Madoka and The Corruption Scheme