2012年4月11日
摘要: 984MS,真险!Bellman_Frod效率不高啊!/* Name: 最短路(bellmanFord) Copyright: Author: Try_86 Date: 11/04/12 21:16 Description: */#include <cstdio>#include <iostream>using namespace std;const int N = 1005;const int M = 200005;const int MAX = 1000000000;int dis[N], cs[N];struct edge { int u; int v; ... 阅读全文
posted @ 2012-04-11 21:19 Try86 阅读(283) 评论(0) 推荐(0)
摘要: 843MS,差点就超时!/* Name: 最短路(bellmanFord) Copyright: Author: Try_86 Date: 11/04/12 20:39 Description: 建反向图,求终点到各点的最短路 */#include <cstdio>#include <iostream>using namespace std;const int N = 1005;const int M = 40005;const int MAX = 1000000000;int dis[N];struct edge { int u; int v; int w;}... 阅读全文
posted @ 2012-04-11 20:45 Try86 阅读(192) 评论(0) 推荐(0)
摘要: /* Name: 最短路(Bellman_Ford) Copyright: Author: Try_86 Date: 11/04/12 19:56 Description: */#include <cstdio>#include <iostream>using namespace std;const int N = 205;const int M = 20005;const int MAX = 1000000000;int dis[N];struct edge { int u; int v; int w;}e[M];void init(int vs, int s... 阅读全文
posted @ 2012-04-11 20:04 Try86 阅读(193) 评论(0) 推荐(0)
摘要: /* Name: 最短路(bellmanFord) Copyright: Author: Try_86 Date: 11/04/12 19:03 Description: 求一对顶点间的最短路 注意:建立反向边时两端点的顺序 */#include <cstdio>#include <climits>#include <iostream>using namespace std;const int N = 205;const int M = 2005;const int MAX = 100000000;int dis[N]; struct edge {//边结点 阅读全文
posted @ 2012-04-11 19:40 Try86 阅读(279) 评论(0) 推荐(0)
摘要: /* Author: Try_86 Date: 11/04/12 18:28 Description: 字符串处理 */#include <cstdio>#include <cstring>#include <iostream>using namespace std;char pat[6], str[81];struct node { char c; int num;}s[5];void solve() { int lenP = strlen(pat); int lenS = strlen(str); for (int i=0; i<5; ++i) s 阅读全文
posted @ 2012-04-11 18:30 Try86 阅读(219) 评论(0) 推荐(0)
摘要: /* Name: 计算几何 Author: Try_86 Date: 11/04/12 18:07 Description: 求x,y的最大最小值即可 */#include <cstdio>#include <climits>#include <iostream>using namespace std;int main() { int x, y, minx, miny, maxx, maxy; while (scanf("%d%d", &x, &y), x!=0 || y!=0){ minx = INT_MAX; miny 阅读全文
posted @ 2012-04-11 18:10 Try86 阅读(186) 评论(0) 推荐(0)
摘要: /** java大数*/import java.util.Scanner;import java.math.BigInteger;public class hdu1316{ public static void main(String args[]) { BigInteger []fib = new BigInteger[500]; fib[1] = BigInteger.ONE; fib[2] = new BigInteger("2"); for (int i=3; i<500; ++i) { ... 阅读全文
posted @ 2012-04-11 17:46 Try86 阅读(172) 评论(0) 推荐(0)