自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dai

  • 博客(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&lt;iostream&gt; #include&lt;algorithm&gt; #include&lt;vector&gt; using namespace std; const int maxn = 1e5 + 10; struct point { int id, ge, gi, fg; int choice[5]; bool operator&lt;...

2018-03-05 18:33:42 173

原创 1079. Total Sales of Supply Chain (25)

bfs遍历一下就行double读入用lf才能读入,否则会出错#include&lt;iostream&gt; #include&lt;algorithm&gt; #include&lt;vector&gt; #include&lt;queue&gt; using namespace std; const int maxn = 1e5 + 10; vector&lt;int&gt;a[maxn]; ...

2018-03-05 15:51:25 124

原创 1074. Reversing Linked List (25)

这个题目很经典,有两个点,一个是地址给出来怎么连接到一起,另一个是每k个数翻转#include&lt;iostream&gt; #include&lt;algorithm&gt; 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关注的人

提示
确定要删除当前文章?
取消 删除