摘要: 题意:失火了,有n个物品,每个物品有价值pi,必须在时间di前(小于di)被救,否则就要被烧毁。救某个物 品需要时间ti,问最多救回多少价值的物品,并输出救物品的顺序。 Examples Input 33 7 42 6 53 7 6 Input Output 1122 3 Output Input 阅读全文
posted @ 2017-10-07 16:39 ljy3268 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 题意:给你n个数字,其中可能有相同的数字,要求你用其他的数字替换这些相同的数字,使得所得的序列字典序最小。 Examples Input 43 2 2 3 Input Output 21 2 4 3 Output Input 64 5 6 3 2 1 Input Output 04 5 6 3 2 阅读全文
posted @ 2017-10-07 15:02 ljy3268 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 题意:一辆车在一条路上行驶,给你路的总长度a,油箱的容量b,加油站在距离起点的距离f,以及需要走多少遍这条路k(注意:不是往返) 问你最少加多少次油能走完。 Examples Input 6 9 2 4 Input Output 4 Output Input 6 10 2 4 Input Outpu 阅读全文
posted @ 2017-10-07 14:37 ljy3268 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题意:给你一串长度为n的字符,由大小写字母组成,求连续的小写子串中不同字母个数的最大值。 Input 11aaaaBaabAbA Input Output 2 Output Input 12zACaAbbaazzC Input Output 3 Output Input 3ABC Input Out 阅读全文
posted @ 2017-10-07 13:58 ljy3268 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题意:给你n张卡片,上面写有数字,两个人选择两个数字,把相同数字的卡片都拿走,问能不能拿走所有的卡片并且两个人拿的卡片书相同。 Examples Input 411272711 Input Output YES11 27 Output Input 266 Input Output NO Output 阅读全文
posted @ 2017-10-07 13:50 ljy3268 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题意:给你三种不同颜色的点,每种若干(小于5000),在这些点中连线,要求同色的点的最短路大于等于3或者不连通,求有多少种连法。 Examples Input 1 1 1 Input Output 8 Output Input 1 2 2 Input Output 63 Output Input 1 阅读全文
posted @ 2017-10-07 13:07 ljy3268 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 题意:这题题意也看了我好久orz,就是说给你n个题,k个队伍,以及这k个队伍知道这些题的情况,知道为1,不知道为0(这tm要竖着看)问你能 不能在这n道题中选出一些题来,被选的题目应满足:每个队伍最多知道这些题的一半。 Examples Input 5 31 0 11 1 01 0 01 0 01 阅读全文
posted @ 2017-10-07 12:11 ljy3268 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题意: 这题题意看了我好久,意思就是给你时针,分针,秒针,再给你一个起点和终点,起点和终点均为小于12的整数,问你能不能在钟上 从起点走到终点,而不越过指针。 Examples Input 12 30 45 3 11 Input Output NO Output Input 12 0 1 12 1 阅读全文
posted @ 2017-10-07 11:54 ljy3268 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题意:给你一个原串和n个子串,问你这n个子串任意组合起来能不能使原串出现,串的长度为2。 Examples Input ya4ahoytoha Input Output YES Output Input hp2http Input Output NO Output Input ah1ha Input 阅读全文
posted @ 2017-10-07 11:43 ljy3268 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题意:买卖股票,给你n个数,你可以选择买进或者卖出或者什么都不做,问你最后获得的最大收益是多少。 Examples Input 910 5 4 7 9 12 6 2 10 Input Output 20 Output Input 203 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 阅读全文
posted @ 2017-10-07 11:10 ljy3268 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 题意: n个人吃披萨,总共有两种披萨,每种披萨都是有S块,给出每个人要吃的块数,吃第一种披萨能获得的happy值,吃第二种披萨能获得的happy值,问你,在购买的披萨数最少的情况下能获得的最大的总的happy值是多少(披萨可以买任意多个,吃不完也行 2333333) Examples Input 3 阅读全文
posted @ 2017-10-07 10:58 ljy3268 阅读(125) 评论(0) 推荐(0) 编辑