XVIII Open Cup named after E.V. Pankratiev. Grand Prix of Peterhof.

A. City Wall

一圈一圈绕。


B. Domino Colorings


C. Сounterquestion

枚举 permutation 后 \(O(len)\) 地 check。


D. Galaxy Center

  • 同一层至多经过一个点。
  • 可能 vis 的点不会太多,枚举在哪个点相遇。

E. IBM 1403

预处理序列自动机,即可求 \(O(|s|)\) 出当前时间 t 下,打印字符串 s 的时间。


F. Line Tracing


G. The Queen and the Knight


H. Product of Roots


I. Safe Landing

如果两个维度都变化了,那倒着走回去即可,否则 -1


J. Perfect Square

选一些质数 p,检验一下 x%p 是否为模 p 的二次剩余。

猜你喜欢

转载自www.cnblogs.com/FST-stay-night/p/12041784.html