首页
CALL1CE
取消

晴问-关键路径长度 & 关键活动 & 关键路径

关键路径长度 #include<iostream> #include<vector> #include<stack> #include<queue> #include<cstdio> #include<cstring> using namespace std; const int maxn = 110; struct...

PAT-Hashing & Consecutive Factors & Come on! Let's C & A Delayed Palindrome

A1078 Hashing #include<iostream> #include<vector> #include<cstdio> #include<cmath> #include<unordered_map> using namespace std; const int maxn = 100000; bool primeTab...

PAT-Rational Arithmetic & Prime Factors

A1088 Rational Arithmetic #include<iostream> #include<vector> #include<cstdio> #include<string> using namespace std; typedef long long LL; vector<LL> numerator(2); ve...

PAT-Sum of Number Segments & Counting Ones & Rational Sum & Scanf()输入格式表

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...

PAT-LCA in a Binary Tree

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...

PAT-Heaps & Is It a Complete AVL Tree & Complete Binary Tree & Lowest Common Ancestor

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; ...

PAT-Online Map & Birds in Forest

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(_...

PAT-All Roads Lead to Rome & Topological Order & Family Property

A1087 All Roads Lead to Rome #include<iostream> #include<vector> #include<string> #include<unordered_map> using namespace std; //邻接表中需要存的数据: struct node { int v, cost;/...

PAT-Emergency & Gas Station

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...

PAT-Forwards on Weibo

A1076 Forwards on Weibo #include<iostream> #include<vector> #include<algorithm> #include<cstdio> using namespace std; const int maxn = 1010; vector<vector<int>>...