Codeforces Round #141 (Div. 2)

A. Is your horseshoe on the other hoof?

  • 模拟题意。

B. Two Tables

  • 暴力枚举(x,y)

C. Fractal Detector

  • 显然,判断图形的长度为(2^x,x>1)
  • 在判断长为(2^x)的正方形数时,4个(2^{x-1})的正方形根据初始图形也要相应的满足,所以可以常数时间判断(2^x)是否也是分形图形。

D. Zigzag

  • (2 le z le 6),且(S_{i}^{z})的循环节为(2(z-1)),所以不同序列只有(2(z-1) le 10)种。
  • 对10种序列分别建立线段树即可。

E. The Road to Berland is Paved With Good Intentions

  • 对于每个连通块来说,固定其中一个点的状态(是否反转),其余点的状态也相应固定。
原文地址:https://www.cnblogs.com/mcginn/p/6028623.html