题目地址:HDU1853
费用流果然好神奇。。还可以用来判断环。。。如果每个点都是环的一部分而且每个点只能用到一次的话,那每个点的初度入度都是1,这就可以利用网络流来解决,只要拆点令其流量为1,就限制了每个点只能用一次,每次左边的连到右边的,就相当于左边点的一次初度和右边的点的一次入度,很容易想象出来。最后只要判断总流量是否为n即可,因为如果总流量为n的话,说明每个点都出了一次度,每个点都入了一...
分类:
其他好文 时间:
2014-07-04 09:29:05
阅读次数:
387
题目:
链接:点击打开链接
题意:
思路:
代码:
#include
#include
#include
using namespace std;
int map[110][110];
int dp[110],next[110],ins[110];
int t,n,m;
void output(int x)
{
if(x == -1)...
分类:
其他好文 时间:
2014-07-01 08:55:28
阅读次数:
174
Functions and Closures 函数和封闭性(闭包)Functions 函数的使用Swift中的函数定义和OC中有明显的差别了,使用func定义函数,在括号里定义參数和类型,用 -> 定义返回值类型func greet(name: String, day: String) -> Str...
分类:
其他好文 时间:
2014-06-29 19:26:28
阅读次数:
209
http://numbbbbb.gitbooks.io/-the-swift-programming-language-/chapter1/02_a_swift_tour.html本页内容包括:简单值(Simple Values)控制流(Control Flow)函数和闭包(Functions an...
分类:
其他好文 时间:
2014-06-28 18:55:25
阅读次数:
279
注:由于基础部分在Swift Tour 中已经大体的说明了,所以在详解中不会达到100%的原文释义
Constants and Variables 常量和变量
常量和变量都需要声明名称和类型(作为程序员,这些基础也就不说了),常量一次赋值不能改变,变量的值可以改变
Declaring Constants and Variables 声明常量和变量
常量和变量在...
分类:
其他好文 时间:
2014-06-27 07:53:38
阅读次数:
183
转载于stackoverflow:http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list 感谢George Stocker的总结Reference Style - All Levels A Tour...
分类:
编程语言 时间:
2014-06-25 13:28:14
阅读次数:
314
http://numbbbbb.github.io/the-swift-programming-language-in-chinese/chapter1/02_a_swift_tour.html
分类:
Web程序 时间:
2014-06-13 18:50:14
阅读次数:
331
Protocols and Extensions
Protocols 协议的使用
使用关键字 protocol 定义一个协议
protocol ExampleProtocol {
var simpleDescription: String { get }
mutating func adjust()
}
类,枚举和结构体都可以实现协议
class SimpleC...
分类:
其他好文 时间:
2014-06-08 17:09:31
阅读次数:
254
Cyclic TourTime Limit: 1000/1000 MS
(Java/Others)Memory Limit: 32768/65535 K (Java/Others)Total Submission(s):
1399Accepted Submission(s): 712Problem ...
分类:
其他好文 时间:
2014-06-08 00:32:29
阅读次数:
284