关键路径长度 #include<iostream> #include<vector> #include<stack> #include<queue> #include<cstdio> #include<cstring> using namespace std; const int maxn = 110; struct...
A1078 Hashing #include<iostream> #include<vector> #include<cstdio> #include<cmath> #include<unordered_map> using namespace std; const int maxn = 100000; bool primeTab...
A1088 Rational Arithmetic #include<iostream> #include<vector> #include<cstdio> #include<string> using namespace std; typedef long long LL; vector<LL> numerator(2); ve...
A1104 Sum of Number Segments #include<iostream> #include<vector> #include<cstdio> using namespace std; const int maxn = 100010; vector<long double> num(maxn); vector<lo...
A1151 LCA in a Binary Tree #include<iostream> #include<vector> #include<cstdio> using namespace std; const int maxn = 10010; vector<int> in(maxn); vector<int> pre(ma...
A1147 Heaps #include<iostream> #include<vector> #include<cstdio> using namespace std; const int maxn = 1010; int n, m; vector<int> tree(maxn, -1); vector<int> post; ...
A1111 Online Map #include<iostream> #include<vector> #include<cstdio> using namespace std; struct node { int v,len, time; node(int _v, int _len, int _time) : v(_v), len(_...
A1087 All Roads Lead to Rome #include<iostream> #include<vector> #include<string> #include<unordered_map> using namespace std; //邻接表中需要存的数据: struct node { int v, cost;/...
A1003 Emergency #include<iostream> #include<vector> #include<queue> using namespace std; struct node { int v, dis;//目标节点编号,距离 node(int _v, int _dis) :v(_v), dis(_dis) {} }; con...
A1076 Forwards on Weibo #include<iostream> #include<vector> #include<algorithm> #include<cstdio> using namespace std; const int maxn = 1010; vector<vector<int>>...