上一页 1 2 3 4 5 6 ··· 17 下一页
摘要: 题目链接: "1155 Heap Paths (30 分)" In computer science, a heap is a specialized tree based data structure that satisfies the heap property: if P is a pare 阅读全文
posted @ 2019-11-19 21:10 wuli涛涛 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "HDU 2063" Problem Description RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把 阅读全文
posted @ 2019-11-18 20:48 wuli涛涛 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "HDU 2512" Problem Description 因为长期钻研算法, 无暇顾及个人问题,BUAA ACM/ICPC 训练小组的帅哥们大部分都是单身。某天,他们在机房商量一个绝妙的计划"一卡通大冒险"。这个计划是由wf最先提出来的,计划的内容是,把自己的联系方式写在校园一卡通的 阅读全文
posted @ 2019-11-17 23:10 wuli涛涛 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "1067 Sort with Swap(0, i) (25 分)" 题意 给定长度为 $n$ 的排列,如果每次只能把某个数和第 $0$ 个数交换,那么要使排列是升序的最少需要交换几次。 思路 贪心 由于是排列,所以排序后第 $i$ 个位置上的数就是 $i$。所以当 $a[0] \neq 阅读全文
posted @ 2019-11-16 23:33 wuli涛涛 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "HDU 4513" Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1 阅读全文
posted @ 2019-11-15 22:59 wuli涛涛 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "POJ 3974" Description Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple 阅读全文
posted @ 2019-11-14 21:28 wuli涛涛 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 最长回文子串 回文串 就是原串和反转字符串相同的字符串。比如 ,`acca`。前一个是奇数长度的回文串,后一个是偶数长度的回文串。 最长回文子串 就是一个字符串的所有子串中,是回文串且长度最长的子串。 Brute Force 做法 枚举所有子串,判断是否是回文串,然后寻找最大长度。寻找所有子串要两重 阅读全文
posted @ 2019-11-13 23:38 wuli涛涛 阅读(514) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "LightOJ 1418" Problem Description I have bought an island where I want to plant trees in rows and columns. So, the trees will form a rectangula 阅读全文
posted @ 2019-11-12 23:19 wuli涛涛 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "POJ 1410" Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line 阅读全文
posted @ 2019-11-11 22:33 wuli涛涛 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "HDU 1028" Problem Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "Th 阅读全文
posted @ 2019-11-10 15:37 wuli涛涛 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 17 下一页