262144 (game)

题目描述

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 game she is playing. The game starts with a sequence of N positive integers (2≤N≤262,144), 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!


solution

令f[i][j]表示以j为左端点,合并出i时的右端点

i最大只有18

难度在于怎么能想到这个状态

262144 (game)的更多相关文章

  1. BZOJ 4576: [Usaco2016 Open]262144

    Description 一个序列,每次可以将两个相同的数合成一个数,价值+1,求最后最大价值 \(n \leqslant 262144\) Sol DP. 这道题是 BZOJ 4580: [Usaco ...

  2. P3147 [USACO16OPEN]262144

    P3147 [USACO16OPEN]262144一道非常有趣的游戏,不,题目.当数据水时,可以这样表示状态.f[i][j]表示合并[i,j]区间所能得到的最大值,有点floyed的小味道.if(f[ ...

  3. max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

    elasticsearch启动时遇到的错误 问题翻译过来就是:elasticsearch用户拥有的内存权限太小,至少需要262144: 解决: 切换到root用户 执行命令: sysctl -w vm ...

  4. P3146 [USACO16OPEN]248 & P3147 [USACO16OPEN]262144

    注:两道题目题意是一样的,但是数据范围不同,一个为弱化版,另一个为强化版. P3146传送门(弱化版) 思路: 区间动规,设 f [ i ][ j ] 表示在区间 i ~ j 中获得的最大值,与普通区 ...

  5. 一道另类的区间dp题 -- P3147 [USACO16OPEN]262144

    https://www.luogu.org/problemnew/show/P3147 此题与上一题完全一样,唯一不一样的就是数据范围; 上一题是248,而这一题是262144; 普通的区间dp表示状 ...

  6. bzoj4576 [Usaco2016 Open]262144

    题目大意: 给出n个数a[1..n],n<=262144,a[i]<=40,相邻且相同的数可以合并成一个并将值加1,问能获得的最大数是多少 用一个双向链表维护原数列,每个节点记录此节点对应 ...

  7. 【[USACO16OPEN]262144】

    发现这个数列的范围特别大但是值域的范围特别小 于是可以大胆猜测这道题值域肯定需要开到状态里去 又发现\(262144=2^{18}\)这个暗示非常明显啊,暗示这道题跟二进制有关系 其实也没什么关系 设 ...

  8. 洛谷P3147 [USACO16OPEN]262144

    P3147 [USACO16OPEN]262144 题目描述 Bessie likes downloading games to play on her cell phone, even though ...

  9. luogu P3147 [USACO16OPEN]262144

    题目描述 Bessie likes downloading games to play on her cell phone, even though she doesfind the small to ...

随机推荐

  1. mysql 1055 的错误

    1.Err1055,出现这个问题往往是在执行sql语句时候,在最后一行会出现这个问题. [Err] 1055 - Expression #1 of ORDER BY clause is not in ...

  2. JAVAOOP继承

    继承:修饰符 子类 extends 父类{    //类定义部分},不可以使用private和protected修饰类 减少代码量,实现无损替换 必须符合A is a B的关系 宝马  车 狗     ...

  3. dts--tests(三)

    sample_built.py """ DPDK Test suite. Test sample_built. """ import uti ...

  4. 用 js 写一个获取随机颜色的程序

    function getColor(){ var color="#"; for(var i=0;i<6;i++){ color+=(Math.random()*16 | 0) ...

  5. Effective Approaches to Attention-based Neural Machine Translation(Global和Local attention)

    这篇论文主要是提出了Global attention 和 Local attention 这个论文有一个译文,不过我没细看 Effective Approaches to Attention-base ...

  6. bedtools

  7. 1016-01-首页16-计算配图的frame----MJExtention的使用

    -------HWPhoto.h--------------------------------------------- #import <Foundation/Foundation.h> ...

  8. HyperLedger Fabric 1.4 区块链技术发展(1.3)

    区块链技术发展经历区块链1.0(数字货币).区块链2.0(数字资产与智能合约)和区块链3.0(各种行业分布式应用落地)三个阶段.区块链在应用上分为公有链(PublicBlockChains).联盟链( ...

  9. Cache、Buffer的区别

    什么是Cache?什么是Buffer?二者的区别是什么? Buffer和Cache的区别 buffer与cache操作的对象就不一样. 1.buffer(缓冲)是为了提高内存和硬盘(或其他I/O设备) ...

  10. 笔记-python-statement-with

    笔记-python-statement-with 1.      with语句 1.1.    基础使用案例 在开发时,经常使用with语句来打开文件: with open(‘a.txt’,’a+’, ...