基本概念
注:这一节的代码源自The Swift Programming Language中的A Swift Tour。
 
Hello, world
类似于脚本语言,下面的代码即是一个完整的Swift程序。
println("Hello, world") 
 
变量与常量
Swift使用var声明变量,let声明常量。
var myVariable = 42 myVariabl...
                            
                            
                                分类:
其他好文   时间:
2014-06-04 13:18:43   
                                阅读次数:
343
                             
                    
                        
                            
                            
                                Farm IrrigationTime Limit : 2000/1000ms 
(Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 
6Accepted Submission(s) : 3Font:Time...
                            
                            
                                分类:
其他好文   时间:
2014-05-25 19:42:33   
                                阅读次数:
296
                             
                    
                        
                            
                            
                                Tour
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 3470
Accepted: 1545
Description
John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a...
                            
                            
                                分类:
其他好文   时间:
2014-05-21 08:24:18   
                                阅读次数:
354
                             
                    
                        
                            
                            
                                题目链接:点击打开链接
题意:给定二维平面上的n个点
从最左端点到最右端点(只能向右移动)
再返回到到最右端点(只能向左移动,且走过的点不能再走)
问最短路。
dp 点击打开链接
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
#de...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 08:57:27   
                                阅读次数:
258
                             
                    
                        
                            
                            
                                Tour
Time Limit: 1000MS
 
Memory Limit: 65536K
Total Submissions: 3408
 
Accepted: 1513
Description
John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 07:16:45   
                                阅读次数:
385
                             
                    
                        
                            
                            
                                题目描述Farmer John wants to set up a telephone line at 
his farm. Unfortunately, the phone company is uncooperative, so he needs to pay 
for some of the ca...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 18:03:37   
                                阅读次数:
292
                             
                    
                        
                            
                            
                                题目链接:http://poj.org/problem?id=2135
Farm Tour
Time Limit: 1000MS
 
Memory Limit: 65536K
Total Submissions: 10862
 
Accepted: 4024
Description
When FJ's f...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 11:24:14   
                                阅读次数:
348
                             
                    
                        
                            
                            
                                http://acm.hdu.edu.cn/showproblem.php?pid=1224
基础的求最长路以及记录路径。感觉dijstra不及spfa好用,wa了两次。
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define LL long long
#define...
                            
                            
                                分类:
其他好文   时间:
2014-05-14 20:59:54   
                                阅读次数:
295
                             
                    
                        
                            
                            
                                /*
ID:kevin_s1
PROG:milk
LANG:C++
*/
#include 
#include 
#include 
#include 
#include 
#define MAXN 5001
using namespace std;
int N,M;
struct farmer{
	int Pi;
	int Ai;
}farmers[MAXN];
int cmp(farm...
                            
                            
                                分类:
其他好文   时间:
2014-05-13 11:56:20   
                                阅读次数:
252
                             
                    
                        
                            
                            
                                题目链接建个图,套个模板。#include #include #include 
#include #include #include #include #include using namespace std;#define INF 
0x3ffffffstruct node{ int u,v,...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 21:21:36   
                                阅读次数:
396