2018年8月16日
摘要: 题目描述: 有一个由1..9组成的数字串.问如果将m个加 号插入到这个数字串中,在各种可能形成的 表达式中,值最小的那个表达式的值是多少 (本题只能用于整数) 解题思路: 假定数字串长度是n,添完加号后,表达式的最后一个加号添加在第 i 个数字后面,那么整个表达 式的最小值, 就等于在前 i 个数字 阅读全文
posted @ 2018-08-16 16:51 kindleheart 阅读(280) 评论(0) 推荐(0) 编辑
  2018年8月7日
摘要: POJ 1458 最长公共子序列 题目大意:给出两个字符串,求出这样的一 个最长的公共子序列的长度:子序列 中的每个字符都能在两个原串中找到, 而且每个字符的先后顺序和原串中的 先后顺序一致。 Sample Input : abcfbc abfcab programming contest abcd 阅读全文
posted @ 2018-08-07 10:37 kindleheart 阅读(129) 评论(0) 推荐(0) 编辑
  2018年8月5日
摘要: POJ 1700 Crossing River Crossing River Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 20037 Accepted: 7453 Description A group of N people 阅读全文
posted @ 2018-08-05 09:49 kindleheart 阅读(146) 评论(0) 推荐(0) 编辑
  2018年8月3日
摘要: 考虑1,2,…,n (n <= 100000)的排列i1,i2,…,in,如果其中存在j,k,满足 j < k 且 ij > ik, 那么就称(ij,ik)是这个排列的一个逆序。 一个排列含有逆序的个数称为这个排列的逆序数。例如排列 263451 含有8个 逆序(2,1),(6,3),(6,4),( 阅读全文
posted @ 2018-08-03 20:46 kindleheart 阅读(1864) 评论(0) 推荐(0) 编辑
摘要: 描述:给定一个数组包含n个元素,统计前m大的数并且把这m个数从大到小输 出。 输入: 第一行包含一个整数n,表示数组的大小。n < 100000。第二行包含n个整数,表示数组的元素,整数之间以一个空格分开 。每个整数的绝对值不超过100000000。 第三行包含一个整数m。m < n。 输出: 从大 阅读全文
posted @ 2018-08-03 13:24 kindleheart 阅读(714) 评论(0) 推荐(0) 编辑
  2018年8月2日
摘要: POJ 2456 Agressive cows 农夫 John 建造了一座很长的畜栏,它包括N (2≤N≤100,000)个隔间,这 些小隔间的位置为x0,...,xN-1 (0≤xi≤1,000,000,000,均为整数,各不相同). John的C (2≤C≤N)头牛每头分到一个隔间。牛都希望互相 阅读全文
posted @ 2018-08-02 17:52 kindleheart 阅读(287) 评论(0) 推荐(0) 编辑
  2018年7月11日
摘要: POJ 2243 Knight Moves A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight 阅读全文
posted @ 2018-07-11 23:57 kindleheart 阅读(186) 评论(0) 推荐(0) 编辑
摘要: HDU 1240 Asteroids! You're in space. You want to get home. There are asteroids. You don't want to hit them. InputInput to this problem will consist of 阅读全文
posted @ 2018-07-11 23:45 kindleheart 阅读(410) 评论(0) 推荐(0) 编辑
摘要: HDU 1010 Tempter of the Bone The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to 阅读全文
posted @ 2018-07-11 23:40 kindleheart 阅读(120) 评论(0) 推荐(0) 编辑
摘要: POJ 3009 Curling 2.0 Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat differen 阅读全文
posted @ 2018-07-11 23:14 kindleheart 阅读(141) 评论(0) 推荐(0) 编辑