洛谷 P2078 朋友

2023-05-16

 

思路是分为两个并查集,然后计算下男女人数,然后直接比较,选小的

代码写的有点麻烦好像,交上去也没过,虽然结果对了

其实第一遍已经发现有问题了,因为比较的时候不小心把小于号打成大于号,然后就输出了朋友较多的男方,但是结果居然是5,交上去果然错了,后面第二遍代码就继续试了下男方,是对的,3,但是交上去还是unexpected 30.

想想好像是要考虑负号,毕竟数组没有a[-1],改成了

combine_2(abs(x2),abs(y2));

加了绝对值,交上去还是错的,有点烦了

实在想不出有什么错的,几分钟以后,我无聊画了个图,哦豁,我突然发现人家男女不一定是朋友啊,因为小明小红是朋友,但如果有一方结成了n对朋友,但那一坨人就是和小明不是朋友,那用cnt计数是不作效的,到头来也只有一对,所以记完数还要确保他们两坨人里面有小明和小红,否则就只有一对。第三次,我又双叒叕没过,还是只对三个测试点,明明测试了好多种情况都没问题了。 

洗完澡回来,过了很久很久。。我又意识到如果关系连接,就是相当于集合合并的时候,cnt计数+1,但是只检查1或-1在不在里面是不够的,如果有好几个大集合,但是他们没有合并,但是每回小集合合并成大集合的时候cnt都有+1,所以如果只有某一个或者几个大集合和1合并了是不行的,那样cnt所统计的是所有大集合里的人数(也包括不存在1的大集合)。那么还是得回到根节点写代码啊。

重新理下思路:

1.还是分为两个并查集,先把关系连接;

2.再从两个根节点出发,遍历查找各有多少个结点;

3.比较结点个数,输出较小的。


这里,由于连接的时候并不是按理想的方式连的,所以他们的根节点不一定是1
那还是得查找该元素所在的集合里有没有1
那就重新写个find函数

下面就是统计个数的一段代码,其余部分代码很简单,照着并查集的模板抄就可以了

    //从两个根节点开始遍历,统计所含节点个数
	//不对,根节点不一定是1,找1的根节点,然后统计根节点和1的根节点相同的数的个数 
	root=find(1,0);
	for(int i=2;i<=N;i++)
	{
		int k=find(i,0);
		if(k == root) cnt_1++;
	}
	root=find(1,1);//因为用过绝对值函数,所以不是从-1而是从1开始找 
	for(int i=2;i<=M;i++)
	{
		int k=find(i,1);
		if(k == root) cnt_2++;
	}
	
	if(cnt_1>cnt_2) cout<<cnt_2;
	else cout<<cnt_1;

//上面是主函数内的内容
//下面是find函数

int find(int x,int k)
{
	int x_root=x;
	while(parent[x_root][k]!=0)
	{
		x_root=parent[x_root][k];
	}
	return x_root;//递归找根 
}

最开始的时候也不知道怎么想的,改了四个小时多,人都傻了。

下次想清楚再写,不要又是编译错误交上去没过再来删删改改,洗完澡回来思路清楚了重新写一下虽然也还是有点小问题,但是稍微改改就过了。之前没想清楚就做,脑子一片混乱的,漏这漏那,就忽略了好多条件和特殊情况,考虑不全面。

以后做题思路:

1.想清楚用什么方法,要用到哪些方面的算法什么的

2.高屋建瓴,模块化思维,这个还是用的不错,函数用的挺多的,东西没有全挤在主函数里

3.要着重注意哪里,哪个细节或者是哪个题目的操作条件什么的,细节理不清就画图!画图真的有用

4.考虑特殊情况

第一次:unexpected 30

#include<iostream>
using namespace std;

