码迷,mamicode.com
首页 >  
搜索关键字:can you dfs    ( 55632个结果
lost+found目录
If you runfsck, the filesystem check and repair command, it might find data fragments that are not referenced anywhere in the filesystem. In particula...
分类:其他好文   时间:2014-05-13 16:59:54    阅读次数:276
POJ 3017 单调队列dp
Cut the Sequence Time Limit: 2000MS   Memory Limit: 131072K Total Submissions: 8764   Accepted: 2576 Description Given an integer sequence { an } of length N, you are to ...
分类:其他好文   时间:2014-05-13 16:04:29    阅读次数:267
Codeforces #245(div2)
A:A. Points and Segments (easy) 题目看了n久,开始觉得尼玛这是div2的题目么,题目还标明了easy。。 意思是给你一n个点,m个区间,在n个点上放蓝球或者红球,然后让你找一种选择方案使得m个区间内的蓝球和红球数量之差不超过1. 开始想过用dfs,不过这只是div2的A题而已。。 然后想了下,直接输出010101序列不就可以么。 交了一发,发现...
分类:其他好文   时间:2014-05-13 15:42:51    阅读次数:296
Pat(Advanced Level)Practice--1044(Shopping in Mars)
Pat1044代码 题目描述: Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can...
分类:其他好文   时间:2014-05-13 14:33:08    阅读次数:437
Best Time to Buy and Sell Stock
原题: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of th...
分类:其他好文   时间:2014-05-13 14:12:41    阅读次数:342
Leetcode 贪心 Best Time to Buy and Sell StockII
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Best Time to Buy and Sell Stock II  Total Accepted: 13030 Total Submissions: 36467 Say you have an array for which the ith ...
分类:其他好文   时间:2014-05-13 14:08:39    阅读次数:414
poj2104(主席树)
K-th Number Time Limit: 20000MS   Memory Limit: 65536K Total Submissions: 35704   Accepted: 11396 Case Time Limit: 2000MS Description You are working for Macrohard com...
分类:其他好文   时间:2014-05-13 14:07:41    阅读次数:203
ZOJ3672:Gao The Sequence
You are given a sequence of integers, A1,A2,...,An. And you are allowed a manipulation on the sequence to transform the origin sequence into another sequence B1,B2,...,Bn(Maybe the two sequences are s...
分类:其他好文   时间:2014-05-13 13:45:10    阅读次数:327
[ACM] 1016 Prime Ring Problem (深度优先搜索)
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...
分类:其他好文   时间:2014-05-13 11:54:17    阅读次数:444
ZOJ 3684 Destroy 树的中心
中心节点就是树的中心,2遍dfs求到树的直径,而中心一定在直径上,顺着直径找到中心就够了。 然后可以一遍树形DP找到最小值或者二分+判断是否访问到叶子节点。 #include #include #include #include using namespace std; struct node { int next; int power; int length...
分类:其他好文   时间:2014-05-13 11:28:38    阅读次数:306
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!