随笔分类 -  算法-动态规划-区间dp

摘要:"传送门" Solution 区间DP,枚举断点,对于一个区间,枚举折叠长度,用hash暴力判断是否能折叠即可 Code cpp include include include include include define Re register define F(i,a,b) for(Re int 阅读全文
posted @ 2018-10-03 19:45 Menteur_hxy 阅读(154) 评论(0) 推荐(0)
摘要:"传送门" Solution 裸区间DP Code cpp include include include include include include include define F(i,a,b) for(register int i=(a);i M; char str[]="!WING",c 阅读全文
posted @ 2018-10-02 23:29 Menteur_hxy 阅读(182) 评论(0) 推荐(0)
摘要:"传送门" Description Branimirko是一个对可爱精灵宝贝十分痴迷的玩家。最近,他闲得没事组织了一场捉精灵的游戏。游戏在一条街道上举行,街道上一侧有一排房子,从左到右房子标号由1到n。 刚开始玩家在k号房子前。有m个精灵,第i只精灵在第A[i]栋房子前,分值是B[i],以及它在T[ 阅读全文
posted @ 2018-08-07 22:08 Menteur_hxy 阅读(253) 评论(0) 推荐(0)
摘要:DescriptionPolygon is a game for one player that starts on a polygon with N vertices, like the one in Figure 1, where N=4. Each vertex... 阅读全文
posted @ 2018-04-19 16:22 Menteur_hxy 阅读(165) 评论(0) 推荐(0)
摘要:题目描述 在一个圆形操场的四周摆放N堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一堆的石子数,记为该次合并的得分。试设计出1个算法,计算出将N堆石子合并成1堆的最小得分和最大得分.输入输出格式 输入格式: 数据的第1行试正整数... 阅读全文
posted @ 2018-01-19 18:54 Menteur_hxy 阅读(90) 评论(0) 推荐(0)