随笔分类 -  动态规划

摘要:Test for Job Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 11399 Accepted: 2697 Description Mr.Dog was fired by his company. In order to 阅读全文
posted @ 2017-09-30 13:24 joeylee97 阅读(201) 评论(0) 推荐(0)
摘要:丁丁最近沉迷于一个数字游戏之中。这个游戏看似简单,但丁丁在研究了许多天之后却发觉原来在简单的规则下想要赢得这个游戏并不那么容易。游戏是这样的,在你面前有一圈整数(一共n个),你要按顺序将其分为m个部分,各部分内的数字相加,相加所得的m个结果对10取模后再相乘,最终得到一个数k。游戏的要求是使你所得的 阅读全文
posted @ 2017-09-29 09:15 joeylee97 阅读(375) 评论(0) 推荐(0)
摘要:题目描述 Description N位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学排成合唱队形。 合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1,2…,K,他们的身高分别为T1,T2,…,TK, 则他们的身高满足T1<...<Ti>Ti+1>…>TK(1<=i 阅读全文
posted @ 2017-09-28 21:38 joeylee97 阅读(164) 评论(0) 推荐(0)
摘要:1025 选菜 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 1025 选菜 1025 选菜 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄 阅读全文
posted @ 2017-09-28 21:07 joeylee97 阅读(146) 评论(0) 推荐(0)
摘要:1017 乘积最大 2000年NOIP全国联赛普及组NOIP全国联赛提高组 1017 乘积最大 2000年NOIP全国联赛普及组NOIP全国联赛提高组 #include <iostream> #include <string> #include <cstdio> #include <vector> 阅读全文
posted @ 2017-09-28 20:46 joeylee97 阅读(352) 评论(0) 推荐(0)
摘要:时间限制:2秒 空间限制:131072K 小Q和牛博士合唱一首歌曲,这首歌曲由n个音调组成,每个音调由一个正整数表示。对于每个音调要么由小Q演唱要么由牛博士演唱,对于一系列音调演唱的难度等于所有相邻音调变化幅度之和, 例如一个音调序列是8, 8, 13, 12, 那么它的难度等于|8 - 8| + 阅读全文
posted @ 2017-09-28 16:47 joeylee97 阅读(883) 评论(0) 推荐(0)
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef... 阅读全文
posted @ 2017-09-07 12:34 joeylee97 阅读(202) 评论(0) 推荐(0)
摘要:最小支配集: 从V中选取尽量少的点组成一个集合,让V中剩余的点都与取出来的点有边相连。 (点) 最小点覆盖: 从V中选取尽量少的点组成一个集合V1,让所有边(u,v)中要么u属于V1,要么v属于V1 (边) 最大独立集: 从V中选取尽量多的点组成一个集合,让这些点中间没有边项链,也就是说对于任何一条 阅读全文
posted @ 2017-09-07 11:13 joeylee97 阅读(640) 评论(0) 推荐(0)
摘要:Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yields a forest: a collection of one or more trees. 阅读全文
posted @ 2017-09-01 19:43 joeylee97 阅读(138) 评论(0) 推荐(0)
摘要:1007: 易碎的鸟蛋 题目描述 你们知道吗?西电的跳楼塔上面有一个鸟巢。某SXBK的教授对这个鸟巢很感兴趣。经过仔细观察,他发现鸟巢中有若干枚蛋。于是他想利用这些蛋做一个试验。测试一下蛋的坚固程度。这些蛋应该是具有相同的坚硬度。存在一个非负整数E,如果从塔的第E层往下扔蛋,蛋不会破,但如果从第E+ 阅读全文
posted @ 2017-08-21 16:00 joeylee97 阅读(218) 评论(0) 推荐(0)
摘要:The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The sho 阅读全文
posted @ 2017-08-21 13:42 joeylee97 阅读(216) 评论(0) 推荐(0)
摘要:Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右跑,它跑动的速度也是1米/ 阅读全文
posted @ 2017-08-21 13:41 joeylee97 阅读(173) 评论(0) 推荐(0)
摘要:There are n cities and n - 1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roads. Theon a 阅读全文
posted @ 2017-08-21 12:57 joeylee97 阅读(310) 评论(0) 推荐(0)
摘要:Petra and Jan have just received a box full of free goodies, and want to divide the goodies between them. However, it is not easy to do this fairly, s 阅读全文
posted @ 2017-08-21 12:55 joeylee97 阅读(382) 评论(0) 推荐(0)
摘要:Alice is going to take all her savings out of the ATM(Automatic Teller Machine). Alice forget how many deposit she has, and this strange ATM doesn't s 阅读全文
posted @ 2017-08-19 09:24 joeylee97 阅读(154) 评论(0) 推荐(0)
摘要:https://vjudge.net/contest/176767#overview A - A Spy in the Metro B 最长递增子序列变形 C D E G H I I 树形DP 阅读全文
posted @ 2017-08-13 16:16 joeylee97 阅读(284) 评论(0) 推荐(0)
摘要:3657 括号序列 我们用以下规则定义一个合法的括号序列: (1)空序列是合法的 (2)假如S是一个合法的序列,则 (S) 和[S]都是合法的 (3)假如A 和 B 都是合法的,那么AB和BA也是合法的 例如以下是合法的括号序列: (), [], (()), ([]), ()[], ()[()] 以 阅读全文
posted @ 2017-08-12 16:56 joeylee97 阅读(1179) 评论(0) 推荐(0)
摘要:3049 舞蹈家怀特先生 时间限制: 1 s 空间限制: 64000 KB 题目等级 : 黄金 Gold 题解 3049 舞蹈家怀特先生 3049 舞蹈家怀特先生 时间限制: 1 s 空间限制: 64000 KB 题目等级 : 黄金 Gold 时间限制: 1 s 空间限制: 64000 KB 题目等 阅读全文
posted @ 2017-08-12 16:21 joeylee97 阅读(263) 评论(0) 推荐(0)
摘要:C. Vladik and Memorable Trip time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Vladik a 阅读全文
posted @ 2017-06-01 18:19 joeylee97 阅读(212) 评论(0) 推荐(0)
摘要:Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 35387 Accepted: 12816 Description A Bank plans to install a machine for cash withdrawal. Th 阅读全文
posted @ 2017-05-30 17:19 joeylee97 阅读(243) 评论(0) 推荐(0)