#define MAX_TREE_SIZE 20010
int parent_1[MAX_TREE_SIZE]={0};
int deep_1[MAX_TREE_SIZE]={0};
int parent_2[MAX_TREE_SIZE]={0};
int deep_2[MAX_TREE_SIZE]={0};
int cnt_1=1,cnt_2=1;//一开始有小明和小红 
void initial(int n)
{
	for(int i=0;i<n;i++)
	{
		parent_1[i]=0;
		deep_1[i]=0;
		parent_2[i]=0;
		deep_2[i]=0;
	}
}

int find_root_1(int x)
{
	int x_root=x;
	while(parent_1[x_root]!=0)
	{
		x_root=parent_1[x_root];
	}
	return x_root;
}

void combine_1(int x,int y)
{
	int x_root=find_root_1(x);
	int y_root=find_root_1(y);
	if(x_root!=y_root)
	{
		if(deep_1[x_root]>deep_1[y_root])
		{
			parent_1[y_root]=x_root;
		}
		else if(deep_1[x_root]<deep_1[y_root])
		{
			parent_1[x_root]=y_root;
		}
		else
		{
			parent_1[x_root]=y_root;
			deep_1[y_root]++;
		}
	}
	cnt_1++;
}

int find_root_2(int x)
{
	int x_root=x;
	while(parent_2[x_root]!=0)
	{
		x_root=parent_2[x_root];
	}
	return x_root;
}

void combine_2(int x,int y)
{
	int x_root=find_root_2(x);
	int y_root=find_root_2(y);
	if(x_root!=y_root)
	{
		if(deep_2[x_root]>deep_2[y_root])
		{
			parent_2[y_root]=x_root;
		}
		else if(deep_2[x_root]<deep_2[y_root])
		{
			parent_2[x_root]=y_root;
		}
		else
		{
			parent_2[x_root]=y_root;
			deep_2[y_root]++;
		}
		cnt_2++;
	}
}

int main()
{
	int N,M,P,Q;//A公司有N名员工,其中有P对朋友关系。B公司有M名员工,其中有Q对朋友关系
	cin>>N>>M>>P>>Q;
	
	int x1,y1;
	for(int i=0;i<P;i++)
	{
		cin>>x1>>y1;
		combine_1(x1,y1);
	}
	int x2,y2;
	for(int i=0;i<Q;i++)
	{
		cin>>x2>>y2;
		combine_2(x2,y2);
	}
	
	if(cnt_1>cnt_2)
	{
		cout<<cnt_2;
	}
	else
	{
		cout<<cnt_1;
	}
}

第二次:unexpected 30

#include<iostream>
using namespace std;

#define MAX_TREE_SIZE 20010
int parent_1[MAX_TREE_SIZE]={0};
int deep_1[MAX_TREE_SIZE]={0};
int parent_2[MAX_TREE_SIZE]={0};
int deep_2[MAX_TREE_SIZE]={0};
int cnt_1=1,cnt_2=1;//一开始有小明和小红 
void initial(int n)
{
	for(int i=0;i<n;i++)
	{
		parent_1[i]=0;
		deep_1[i]=0;
		parent_2[i]=0;
		deep_2[i]=0;
	}
}

int find_root_1(int x)
{
	int x_root=x;
	while(parent_1[x_root]!=0)
	{
		x_root=parent_1[x_root];
	}
	return x_root;
}

void check_1(int x,int y)
{
	int x_root=find_root_1(x);
	int y_root=find_root_1(y);
	if(x_root!=y_root) cnt_1++;
}

void combine_1(int x,int y)
{
	check_1(x,y);
	//结成朋友就直接+1不行,因为朋友的朋友也是朋友,所以要先检查一下两人是否已在同一集合
	int x_root=find_root_1(x);
	int y_root=find_root_1(y);
	if(x_root!=y_root)
	{
		if(deep_1[x_root]>deep_1[y_root])
		{
			parent_1[y_root]=x_root;
		}
		else if(deep_1[x_root]<deep_1[y_root])
		{
			parent_1[x_root]=y_root;
		}
		else
		{
			parent_1[x_root]=y_root;
			deep_1[y_root]++;
		}
	}
}

