摘要: 不用指针优化就703MS 指针优化93MS注意要用int64 因为过程中可能会相乘溢出#include <stdio.h>#include <iostream>#include <stdlib.h>#include <string.h>const int INF = 2100000000 ;int dir[5] = {0,2, 3, 5, 7};int p[5] = {0,1, 1, 1, 1};__int64 table[6000];int main(){ int cnt = 1, i, j, n, pos; __int64 min ; tab 阅读全文
posted @ 2013-03-08 16:47 April_Tsui 阅读(148) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1596floyd 貌似超时 (代码转载)View Codedijkstra + heap优化这题因为是不知道有多少个query 所以直接用dij 应该会更快View Code #include <stdio.h>#include <string.h>const int MAXN = 1010;double map[MAXN][MAXN], dis[MAXN];bool set[MAXN];int size = 0, heap[MAXN], pl[MAXN], n;void exchan 阅读全文
posted @ 2013-03-08 11:38 April_Tsui 阅读(184) 评论(0) 推荐(0) 编辑