随笔分类 - 动态规划(DP)
状态压缩DP、树形DP、概率DP、斜率DP、区间DP、插头DP、背包
摘要:示例:
阅读全文
摘要:题目链接 Description 给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。 比如两个串为: abcicba abdkscab ab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。 Input 第1行:字符串A 第2行:字符串B (A
阅读全文
摘要:题目链接 problem description 5 friends play LOL together . Every one should BAN one character and PICK one character . The enemy should BAN 55 characters
阅读全文
摘要:题目链接 Problem Description Dr. X is a biologist, who likes rabbits very much and can do everything for them. 2012 is coming, and Dr. X wants to take som
阅读全文
摘要:题目链接 Problem Description The signature of a permutation is a string that is computed as follows: for each pair of consecutive elements of the permutat
阅读全文
摘要:题目链接 Problem Description Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N
阅读全文
摘要:题目链接 Problem Description Now there are n gems, each of which has its own value. Alice and Bob play a game with these n gems.They place the gems in a r
阅读全文
摘要:题目链接 Problem Description Giving two strings and you should judge if they are matched.The first string contains lowercase letters and uppercase letters
阅读全文
摘要:题目链接 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. Ther
阅读全文
摘要:题目链接 Problem Description There is a set including all positive integers that are not more then n. HazelFan wants to choose some integers from this set
阅读全文
摘要:题目链接 Problem Description Sdjpx is a powful man,he controls a big country.There are n soldiers numbered 1~n(1<=n<=3000).But there is a big problem for
阅读全文
摘要:题目链接 DESCRIPTION INPUT OUTPUT SAMPLE INPUT 2 3 2 3 5 7 3 10 3 5 7 SAMPLE OUTPUT 12 26 HINT 官方题解: 代码如下:
阅读全文
摘要:题目链接 Problem Description Matt loves letter L.A point set P is (a, b)-L if and only if there exists x, y satisfying:P = {(x, y), (x + 1, y), . . . , (x
阅读全文
摘要:题目链接 Problem Description IP lookup is one of the key functions of routers for packets forwarding and classifying. Generally, IP lookup can be simplifi
阅读全文
摘要:题目链接 Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can
阅读全文
摘要:题目描述 小明同学要参加一场考试,考试一共有n道题目,小明必须作对至少60%的题目才能通过考试。考试结束后,小明估算出每题作对的概率,p1,p2,...,pn,你能帮他算出他通过考试的概率吗? 输入 输入第一行一个数n(1<=n<=100),表示题目的个数,第二行n个整数,p1,p2,...,pn,
阅读全文
摘要:题目链接 一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出这个最大的值。 例如:3*3的矩阵: -1 3 -1 2 -1 3 -3 1 2 和最大的子矩阵是: 3 -1 -1 3 1 2 一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出
阅读全文
摘要:题目链接 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4920 problem description Two years ago, Pu
阅读全文
摘要:题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does
阅读全文
摘要:题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4800 Problem Description A role-playing game (RPG and sometimes roleplaying game) is a game in which pl
阅读全文

浙公网安备 33010602011771号