
PAT【甲】
lemnHacker
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
1001 A+B Format
原题目地址:https://pintia.cn/problem-sets/994805342720868352/problems/994805526272000000 #include<iostream> #include<iomanip> #include<cmath> using namespace std; int main() { int a,b...原创 2019-01-23 15:20:35 · 131 阅读 · 0 评论 -
1149 Dangerous Goods Packaging
#include<iostream> #include<set> using namespace std; int arr[1001]; bool app[100001]={false}; int main() { int n,m; cin>>n>>m; set<int> inComps; for(int ...原创 2019-03-01 23:00:46 · 196 阅读 · 0 评论 -
148 Werewolf - Simple Version
#include<iostream> using namespace std; int words[101]; int status[101]; bool func(int ii,int jj,int n) { status[ii]=-status[ii]; status[jj]=-status[jj]; int t=0; int tt=0; for(i...原创 2019-03-01 21:08:11 · 190 阅读 · 0 评论 -
1146 Topological Order
#include<vector> #include<iostream> using namespace std; bool func(vector<int> arr,vector<int> ins,vector<vector<int> >&adjs) { for(int i=0;i<arr.siz.原创 2019-03-01 15:56:41 · 193 阅读 · 0 评论 -
1145 Hashing - Average Search Time
查询次数参考https://blog.csdn.net/qq_34594236/article/details/79814881 #include<iostream> #include<cmath> #include<vector> #include<stdio.h> using namespace std; int getprim...原创 2019-03-01 13:53:40 · 248 阅读 · 0 评论 -
1138 Postorder Traversal
#include<iostream> using namespace std; int A[50000]; int B[50000]; int main() { int n; cin>>n; for(int i=0;i<n;++i) { cin>>A[i]; } for(int i=0;i<n;++i) { cin>...原创 2019-03-01 12:51:17 · 202 阅读 · 0 评论 -
1144 The Missing Number
#include<iostream> #include<algorithm> using namespace std; int main() { int A[100000]; int n; cin>>n; for(int i=0;i<n;++i) { cin>>A[i]; } sort(A,A+n); int k=1;...原创 2019-03-01 10:21:18 · 143 阅读 · 0 评论 -
1143 Lowest Common Ancestor
问题的关键,记住各个节点的树高。另外采用new动态生成新的节点容易超时,采用数组预先分配节约时间。 #include<iostream> using namespace std; struct Node{ int value; Node * lchild; Node* rchild; Node* root; int height; Node(){ value ...原创 2019-03-01 10:06:21 · 249 阅读 · 0 评论 -
1142 Maximal Clique
#include<iostream> #include<vector> #include<algorithm> #include<set> using namespace std; bool flag[201][201]; void isMaxClique(vector<int> Q,vector<int&g...原创 2019-03-01 10:04:37 · 173 阅读 · 0 评论 -
1140 Look-and-say Sequence
#include<iostream> #include<map> #include<vector> #include<algorithm> using namespace std; class Record{ public: string school; double scores; int num; // int rank; ...原创 2019-02-28 09:58:15 · 204 阅读 · 0 评论 -
1002 A+B for Polynomials
This time, you are supposed to find A+B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the informa...原创 2019-01-23 15:55:14 · 233 阅读 · 0 评论 -
【PAT】1108 Finding Average
#include<iostream> #include<string> #include<iomanip> using namespace std; bool isLegalNumber(string str,double & value) { bool isNegative=false; bool hasDot=false; do...原创 2019-02-27 12:14:18 · 134 阅读 · 0 评论