- 博客(7)
- 收藏
- 关注
原创 1099. Build A Binary Search Tree (30)
这个写的有点麻烦了,最后对应用的map 其实中序遍历的时候边遍历边写入会简洁很多 #include #include #include #include #include using namespace std; const int maxn = 1e3 + 10; int tree[maxn][2], n, s[maxn]; vectorinorder, levelorder; mapm;
2018-03-26 22:50:24 122
原创 1097. Deduplication on a Linked List (25)
好久没来更新了,之前买了晴神宝典,推荐给大家,专门针对PAT的书,非常管用,最近感觉进步还可以,思路清晰多了 好了,然后这条题目,比较简单吧,静态链表,然后分割,我用了两个vector存的两个分割后的链表,map用来做已出现的数字的标记(记得取相反的),最后输出一下就好 #include #include #include using namespace std; const int maxn
2018-03-22 19:53:26 164
原创 1084. Broken Keyboard (20)
two points应用 #include #include #include #include using namespace std; string a, b; vectorss; int main() { getline(cin, a); getline(cin, b); for (int i = 0; i = 'a'&&a[i] <= 'z')a[i] -= 32; for (i
2018-03-12 20:42:55 112
原创 1095. Cars on Campus (30)
#include #include #include #include using namespace std; const int maxn = 1e4 + 10; int n, k; struct car { char num[10]; int hh, mm, ss; int flag; int intime, outtime; void read() { scanf("%s %d:
2018-03-12 20:08:05 116
原创 1080. Graduate Admission (30)
二次更新正确答案#include<iostream> #include<algorithm> #include<vector> using namespace std; const int maxn = 1e5 + 10; struct point { int id, ge, gi, fg; int choice[5]; bool operator<...
2018-03-05 18:33:42 173
原创 1079. Total Sales of Supply Chain (25)
bfs遍历一下就行double读入用lf才能读入,否则会出错#include<iostream> #include<algorithm> #include<vector> #include<queue> using namespace std; const int maxn = 1e5 + 10; vector<int>a[maxn]; ...
2018-03-05 15:51:25 124
原创 1074. Reversing Linked List (25)
这个题目很经典,有两个点,一个是地址给出来怎么连接到一起,另一个是每k个数翻转#include<iostream> #include<algorithm> using namespace std; const int maxn = 1e5 + 10; int w[maxn], nt[maxn],f[maxn]; int s, n, k, x, cnt; int main()...
2018-03-02 11:27:07 191
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人