int find_root_2(int x)
{
	int x_root=x;
	while(parent_2[x_root]!=0)
	{
		x_root=parent_2[x_root];
	}
	return x_root;
}

void check_2(int x,int y)
{
	int x_root=find_root_2(x);
	int y_root=find_root_2(y);
	if(x_root!=y_root) cnt_2++;
}

void combine_2(int x,int y)
{
	check_2(x,y);
	int x_root=find_root_2(x);
	int y_root=find_root_2(y);
	if(x_root!=y_root)
	{
		if(deep_2[x_root]>deep_2[y_root])
		{
			parent_2[y_root]=x_root;
		}
		else if(deep_2[x_root]<deep_2[y_root])
		{
			parent_2[x_root]=y_root;
		}
		else
		{
			parent_2[x_root]=y_root;
			deep_2[y_root]++;
		}
	}
}

int main()
{
	int N,M,P,Q;//A公司有N名员工,其中有P对朋友关系。B公司有M名员工,其中有Q对朋友关系
	cin>>N>>M>>P>>Q;
	
	int x1,y1;
	for(int i=0;i<P;i++)
	{
		cin>>x1>>y1;
		combine_1(x1,y1);
	}
	int x2,y2;
	for(int i=0;i<Q;i++)
	{
		cin>>x2>>y2;
		combine_2(x2,y2);
	}
	
	if(cnt_1>cnt_2)
	{
		cout<<cnt_2;
	}
	else
	{
		cout<<cnt_1;
	}

第三次:

#include<iostream>
#include<cmath>
using namespace std;

#define MAX_TREE_SIZE 20010
int parent_1[MAX_TREE_SIZE]={0};
int deep_1[MAX_TREE_SIZE]={0};
int parent_2[MAX_TREE_SIZE]={0};
int deep_2[MAX_TREE_SIZE]={0};
int cnt_1=1,cnt_2=1;//一开始有小明和小红 
int checkkk=1;//确保小明小红都在集合里 
int x1_root,x2_root;//男女并查集的根结点 
void initial(int n)
{
	for(int i=0;i<n;i++)
	{
		parent_1[i]=0;
		deep_1[i]=0;
		parent_2[i]=0;
		deep_2[i]=0;
	}
}

int find_root_1(int x)
{
	int x_root=x;
	while(parent_1[x_root]!=0)
	{
		x_root=parent_1[x_root];
	}
	return x_root;
}

void check_1(int x,int y)
{
	int x_root=find_root_1(x);
	int y_root=find_root_1(y);
	if(x_root!=y_root) cnt_1++;
}

void combine_1(int x,int y)
{
	check_1(x,y);
	//结成朋友就直接+1不行,因为朋友的朋友也是朋友,所以要先检查一下两人是否已在同一集合
	int x_root=find_root_1(x);
	int y_root=find_root_1(y);
	if(x_root!=y_root)
	{
		if(deep_1[x_root]>deep_1[y_root])
		{
			parent_1[y_root]=x_root;
		}
		else if(deep_1[x_root]<deep_1[y_root])
		{
			parent_1[x_root]=y_root;
		}
		else
		{
			parent_1[x_root]=y_root;
			deep_1[y_root]++;
		}
	}
	x1_root=x_root;
}

int find_root_2(int x)
{
	int x_root=x;
	while(parent_2[x_root]!=0)
	{
		x_root=parent_2[x_root];
	}
	return x_root;
}

void check_2(int x,int y)
{
	int x_root=find_root_2(x);
	int y_root=find_root_2(y);
	if(x_root!=y_root) cnt_2++;
}

void combine_2(int x,int y)
{
	check_2(x,y);
	int x_root=find_root_2(x);
	int y_root=find_root_2(y);
	if(x_root!=y_root)
	{
		if(deep_2[x_root]>deep_2[y_root])
		{
			parent_2[y_root]=x_root;
		}
		else if(deep_2[x_root]<deep_2[y_root])
		{
			parent_2[x_root]=y_root;
		}
		else
		{
			parent_2[x_root]=y_root;
			deep_2[y_root]++;
		}
	}
	x2_root=x_root;
}

void check(int xiaoming,int x1_root,int xiaohong,int x2_root)
{
	int x_root,y_root;
	x_root=find_root_1(xiaoming);
	y_root=find_root_1(x1_root);
	if(x_root!=y_root)
		 checkkk=0;
	x_root=find_root_1(xiaohong);
	y_root=find_root_1(x2_root);
	if(x_root!=y_root)
		 checkkk=0;
}

int main()
{
	int N,M,P,Q;
	//A公司有N名员工,其中有P对朋友关系
	//B公司有M名员工,其中有Q对朋友关系
	cin>>N>>M>>P>>Q;
	
	int x,y;
	for(int i=0;i<P;i++)//将A公司P对关系结合 
	{
		cin>>x>>y;
		combine_1(x,y);
	}
	for(int i=0;i<Q;i++)//将B公司Q对关系结合 
	{
		cin>>x>>y;
		combine_2(abs(x),abs(y));
	}
	
	check(1,x1_root,abs(-1),x2_root);//检查两堆人里是否小明小红都在,小明小红起桥梁作用
	
	if(checkkk==1)
	{
		if(cnt_1>cnt_2)
		{
			cout<<cnt_2;
		}
		else
		{
			cout<<cnt_1;
		}
	}
	else
	{
		cout<<"1";
	}
}

AC代码:

#include<iostream>
#include<cmath>
using namespace std;

#define MAX_TREE_SIZE 20010
int parent[MAX_TREE_SIZE][2]={0};
int deep[MAX_TREE_SIZE]={0};

//把两个并查集先整理好 
int find_root_1(int x);
void combine_1(int x,int y);
int find_root_2(int x);
void combine_2(int x,int y);
int find(int x,int k);

int cnt_1=1,cnt_2=1,root;//已知小明和小红,至少有一对 

int main()
{
	int N,M,P,Q;
	//A公司有N名员工,其中有P对朋友关系
	//B公司有M名员工,其中有Q对朋友关系
	cin>>N>>M>>P>>Q;
	
	int x,y;
	void initial_1(int n);
	for(int i=0;i<P;i++)//将A公司P对关系结合
	{
		cin>>x>>y;
		combine_1(x,y);
	}
	void initial_2(int n);
	for(int i=0;i<Q;i++)//将B公司Q对关系结合 
	{
		cin>>x>>y;
		combine_2(abs(x),abs(y));
	}
	
	//从两个根节点开始遍历,统计所含节点个数
	//不对,根节点不一定是1,找1的根节点,然后统计根节点和1的根节点相同的数的个数 
	root=find(1,0);
	for(int i=2;i<=N;i++)
	{
		int k=find(i,0);
		if(k == root) cnt_1++;
	}
	root=find(1,1);//因为用过绝对值函数,所以不是从-1而是从1开始找 
	for(int i=2;i<=M;i++)
	{
		int k=find(i,1);
		if(k == root) cnt_2++;
	}
	
	if(cnt_1>cnt_2) cout<<cnt_2;
	else cout<<cnt_1;
}

int find(int x,int k)
{
	int x_root=x;
	while(parent[x_root][k]!=0)
	{
		x_root=parent[x_root][k];
	}
	return x_root;//递归找根 
}

void initial_1(int n)
{
	for(int i=0;i<n;i++)
	{
		parent[i][0]=0;
		deep[i]=0;
	}
}

int find_root_1(int x)
{
	int x_root=x;
	while(parent[x_root][0]!=0)
	{
		x_root=parent[x_root][0];
	}
	return x_root;
}

void combine_1(int x,int y)
{
	int x_root=find_root_1(x);
	int y_root=find_root_1(y);
	if(x_root!=y_root)
	{
		if(deep[x_root]>deep[y_root])
		{
			parent[y_root][0]=x_root;
		}
		else if(deep[x_root]<deep[y_root])
		{
			parent[x_root][0]=y_root;
		}
		else
		{
			parent[x_root][0]=y_root;
			deep[y_root]++;
		}
	}
}

void initial_2(int n)
{
	for(int i=0;i<n;i++)
	{
		parent[i][1]=0;
		deep[i]=0;
	}
}

int find_root_2(int x)
{
	int x_root=x;
	while(parent[x_root][1]!=0)
	{
		x_root=parent[x_root][1];
	}
	return x_root;
}

void combine_2(int x,int y)
{
	int x_root=find_root_2(x);
	int y_root=find_root_2(y);
	if(x_root!=y_root)
	{
		if(deep[x_root]>deep[y_root])
		{
			parent[y_root][1]=x_root;
		}
		else if(deep[x_root]<deep[y_root])
		{
			parent[x_root][1]=y_root;
		}
		else
		{
			parent[x_root][1]=y_root;
			deep[y_root]++;
		}
	}
}

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

洛谷 P2078 朋友 的相关文章

  • 计算2X4X6X...X100的值(上面是错解,附正解)

    include lt stdio h gt int main int a 61 2 n 61 1 sum 61 1 while n lt 61 50 n 61 n 43 1 sum 61 sum a a 61 a 43 2 printf 3
  • while循环输出100-200的所有整数

    include lt stdio h gt int main int n 61 100 while n lt 61 200 printf 34 d t 34 n n 43 43 return 0
  • 关于如何输出百分号和0.0f%的格式化字符的理解,输出结果为2.684%

    include lt stdio h gt int main int a 61 10433 b 61 280 float f1 f1 61 b 1 0 a 当乘以1 0后 xff0c 才能使算出f1是想要的结果 xff08 0 026838
  • 输入自然数后逆序输出这个数

    include lt stdio h gt int main int a scanf 34 d 34 amp a while a a不等于零时执行此循环 printf 34 d 34 a 10 a 61 a 10 return 0
  • LINUX最小系统安装过程中的Partition Disks分配问题

    问题详细描述 xff1a 在我们安装Debian最小系统 xff08 即双系统windows和linux xff09 过程中在进行内存分配时 xff0c 由于系统需要我们很多时候都得选用英文系统导致可能存在 xff1a 看不懂 不知道怎么进
  • mybatis-plus自定义多表分页查询

    mybati plus多表分页查询 首先编写VO类 xff0c VO类包含了要查询的字段值 xff0c 现在有如下几个表 blog表 span class token annotation punctuation 64 Data span
  • 【Docker学习笔记】2.Debian Docker 安装及CentOS Docker 安装

    前言 本章介绍Debian Docker 安装和CentOS Docker 安装 Debian Docker 安装 Docker 支持以下的 Debian 版本 xff1a 巴斯特 10拉伸 9 xff08 稳定 xff09 拉斯比亚拉伸
  • 超详细的操作符讲解

    操作符的分类 算术操作符 移位操作符 位操作符 赋值操作符 单目操作符 关系操作符 逻辑操作符 条件操作符 逗号表达式 1 算术操作符 span class token operator 43 span span class token o
  • Ubuntu 安装中文输入法

    请注意命令中不应该的空格可能导致命令不合法 xff01 一 检查 fcitx 框架 首先 xff0c 要安装中文输入法 xff0c 必须要保证系统上有 fcitx fcitx是一个以 GPL 方式发布的输入法框架 xff0c 安装 fcit
  • 快速幂取模简单用法

    关于快速幂的用法本小白还是思索了挺久的 xff08 因为我不太聪明哈 xff09 xff0c 但是学会了就觉得挺好理解的 下面我用一道例题来简单讲一下它的用法 xff0c 希望能帮你轻松get到 xff01 xff01 例题 xff1a 快
  • robomaster视觉规则细谈

    目录 攻击与检测 弹丸参数 增益点增益 升级效果 击打检测 涂装要求 裁判系统 机器人端各模块 赛事引擎各部分 客户端 服务器 能量机关 小能量机关 大能量机关 算法归纳 攻击与检测 弹丸参数 如图所示 xff0c 赛场中我们使用的弹丸有两
  • 关于如何用python下载文件

    先贴上源代码 xff1a GitHub zhangbaji PythonDownloader 这是一个Python下载http文件的事例 xff0c 只不过目前还无法获取动态文件的文件名 https github com zhangbaji
  • Java打印杨辉三角形

    span class token keyword public span span class token keyword class span span class token class name Taks02 span span cl
  • 第二章 利用ffmpeg把rgb转mp4

    本文章介绍ffmpeg基本使用流程 1 创建编码器 通过枚举id选择编码器类型 AVCodec avcodec find encoder enum AVCodecID id enum AVCodecID id 通过枚举选择编码器类型 AV
  • 栈的相关题目以及出栈时的规律

    今天做了两个有关栈的题目 xff0c 都可以用到出栈时的规律来解题 那么问题来了 xff0c 出栈时的规律是什么呢 xff1f 规律如下 xff1a 已知栈的输入序列是1 2 3 n xff0c 输出序列是a1 a2 ai an 然后我们任
  • Python 中 jieba 库

    文章目录 jieba库一 简介1 是什么2 安装 二 基本使用1 三种模式2 使用语法2 1 对词组的基本操作2 2 关键字提取2 3 词性标注2 4 返回词语在原文的起止位置 jieba库 一 简介 1 是什么 xff08 1 xff09

随机推荐

  • 【栈与队列】之栈的顺序存储(图文详细介绍!!)

    前言 xff1a 本章基于 大话数据结构 和王卓老师的视频内容 xff0c 为刚接触数据结构的初学者提供一些帮助 x1f495 如果我的文章对你有帮助 xff0c 点赞 收藏 留言都是对我最大的动力 目录 4 1 栈的定义 4 2 栈的抽象
  • 【C语言技能树】程序环境和预处理

    Halo xff0c 这里是Ppeua 平时主要更新C语言 xff0c C 43 43 xff0c 数据结构算法 感兴趣就关注我吧 xff01 你定不会失望 x1f308 个人主页 xff1a 主页链接 x1f308 算法专栏 xff1a
  • Java中输出所有的水仙花数

    问题描述 打印出所有的 水仙花数 xff0c 所谓 水仙花数 是指一个三位数 xff0c 其各位数字立方和等于该数本身 例如 xff1a 153是一个 水仙花数 xff0c 因为153 61 1的三次方 43 5的三次方 43 3的三次方
  • pip3 设置阿里云

    pip3 install r requirements txt 报超时 xff0c 于是设置阿里云作为安装源 xff1a pip3 config set global index url http mirrors aliyun com py
  • 输入一个数组,将其逆序输出

    今天参加了校内的计算机技能大赛 xff0c 找到了一道较为简单的题 xff0c 就是 将数组逆序输出 下面我将详细讲解一下代码思路 xff0c 好了 xff0c 老规矩 xff0c 先上代码 xff01 include lt bits st
  • 虚拟机中Ubuntu安装了anaconda3无法使用conda

    ubuntu 中安装了 anaconda3 但是无法 使用 conda 只会出现这句话 conda 未找到指令 我找了一些办法 xff0c 有一个有用的 xff1a 8条消息 Ubuntu下使用Anaconda3 出现conda 未找到命令
  • ubuntu配置nfs时Failed to start nfs-server.service: Unit nfs-server.service not found.

    在ubuntu系统中配置nfs时出现Failed to start nfs server service Unit nfs server service not found 原因 xff1a 新装的ubuntu系统并未安装nfs 应使用su
  • 【经验分享】使用Keil5烧录代码遇到的问题及解决方法

    目录 一 前言 二 所遇问题及解决方法 1 首先最基本的Options for target 编辑的设置不用多说 xff0c 下载器根据自己所使用的类型进行选择 我使用的是CMSIS DAP 2 第二种可能出现的问题如下 SWD JTAG
  • c++ delete与析构函数的注意点

    问题 xff1a 我们都知道析构函数在类对象作用域结束时自动调用 xff0c 但这个规则适合基本类型 xff0c 但不适合delete函数 原因 xff1a 如果对象是new运算符动态创建的 xff0c 如果最后没有调用delete xff
  • 超详细!JAVA实现顺序表类

    Seqlist类 增 删 改 查 xff0c 判断是否为空 public class Seqlist lt T gt protected int n 顺序表元素个数 protected Object element 顺序表元素 public
  • 超详细!java实现链表

    Node lt T gt 结点类 public class Node lt T gt 结点类 数据域 xff1a data 存取域 xff1a next public T data 数据域 public Node lt T gt next
  • 超详细!java实现String部分方法

    java的String功能特点 Sring字符串是一个类 xff0c 属于引用数据类型 xff0c 提供比较大小 连接串等方法 String的对象是不是一个字符数组 xff0c 不能以数组下标格式s i 进行操作 xff0c 这和c c 4
  • 关于Java 的throw的一些注意的小点

    throw throw是程序中明确引发异常 xff0c 一旦执行到throw xff0c 程序就会被中断 xff0c 下面的代码就不会被执行 xff01 结论 xff1a 在编写代码阶段 xff0c 即使不运行程序 xff0c throw下
  • 栈究竟是什么?

    我们都知道 栈 这个数据结构 xff0c 它最大的特定就是 后进先出 xff0c 那么就会有一个问题 xff1f 真的存在天生就是 后进先出 的数据结构么 xff1f 答案是没有 xff01 结论 xff1a 栈的 后进先出 的规则是由人为
  • Maven的配置

    maven下载 首先登陆官网 点击download 然后点击下载 下载出来的是一个zip文件 直接解压到没有中文目录的文件夹下 我是放到java 中的 基础配置仓库的修改 打开apache maven gt 找到conf文件夹 gt 打开s
  • A - 简单密码(C语言)

    一 题目 Julius Caesar 曾经使用过一种很简单的密码 对于明文中的每个字符 xff0c 将它用它字母表中后 555 位对应的字符来代替 xff0c 这样就得到了密文 比如字符 A 用 F 来代替 如下是密文和明文中字符的对应关系
  • shell编程 -- 基础

    shell是一个命令行解释器 xff0c 它接收应用程序 用户命令 xff0c 然后调用操作系统内核 linux笔记 链接 xff1a https pan baidu com s 16GZCPfUTRzUqIyGnYwPuUg pwd 61
  • 专为折腾而生!老旧电脑安装PVE虚拟机保姆教程

    专为折腾而生 xff01 老旧电脑安装PVE虚拟机保姆教程 这几天玩VMware虚拟机上瘾 xff0c 感觉特别有意思 然而我其实并不满足于只是在这种软件层面上玩玩 xff0c 而想挑战更高级的玩法 xff0c 比如说玩玩可以安装在实体机上
  • idea中hdfs-api案例 :上传文件

    首先导入相关pom文件 lt dependencies gt lt hadoop相关依赖 gt lt dependency gt lt groupId gt org apache hadoop lt groupId gt lt artifa
  • 洛谷 P2078 朋友

    思路是分为两个并查集 xff0c 然后计算下男女人数 xff0c 然后直接比较 xff0c 选小的 代码写的有点麻烦好像 xff0c 交上去也没过 xff0c 虽然结果对了 其实第一遍已经发现有问题了 xff0c 因为比较的时候不小心把小于