- 博客(16)
- 收藏
- 关注
原创 POJ 2299 Ultra-QuickSort (树状数组 + 离散化)
Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seque
2016-05-28 11:51:19 379
原创 HDU 湫湫系列故事——减肥记I (完全背包)
Problem Description 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增加的
2016-05-22 20:33:07 989
原创 HDU 1114 Piggy-Bank (完全背包 + 取最小值)
Problem Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The
2016-05-22 20:12:35 321
原创 离散数学 求偏序集中的极大元与极小元
输入 输入偏序集 £>,A中的元素数不超过20个,分别用单个小写的英文字母表示。 输入的第一行给出A中的各个元素,两个相邻的元素之间用逗号隔开。 输入的第二行给出偏序关系£,用有序对的形式给出,如,等等,两个相邻的有序对之间用逗号隔开。 输出 输出A的极小元与极大元。 输出的第一行给出各个极小元,两个相邻元素之间用逗号隔开,输出的元素要求按照英文字母的
2016-05-19 12:39:20 12459
原创 POJ 3624 Charm Bracelet (01背包 + 空间优化)
Description Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Ea
2016-05-18 23:11:36 307
原创 HDU 2602 Bone Collector (01背包)
Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave
2016-05-17 23:24:12 299
原创 HDU 2084 数塔 (DP)
Problem Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1
2016-05-17 16:25:28 394
原创 HDU 1106 排序
Problem Description 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。 你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 Input 输入包含多组测试用例,每组输入数据只有一行数
2016-05-17 15:47:42 336
原创 HDU 1084 What Is Your Grade
Problem Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can you get? Now, I told you the
2016-05-17 15:41:38 371
原创 HDU 1031 Design T-Shirt
Problem Description Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found that he was trapped by all kinds of suggestions from everyone on the board. It is ind
2016-05-17 15:39:52 357
原创 HDU 1021 Fibonacci Again
Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). Input Input consists of a sequence of lines, each containing an integer n
2016-05-17 15:37:57 326
原创 HDU 1004 Let the Balloon Rise
Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest i
2016-05-17 15:36:19 321
原创 HDU 1016 Prime Ring Problem
Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.
2016-05-17 15:28:24 314
原创 HDU 2553 N皇后问题 (DFS)
Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output 共有若干行,每行一个
2016-05-14 20:35:09 427
原创 POJ 3009 Curling 2.0 (DFS)
Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a squa
2016-05-14 15:06:43 342
原创 POJ 2488 A Knight's Journey (DFS)
Description Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is
2016-05-10 20:07:32 481
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人