Liyuan wanted to rewrite the famous book "Journey to the West" ("Xi You Ji" in Chinese pinyin). In the original book, the Monkey King Sun Wukong was trapped by the Buddha for 500 years, then he was rescued by Tang Monk, and began his j…
Silver Cow Party One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roads connects pairs of farms; road…
本文章为原创文章,转载请注明,欢迎评论和改正. 一,分析 之前所用的直接通过HTML中的元素值来爬取一些网页上的数据,但是一些比较敏感的数据,很多正规网站都是通过json数据存储,这些数据通过HTML元素是爬取不到的,所以只能通过json数据的api接口来爬取数据. 二,网站处理 1,打开去哪儿网的网站https://train.qunar.com/,找到火车票查询,输入起点终点和日期,查询. 2,右击打开审查元素,点击network 3,刷新网页,找到XHR,点击链接 4,找到s2sBeanL…
说实话,这题真第一次见,学到了不少有趣的东西,因吹丝汀!! 思路:因为不可能同时并行和相遇(我也不知道为啥,等我会证明了就来说说) 所以正向建边再反向建边,拓扑排序+dp求最下长路,记录下最大的就是解 高中生的OI题好难呀 #include<iostream> #include<vector> #include<cstring> #include<cstdio> #include<queue> #include<algorithm>…
该算法详解请看   https://www.cnblogs.com/tanky_woo/archive/2011/01/17/1937728.html 单源最短路   当图中存在负权边时 迪杰斯特拉就不能用了 该算法解决了此问题 时间复杂度O(nm) 注意   图中含有负圈时不成立.当判定存在负圈时,这只说明s可以到达一个负圈,并不代表s到每个点的最短路都不存在. 另外,如果图中有其他负圈但是s无法达到这个负圈,该算法也无法找到,解决方法加一个节点(还不会...) 该算法可以用 队列 优化 名为…
import arcpy >>> import arcpy ... gd="D:/项目/shp/Pipe.gdb/ZK/GDPOINT" ... gx="D:/项目/shp/Pipe.gdb/ZK/GDLINE" ... cursorGd=arcpy.da.UpdateCursor(gd,["物探点号","地面高程"]) ... cursorGx=arcpy.da.UpdateCursor(gx,["…
NX9+VS2012 #include <uf.h> #include <uf_curve.h> UF_initialize(); //起点 ]; ArcStartPoint[] = 0.0; ArcStartPoint[] = 0.0; ArcStartPoint[] = 0.0; tag_t ArcStartPointTag = NULL_TAG; UF_CURVE_create_point(ArcStartPoint, &ArcStartPointTag); //终点…
Tree and Permutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description There are N vertices connected by N−1 edges, each edge has its own length.…
单源最短路 所有边权都是正数 朴素Dijkstra算法(稠密图) #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int N=510; int n,m; int g[N][N]; int dist[N]; bool st[N]; int dijkstra(){ memset(dist,0x3f,sizeof…
题目链接:http://poj.org/problem?id=1523 SPF:A Single Point of Failure也就是割点(一个点导致网络之间的不连通),由于给出的图是无向图,所以只要连通就一定强连通.要求连通分支的数量就是要求请联通分支的数量,我们可想到tarjan求强连通的步骤,只要一群结点的low值相同他们就是属于同一个SCC(Strongly Connected Component),所以我们只要对于每一个割点,记录一下这个点所到的其他结点的不相同的low值的数量,就是…