Codeforces Round #407 (Div. 2)
Posted 翠竹叶飞
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces Round #407 (Div. 2)相关的知识,希望对你有一定的参考价值。
A 模拟
B 大力分类讨论
- |b1|?>?l — answer is 0.
- b1?=?0 — if 0 is present in array a than answer is 0, else inf.
- q?=?1 — if b1 is present in array a than answer is 0, else inf.
- q?=??-?1 — if both b1 and ?-?b1 are present in array a than answer is 0, otherwise inf.
- q?=?0 — if 0 isn‘t present in array a than answer is inf, else if b1 is present in a than answer is 0, else answer is 1.
- 直接暴力判
或者是取巧的方法,观察到如果可能出现循环,由于循环节<=2,答案只能是0,1,inf.
//其实也要讨论,只不过代码变短了许多
C 枚举结尾的位置,类dp一波 //f[i] = 以i为头的子串最大权值
以上是关于Codeforces Round #407 (Div. 2)的主要内容,如果未能解决你的问题,请参考以下文章
Codeforces Round #407 (Div. 2)解题报告
Codeforces Round #407 (Div. 2) C Functions again(最大子序列和)
Codeforces Round #407 (Div. 2)(争取明天24点前补掉)
Codeforces Round #436 E. Fire(背包dp+输出路径)