首页 > 代码库 > Codeforces Round #407 (Div. 2)
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)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。