上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页

2016年5月6日

最小生成树

摘要: 最小生成树问题,可以用克鲁斯卡尔算法和普利姆算法,Prim最主要的思想是根据顶点来得出结果,而Kruscal则是根据边来得出结果的,因此Prim最要运用于稠密图的计算,而Kruskal主要是运用于稀疏图的计算。因为只能选择一个楼连接到外界供电设备,所以只要构成最小生成树的边的和加上与外界连接花费最小 阅读全文

posted @ 2016-05-06 11:29 青春的梦想付诸行动 阅读(193) 评论(0) 推荐(0)

2016年5月5日

最小公倍数 大数问题

摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #define N 50 4 int len,a[N]={1}; 5 char tab[100][45]={0,1}; 6 inline int gcd(int a,int b) 7 { 8 return b==0 阅读全文

posted @ 2016-05-05 11:51 青春的梦想付诸行动 阅读(236) 评论(0) 推荐(0)

2016年5月4日

一种排序

摘要: 1 #include <algorithm> 2 #include <cstdio> 3 using namespace std; 4 typedef struct node { 5 int c,x,y; 6 } node; 7 node s[1010]; 8 9 bool cmp(node a,n 阅读全文

posted @ 2016-05-04 20:54 青春的梦想付诸行动 阅读(99) 评论(0) 推荐(0)

大数阶乘

摘要: 1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 using namespace std; 5 unsigned short s[20000];//最多可以容纳5000阶乘;且必须为int型,当为short型时,数组元 阅读全文

posted @ 2016-05-04 18:20 青春的梦想付诸行动 阅读(165) 评论(0) 推荐(0)

吝啬的国度 简单的图搜索

摘要: 1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 #include <stdlib.h> 5 int pre[100005]; 6 typedef struct edge 7 { 8 int v; 9 struct ed 阅读全文

posted @ 2016-05-04 11:26 青春的梦想付诸行动 阅读(148) 评论(0) 推荐(0)

2016年4月29日

subsequence 尺取法

摘要: 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 6 int arr[1000010]; 7 8 int main() 9 { 10 int T,n,S; 11 scanf 阅读全文

posted @ 2016-04-29 18:44 青春的梦想付诸行动 阅读(167) 评论(0) 推荐(0)

String 尺取法

摘要: 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 char s[1000010]; 6 int vis[300]; 7 int main() 8 { 9 int tt,k,ss,t; //ss 表示低的指针 t代表 阅读全文

posted @ 2016-04-29 16:06 青春的梦想付诸行动 阅读(187) 评论(0) 推荐(0)

2016年4月27日

dos 命令

摘要: dir 查看目录cd 文件夹 进入文件夹cd.. 退到上一级目录cd\ 到c盘md 创建文件夹rd 删除文件夹 (文件夹必须为空)del 删除文件 (*代表所有)exut 退出dos命令行 阅读全文

posted @ 2016-04-27 21:25 青春的梦想付诸行动 阅读(130) 评论(0) 推荐(0)

2016年4月25日

又见01背包

摘要: 1 #include <cstdio> 2 #include <algorithm> 3 #include <cmath> 4 using namespace std; 5 int dp[10001]; 6 int v[105],w[105]; 7 int main() 8 { 9 int n,W, 阅读全文

posted @ 2016-04-25 21:12 青春的梦想付诸行动 阅读(125) 评论(0) 推荐(0)

01串

摘要: 1 #include <cstdio> 2 using namespace std; 3 4 int dp[45]; 5 int main() 6 { 7 int n,m; 8 dp[2]=3; 9 dp[1]=2; 10 for(int i=3;i<41;i++) 11 dp[i]=dp[i-1] 阅读全文

posted @ 2016-04-25 17:15 青春的梦想付诸行动 阅读(132) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页

导航