自定义博客皮肤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)
  • 收藏
  • 关注

原创 Pat模板总结

格式化输出数字 //格式化输出数字 int len = s.size(); for(int i = 0; i < len; i++) { cout << s[i]; //先输出当前位置的数字 if(s[i] == '-') continue; //负号后面不输出逗号 if((i + 1) % 3 == len % 3 && i != len...

2020-03-18 19:11:04 216

原创 PAT A 1013[图的遍历]

需要修的高速公路条数是连通块个数减一 城市被占领,可以在DFS和DFSTrave函数中,对该顶点跳过处理 #include <bits/stdc++.h> using namespace std; const int maxn = 1010; int n, m, k, city, cnt; vector<int> g[maxn]; bool vis[maxn]; void ...

2020-03-16 22:12:49 94

原创 PAT A1025[排序]

对每个考场进行排序,需要用sum进行分隔 仔细审题,题目不难 #include <bits/stdc++.h> using namespace std; const int maxn = 30010; struct node { char name[15]; int location, lrank; int score; node() { ...

2020-03-16 12:23:02 96

原创 PAT A 1034[图的遍历/并查集]

注意点:编号转换函数;DFS中记录整个连通图的点权之和,总边权就是总点权的一半。 #include <bits/stdc++.h> using namespace std; const int maxn = 2010; unordered_map<int, string> idTostr; //编号->名字 unordered_map<string, int&g...

2020-03-13 20:30:10 208 1

原创 PAT A1080 Graduate Admission[排序]

加粗样式这道题需要在学校录取的数组里面存放学生的结构体,而不是只存放id。如果存放id,1、2点会过不了。具体我也不知道为什么,还需要有好心人指点下。 #include <bits/stdc++.h> using namespace std; struct stu { int id, ge, gi, gf, r; int choice[6]; //学生的志愿 }; bo...

2020-03-05 09:50:26 158

原创 PAT A1097:链表题

#include #include #include using namespace std; struct node {     int key;     int next; } add[100005]; int have[10005] = {0}; int main() {     int n, s...

2020-02-28 19:42:28 187

空空如也

空空如也

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

TA关注的人

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