摘要: You are given an array aa consisting of nn integers. Your task is to determine if aa has some subsequence of length at least 33 that is a palindrome. 阅读全文
posted @ 2020-03-14 22:56 Vetsama 阅读(196) 评论(0) 推荐(0)
摘要: You are given some Tetris field consisting of nn columns. The initial height of the ii-th column of the field is aiai blocks. On top of these columns 阅读全文
posted @ 2020-03-14 22:52 Vetsama 阅读(276) 评论(0) 推荐(0)
摘要: FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large 阅读全文
posted @ 2020-02-16 22:25 Vetsama 阅读(167) 评论(0) 推荐(0)
摘要: The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The sho 阅读全文
posted @ 2020-02-16 21:22 Vetsama 阅读(99) 评论(0) 推荐(0)
摘要: Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now y 阅读全文
posted @ 2020-02-16 20:16 Vetsama 阅读(80) 评论(0) 推荐(0)
摘要: Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in th 阅读全文
posted @ 2020-02-16 19:35 Vetsama 阅读(95) 评论(0) 推荐(0)
摘要: 背包问题的第k大值 背包数组另开一维存储第k大值,每次优化时也优化这个维度 #include <iostream> #include <cstdlib> #include <cstring> #include <string> using namespace std; int mmax(int a, 阅读全文
posted @ 2020-02-09 20:11 Vetsama 阅读(75) 评论(0) 推荐(0)
摘要: 分组背包,如果分成01背包有可能会超限,使用二进制分组的方法 比如18=1+2+4+8+3 分解成二进制的大物品 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorit 阅读全文
posted @ 2020-02-09 19:58 Vetsama 阅读(82) 评论(0) 推荐(0)
摘要: 二维背包,加一个维度就好,这个时候就体现出来一维数组做背包多重要了,三维数组什么的,绝对要mle #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> usin 阅读全文
posted @ 2020-02-09 19:55 Vetsama 阅读(88) 评论(0) 推荐(0)
摘要: 01背包+完全背包+多重背包=? 大杂烩背包! 其实是叫混合背包 if else套对应的代码就行,多重背包转成01其实就是,但是我就不(滑稽) #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #i 阅读全文
posted @ 2020-02-09 19:52 Vetsama 阅读(125) 评论(0) 推荐(0)