摘要:
Sample Input 1 100 2 10 2 1 20 1 1 1 100 2 10 2 1 20 1 1 Sample Output 21 21 题意:共有m元钱和n种东西,求每种单价p,而且你买x个该种物品可以得到Ax+B个,求m元钱最多能得到多少。 思路:先01背包处理出A+B的情况,再 阅读全文
摘要:
For each test case, in the first line, you should print the maximum sum. In the next line you should print a string consisting of "L","R","U" and "D", 阅读全文
摘要:
Sample Input 5 2 -2 0 2 0 -2 0 5 2 3 2 3 3 3 3 5 2 -2 0 2 0 -2 0 5 2 3 2 3 3 3 3 Sample Output 12 5 12 5 求最多多少序列满足,前半部分满足d(j+1) = d(j)+d1,后半部分d(j+1)= 阅读全文
摘要:
Sample Input 2 abc abaadada 2 abc abaadada Sample Output Yes No Yes No 判断是否能成为3个非空回文子串 manacher算法求出个点回文长度,在找出第一个和最后一个保存下来,再判断中间的 阅读全文
摘要:
Sample Input 2 3 1 3 2 6 2 3 4 5 6 1 2 3 1 3 2 6 2 3 4 5 6 1 Sample Output 2 6 2 6 题意:给一个转置求它的循环长度 题解:分解成循环求最小公倍数 阅读全文
摘要:
Zball in Tina Town Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 1401 Accepted Submission(s) 阅读全文
摘要:
poj 2528 For each input data set print the number of visible posters after all the posters are placed. The picture below illustrates the case of the s 阅读全文
摘要:
poj 3264 Sample Input Sample Output 求任一区间的最大值和最小值的差 poj 3468 Sample Input Sample Output ①对区间i - j 的数全加上c ; ②求区间的和 阅读全文
摘要:
Sample Input 3 0 0 0 3 0 1 5 0 1 0 0 1 1 0 1 0 0 3 0 0 0 3 0 1 5 0 1 0 0 1 1 0 1 0 0 Sample Output Case #1: 0 0 0 Case #2: 0 1 0 2 Case #1: 0 0 0 Case 阅读全文
摘要:
Sample Input 4 3 9 1 1 2 6 3 9 1 2 3 3 5 2 3 1 1 1 1 1 9 9 9 1 2 3 4 5 6 7 8 9 4 3 9 1 1 2 6 3 9 1 2 3 3 5 2 3 1 1 1 1 1 9 9 9 1 2 3 4 5 6 7 8 9 Sampl 阅读全文