自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 windows使用Navicat远程连接虚拟机mysql 报10038错误

连接数据库出现10038错误

2022-05-25 16:20:10 452 1

原创 团体程序设计天梯赛 L2-025 分而治之

并查集 先记录下每条路然后记录每个方案被攻打的城市如果这条路的双方都没被攻打就将他们连接#include<bits/stdc++.h>using namespace std;int vis[10006];void init(){ for(int i=1;i<=10005;i++){ vis[i]=0; }}int main(){ int n,m; cin>>n>>m; vector<pair<int,int> &g

2022-05-18 21:58:33 259 1

原创 L2-024 部落

并查集#include<bits/stdc++.h>using namespace std;int fa[10005];int n;void init(){ for(int i=1;i<=10004;i++) fa[i]=i;}int find(int x){ int k=x; while(x!=fa[x]) x=fa[x]; while(k!=x){ int l=fa[x]; fa[k]=x; k=l; } return x;}void.

2022-05-18 21:56:15 191

原创 团体程序设计天梯赛 L2-023 图着色问题

记录每个顶点后按给出的颜色一次次遍历看是否有重复值得注意的是要是使用到的颜色超过或者少于给的的颜色那么该方案也不行#include<bits/stdc++.h>using namespace std;int main(){ int v,e,k; cin>>v>>e>>k; vector<pair<int,int> >a; for(int i=0;i<e;i++){ int x,y; cin>&g

2022-05-18 21:55:08 165

原创 团体程序设计天梯赛 L2-022 重排链表

静态链表

2022-05-18 21:53:04 400

原创 团体程序设计天梯赛 L2-019 悄悄关注

#include<bits/stdc++.h>using namespace std;bool cmp(string s,string k){ return s<k;}int main(){ map<string,int>mp; int n; cin>>n; for(int i=0;i<n;i++){ string s; cin>>s; mp[s]=1; } int k; cin>>k; vect.

2022-05-18 20:12:37 120

原创 团体程序设计天梯赛 L2-017 人以群分

对半

2022-05-17 18:22:22 194

原创 团体程序设计天梯赛 L2-016 愿天下有情人都是失散多年的兄妹

二叉树的遍历

2022-05-17 18:19:40 298

原创 团体程序设计天梯赛 L2-015 互评成绩

#include<bits/stdc++.h>using namespace std;bool cmp(double a,double b){ return a>b;}int main(){ int n,k,m; cin>>n>>k>>m; double su=0; double max=0,min=100; vector<double>a; for(int i=0;i<n;i++){ su=0; max.

2022-05-17 18:17:43 158

原创 团体程序设计天梯赛 L2-013 红色警报

失去本身就独立打城市对连通性并没有影响 因此可先判断该城市是否独立#include<bits/stdc++.h>using namespace std;int fa[500];int vis[501];int ff[501]={0};int lost[501]={0};int find(int x){ while(x!=fa[x]) x=fa[x]; return x;}void un(int x,int y){ int fx=find(x); int fy=f.

2022-05-17 18:17:13 252

原创 团体程序设计天梯赛 L2-010 排座位

并查集#include<bits/stdc++.h>using namespace std;int fa[500];int vis[501];int ff[501]={0};int lost[501]={0};int find(int x){ while(x!=fa[x]) x=fa[x]; return x;}void un(int x,int y){ int fx=find(x); int fy=find(y); fa[fx]=fy;} int

2022-05-17 18:15:50 101

原创 团体程序设计天梯赛 L2-009 抢红包

使用struct存储数据后使用sort函数排序#include<bits/stdc++.h>using namespace std;struct node{ int bh; double money=0; int gs=0;};bool cmp(struct node a,struct node b){ if(a.money!=b.money) return a.money>b.money; else if(a.gs!=b.gs) return a.gs>

2022-05-17 18:15:05 97

原创 团体程序设计天梯赛 L2-005 集合相似度

set

2022-05-17 18:14:05 111

原创 团体程序设计天梯赛 L2-003 月饼

贪心

2022-05-17 18:13:12 111

原创 团体程序设计天梯赛 L2-002 链表去重

模拟

2022-05-17 18:12:05 100

原创 团体程序设计天梯赛 L2-001 紧急救援

dij

2022-05-17 18:11:03 206

原创 团体程序设计天梯赛 L2-026 小字辈

不以祖先为跟节点 逆向建立树后使用dfs寻找最深的就可#include<bits/stdc++.h>using namespace std;set<int>bb[100001];vector<int>son[100001];int vis[100001]={0};int maxdeep=1;void dfs(int nowperson,int deep){ bb[deep].insert(nowperson); maxdeep=max(deep,m.

2022-05-15 23:22:31 139

原创 团体程序设计天梯赛 L2-031

使用dfs进行深度优先搜索一直走到不能走为止#include <bits/stdc++.h>using namespace std;vector<int>ma[100005];bool vis[100005]={0};int n;long long maxdeep=0;int door=0;void dfs(int start,int deep){ if(maxdeep<deep){ maxdeep=deep; door=start; } f.

2022-05-15 23:18:30 119

原创 团体程序设计天梯赛 L2-041 插松枝

理解题意就很好做#include<bits/stdc++.h>using namespace std;int main(){ int n,m,k; cin>>n>>m>>k; queue<int>tsq; stack<int>xhz; for(int i=0;i<n;i++){ int x; cin>>x; tsq.pus

2022-05-15 23:16:48 378 1

空空如也

空空如也

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

TA关注的人

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