当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

BZOJ4580:[Usaco2016 Open]248

题目描述
Bessie likes downloading games to play on her cell phone, even though she does find the small touch 
screen rather cumbersome to use with her large hooves.She is particularly intrigued by the current g
ame she is playing. The game starts with a sequence of NN positive integers (2≤N≤248), each in the
 range 1…40. In one move, Bessie can take two adjacent numbers with equal values and replace them a
 single number of value one greater (e.g., she might replace two adjacent 7s with an 8). The goal is
 to maximize the value of the largest number present in the sequence at the end of the game. Please 
help Bessie score as highly as possible!
给你n个数,每次可以将两个相邻的相同数x合并成x+1,求最大能合出多少

输入解释
The first line of input contains N, and the next N lines give the sequence of N numbers at the start
 of the game.

输出解释

Please output the largest integer Bessie can generate.

输入样例
4
1
1
1
2
输出样例
3
提示

BZPRO Powered by Remmina.
Github Repository
来自acmore.cc的附加信息
bzoj_id 4580
import_source_sha256 33cab1b9c78ad8d2c588f4d9299d7623b7ea06f5fd9dc5626ff1e264d4ef68fb
bzoj_checker_pending False

该题目包含在题集 大视野(八中)OJ 中

题目来源 BZOJ 4580

源链接: LOCAL-BZOJ4580

共提交 0 次

通过率 --%
时间上限 内存上限
10000 MS 128 MB