自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 1155 Heap Paths (30分)

比较简单。。。。考试要是都考这样的100分真的是轻轻松松。。#include<iostream>#include<vector>using namespace std;int n;vector<vector<int>> ans;vector<int> temp;bool checkmax(vector<int>...

2020-02-28 17:40:30 104

原创 1154 Vertex Coloring (25分)

题目意思就是说要求判断给的图里每个相邻点的颜色是不是有相同的,没有的话输出颜色的数目,否则输出NO,读懂了题意就不难。#include<iostream>#include<vector>#include<set>using namespace std;int n, m,v1,v2,k,color[10005];vector<pair<in...

2020-02-28 17:09:41 97

原创 1151 LCA in a Binary Tree (30分)

不用建树!不用建树!!基本上碰到求LCA的都可以这么做出来。#include<iostream>#include<vector>#include<map>#include<algorithm>using namespace std;int m, n,temp,u,v;int main() { cin >> m >&g...

2020-02-28 13:54:40 166

原创 1138 Postorder Traversal (25分)

因为数组可能过大而且我们只需要输出第一个,所以我们可以截取左边的部分,后面的就不用考虑了(注意根只有右孩子的情况,可以把根舍去,把原根的右孩子作为根)#include<iostream>#include<vector>using namespace std;int n;vector<int> pre, in;bool flag;void trave...

2020-02-26 19:42:03 137

原创 1131 Subway Map (30分) 自叹弗如

还是深度搜索吧,参考了柳婼大神的代码(永远的神),反正一开始我是一点头绪都没有的(智商真的不够用啊)。不过深度搜索按理说运算数量级是比较大的,对于多次查询来说的时间应该不够才对。。。还有就是对处理中转站的问题,就是对边的处理,每个边都标记好属于哪条线路,输出的时候遇到线路不一样就输出一次,以上。#include<iostream>#include<vector>usi...

2020-02-25 17:37:58 108

原创 1123 Is It a Complete AVL Tree (30分)

#include<iostream>#include<algorithm>#include<vector>#include<queue>#include<vector>using namespace std;int n, temp,cnt;bool flag;struct node { int value,height;...

2020-02-24 17:42:28 196

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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