Splay学习笔记

news2025/3/1 16:50:17

Splay的两个关键函数,rotate和splay

rotate就是正常的旋转。

splay(x,target)表示把x旋转为target的子节点

这里需要分讨,对于x的父亲y和祖父z

  • 若 z = target, 则直接转x
  • 若 x 与 y 方向相同,先转y,后转x
  • 若 x 与 y 方向不同,转2次x

对于每一个操作,只要访问一个点,都要splay一次。而且要更新访问的最下面的点。

同时对结构改变时要考虑会不会搞到0号点。

struct Splay {
	int son[N][2], fa[N], cnt[N], w[N], a[N], root, tot; 
	int ls(int x) { return son[x][0]; }
	int rs(int x) { return son[x][1]; }
	int zh(int x) { return rs(fa[x]) == x; }
	void push_up(int x) { if(x) w[x] = cnt[x] + w[ls(x)] + w[rs(x)]; }
	void print(int x) {
		if(!x) return ; 
		printf("%d [%d] -> [%d %d]\n", a[x], w[x], a[ls(x)], a[rs(x)]); 
		print(ls(x)); print(rs(x)); 
		if(x == root) printf("----------------\n"); 
	}
	void rotate(int x) {
		int y = fa[x], z = fa[y]; 
		int k = zh(x), w = son[x][k ^ 1]; 
		if(z) son[z][zh(y)] = x, fa[x] = z; else fa[x] = 0; 
		if(w) son[y][k] = w, fa[w] = y; else son[y][k] = 0; 
		son[x][k ^ 1] = y; fa[y] = x; 
		push_up(y); push_up(x); 
	}
	void splay(int x, int target = 0) {
		while(fa[x] != target) {
			int y = fa[x], z = fa[y]; 
			if(z != target) {
				if(zh(x) == zh(y)) rotate(y); 
				else rotate(x); 
			}
			rotate(x); 
		}
		if(!target) root = x; 
	}
	void insert(int x) {
		int now = root, las = 0; 
		while(now && a[now] != x) 
			las = now, now = son[now][x > a[now]]; 
		if(!now) {
			now = ++tot; 
			if(las) son[las][x > a[las]] = now; 
			fa[now] = las; a[now] = x; 
		}
		++cnt[now]; ++w[now]; 
		splay(now); 
	}
	int find_last(int x) {
		int now = root, ans = 0, las = 0; 
		while(now) {
			las = now; 
			if(a[now] >= x) now = ls(now); 
			else ans = now, now = rs(now); 
		}
		splay(las); 
		return ans; 
	}
	int find_next(int x) {
		int now = root, ans = 0, las = 0; 
		while(now) {
			las = now; 
			if(a[now] <= x) now = rs(now); 
			else ans = now, now = ls(now); 
		}
		splay(las); 
		return ans; 
	}
	int cha_x_rank(int x) {
		int u = find_last(x + 1); splay(u);
		int ans = w[u] - w[rs(u)]; 	 
		if(a[u] == x) ans -= cnt[u]; 
		return ans + 1; 
	}
	int cha_rank(int now) {
		int x = root, las = 0; 
		while(x) {
			if(w[ls(x)] >= now) x = ls(x); 
			else if(w[ls(x)] + cnt[x] >= now) return splay(x), x; 
			else now -= (w[ls(x)] + cnt[x]), x = rs(x); 
		}
		assert(x); return 0; 
	}
	void join(int x, int y) {
		fa[x] = fa[y] = 0; 
		while(rs(x)) x = rs(x); 
		if(x) splay(x), son[x][1] = y, fa[y] = x;
		else root = y; 
		push_up(x); 
	}
	void del(int x) {
		int u = find_last(x + 1); splay(u); 
		if(cnt[u] > 1) return --cnt[u], --w[u], void(); 
		join(ls(u), rs(u)); 
	}
}T;

例1 文艺平衡树

涉及到打tag操作

#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL
 #define debug(...) fprintf(stdout, ##__VA_ARGS__)

#else
 #define debug(...) void(0)

#endif
//#define int long long
inline int read(){int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;
ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+
(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)

#define pb push_back

#define fi first

#define se second

//#define M
//#define mo
#define N 100010

int n, m, i, j, k;

struct Splay {
	int a[N], son[N][2], fa[N], w[N], root, tot; 
	int tag[N]; 
	int ls(int x) { return son[x][0]; }
	int rs(int x) { return son[x][1]; }
	int zh(int x) { return son[fa[x]][1] == x; }
	void push_down(int x) {
		if(!tag[x]) return ; 
		int &u = son[x][0], &v = son[x][1]; 
		if(u) tag[u] ^= 1; 
		if(v) tag[v] ^= 1; 
		swap(u, v); 
		tag[x] = 0; 
	}
	void print(int x) {
		if(!x) return ; 
		push_down(x); 
		print(son[x][0]); 
		if(a[x] != 0 && a[x] != n + 1) 
			printf("%d ", a[x]); 
		print(son[x][1]); 
	}
	void print1(int x) {
		if(!x) return ; 
		push_down(x); 
		printf("%d[%d] -> [%d %d]\n", a[x], w[x], a[son[x][0]], a[son[x][1]]); 
		print1(son[x][0]); 
		print1(son[x][1]); 
		if(x == root) printf("-------------\n"); 
	}
	void push_up(int x) {
//		if(x > 0) return ; 
		w[x] = 1 + w[son[x][0]] + w[son[x][1]]; 
	}
	void rotate(int x) {
		int y = fa[x], z = fa[y]; 
		int k = zh(x), w = son[x][k ^ 1]; 
		push_down(z); push_down(y); push_down(x); 
		if(z) son[z][zh(y)] = x, fa[x] = z; else fa[x] = 0; 
		if(w) son[y][k] = w, fa[w] = y; else son[y][k] = 0; 
		son[x][k ^ 1] = y; fa[y] = x; 
		push_up(y); push_up(x); 
	}
	void splay(int x, int target = 0) {
		while(fa[x] != target) {
			int y = fa[x], z = fa[y]; 
//			debug("%d %d %d\n", x, y, z); 
			push_down(z); push_down(y); push_down(x); 
			if(z != target) {
				if(zh(x) == zh(y)) rotate(y); 
				else rotate(x); 
			}
			rotate(x); 
		}
		if(!target) root = x; 
	}
	void insert(int x) {
		int now = root, las = 0; 
		while(now) las = now, now = son[now][x > a[now]]; 
		now = ++tot; 
		if(las) son[las][x > a[las]] = now; 
		fa[now] = las; son[now][0] = son[now][1] = 0; w[now] = 1; a[now] = x; 
		if(!root) root = now; 
		splay(now); 
//		debug(">> %d[%d]\n", root, a[root]); 
	}
	int find(int x, int y) {
		push_down(x); 
//		debug("%d %d\n", x, y); 
		if(w[son[x][0]] >= y) return find(son[x][0], y); 
		if(w[son[x][0]] + 1 == y) return x; 
		return find(son[x][1], y - w[son[x][0]] - 1); 
	}
	void reverse(int l, int r) {
		++l; ++r; 
		int u = find(root, l - 1);
		splay(u); 
//		print1(root); 

		int v = find(root, r + 1); 
//		debug(">>>> %d [%d]\n", v, r + 1); 
		splay(v, u); 
//		print1(root); 
		tag[son[v][0]] = 1; 
	}
}T;

signed main()
{
	#ifdef LOCAL
	  freopen("in.txt", "r", stdin);
	  freopen("out.txt", "w", stdout);
	#endif
//	srand(time(NULL));
//	T=read();
//	while(T--) {
//
//	}
	n = read(); m = read(); 
	for(i = 0; i <= n + 1; ++i) T.insert(i); 
//	T.print1(T.root); 
	for(i = 1; i <= m; ++i) { 
		int l = read(), r = read(); 
		T.reverse(l, r); 
//		T.print1(T.root); 
//		T.print(T.root); printf("----\n"); 
	}
//	printf("\n"); 
	T.print(T.root); 
	return 0;
}



例2 波动值之和

在这里插入图片描述

#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL
 #define debug(...) fprintf(stdout, ##__VA_ARGS__)

#else
 #define debug(...) void(0)

#endif
#define int long long

inline int read(){int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;
ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+
(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)

#define pb push_back

#define fi first

#define se second

//#define M
//#define mo
#define N 500010

int n, m, i, j, k, T, x;
int ans, a[N]; 

struct Splay {
	int a[N], son[N][2], fa[N], root, tot, cnt[N]; 
	int ls(int x) { return son[x][0]; }
	int rs(int x) { return son[x][1]; }
//	int (int x) { return fa[x]; }
	int zh(int x) { return rs(fa[x]) == x; }
	void print(int x) {
		if(!x) return ; 
		printf("%lld(%lld) : [%lld %lld]\n", x, a[x], a[son[x][0]], a[son[x][1]]); 
		print(son[x][0]);
		print(son[x][1]);
		if(x == root) printf("---------------\n"); 
	}
	void rotate(int x) {
		int y = fa[x], z = fa[y]; 
		int k = zh(x), w = son[x][k ^ 1]; 
		if(z) son[z][zh(y)] = x, fa[x] = z; else fa[x] = 0; 
		son[x][k ^ 1] = y; fa[y] = x; 
		if(w) son[y][k] = w, fa[w] = y; else son[y][k] = 0; 
	}
	void splay(int x, int target = 0) {
		while(fa[x] != target) {
			int y = fa[x], z = fa[y]; 
			if(z != target) {
//				printf("eeeeeeeee"); 
//`				debug("[%lld %lld]\n", zh(x), zh(y)); 
				if(zh(x) == zh(y)) rotate(y); 
				else rotate(x); 
//				if(x == 4) print(root); 
			}
			rotate(x); 
//			if(x == 4) print(root); 
		}
		if(!target) root = x; 
	}
	void insert(int x) {
		int nw = root, las = 0; 
		while(nw && a[nw] != x) 
			las = nw, nw = son[nw][x > a[nw]]; 
		if(!nw) {
//			if(i == 2) printf("%lld %lld\n", las, nw); 
			nw = ++tot; 
			if(las) son[las][x > a[las]] = nw; 
			son[nw][0] = son[nw][1] = 0; a[nw] = x; fa[nw] = las; 
			if(!root) root = nw; 
		}
		++cnt[nw]; 
//		if(x == 37) print(root); 
		splay(nw); 
	}
	int qry(int x) {
		if(cnt[root] > 1) return 0; 
		int ans = 1e18, u = root; 
		u = son[u][0]; 
		while(u) {
			ans = min(ans, abs(x - a[u]));  
			u = son[u][1]; 
		}
		u = root; u = son[u][1]; 
		while(u) {
			ans = min(ans, abs(x - a[u]));  
			u = son[u][0]; 
		}
//		if(ans == 1e18) printf("%lld %lld[%lld %lld] %lld %lld\n", i, x, son[u][0], son[u][1], tot, root); 
//		assert(ans != 1e18); 
		debug("(%lld)[%lld] %lld %lld\n", u, x, a[son[u][0]], a[son[u][1]]); 
		return ans; 
	}
}splay;

signed main()
{
	#ifdef LOCAL
	  freopen("in.txt", "r", stdin);
	  freopen("out.txt", "w", stdout);
	#endif
//	srand(time(NULL));
//	T=read();
//	while(T--) {
//
//	}
	n = read(); 
//	n = 2; a[1] = 76633; a[2] = 76523; 
	for(i = 1; i <= n; ++i) {
		a[i] = read(); 
		splay.insert(a[i]); 
		if(i == 1) ans += a[i]; 
		else ans += splay.qry(a[i]); 
//		splay.print(splay.root); 
	}
	printf("%lld", ans); 
	return 0;
}



例3 维护集合

在这里插入图片描述

#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL
 #define debug(...) fprintf(stdout, ##__VA_ARGS__)

#else
 #define debug(...) void(0)

#endif
#define int long long

inline int read(){int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;
ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+
(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)

#define pb push_back

#define fi first

#define se second

//#define M
//#define mo
#define N 100010

int n, m, i, j, k;
int ans, bas, Miv; 
char op[2]; 

struct Splay {
	int a[N], son[N][2], fa[N], root, cnt[N], w[N], tot; 
	int ls(int x) { return son[x][0]; }
	int rs(int x) { return son[x][1]; }
	int zh(int x) { return son[fa[x]][1] == x; }
	void push_up(int x) {
		w[x] = cnt[x] + w[son[x][0]] + w[son[x][1]]; 
	}
	void print(int x) {
		if(!x) return ; 
		printf("%d[%d] -> [%d %d]\n", a[x] + bas, w[x], a[son[x][0]] + bas, a[son[x][1]] + bas); 
		print(son[x][0]); print(son[x][1]); 
		if(x == root) printf("---------------------\n"); 
	}
	void rotate(int x) {
		int y = fa[x], z = fa[y]; 
		int k = zh(x), w = son[x][k ^ 1]; 
		if(z) son[z][zh(y)] = x, fa[x] = z; else fa[x] = 0; 
		if(w) son[y][k] = w, fa[w] = y; else son[y][k] = 0; 
		son[x][k ^ 1] = y; fa[y] = x; 
		push_up(y); push_up(x); 
	}
	void splay(int x, int target = 0) {
		while(fa[x] != target) {
			int y = fa[x], z = fa[y]; 
			if(z != target) {
				if(zh(x) == zh(y)) rotate(y); 
				else rotate(x); 
			}
			rotate(x); 
		}
		if(!target) root = x; 
	}
	void insert(int x) {
		int now = root, las = 0; 
		while(now && a[now] != x) 
			las = now, now = son[now][x > a[now]];
//		debug("aaaaaaaaaaaaa\n"); 
		if(!now) {
			now = ++tot; 
			if(las) son[las][x > a[las]] = now; 
			fa[now] = las; son[now][0] = son[now][1] = 0; a[now] = x; 
		}
		if(x != 1e12) ++cnt[now]; 
		if(!root) root = now; 
		splay(now); 
	}
	int find1(int x, int k) {
		int las = 0; 
		while(x) {
			if(w[son[x][0]] + cnt[x] >= k && k > w[son[x][0]]) return x; 
			las = x; 
			if(w[son[x][0]] >= k) x = son[x][0]; 
			else k -= (w[son[x][0]] + cnt[x]), x = son[x][1]; 
		}
		return las; 
	}
//	 int find1(int x, int k) {
//        if (w[son[x][0]] >= k)
//            return find1(son[x][0], k);
//        if (w[son[x][0]] + cnt[x] == k)
//            return x;
//        return find1(son[x][1], k - (w[son[x][0]] + cnt[x]));
//    }
	int qry(int k) {
		if(k > w[root]) return -1 - bas; 
		k = w[root] - k + 1; 
		int u = find1(root, k); splay(u); 
		return a[u]; 
	}
	int find2(int x, int k) {
		int las = 0, ans = 0; 
		while(x) {
			if(a[x] == k) return x; 
			if(a[x] >= k) ans = x; 
			las = x; 
			if(a[x] < k) x = son[x][1]; 
			else if(a[x] > k) x = son[x][0]; 
		}
		return ans; 
	}
//	int find2(int x, int k) {
//        if (a[x] == k)
//            return x;
//        if (a[x] < k)
//            return son[x][1] ? find2(son[x][1], k) : x;
//        if (a[x] > k) {
//            int y = (son[x][0] ? find2(son[x][0], k) : x);
//            return a[y] >= k ? y : x;
//        }
//    }
	int check(int miv) {
		int u = find2(root, miv); splay(u); 
		int d = w[son[u][0]]; son[u][0] = 0; push_up(u); 
		return d; 
	}
}T;

signed main()
{
	#ifdef LOCAL
	  freopen("in.txt", "r", stdin);
	  freopen("out.txt", "w", stdout);
	#endif
//	srand(time(NULL));
//	T=read();
//	while(T--) {
//
//	}
	n = read(); Miv = read(); T.insert(1e12); //T.print(T.root); 
	for(i = 1; i <= n; ++i) {
		scanf("%s", op); k = read(); 
//		debug("%c %d\n", op[0], k); 
		if(op[0] == 'I') {
			k -= bas; if(k < Miv) continue; 
			T.insert(k); 
		}
//		T.print(T.root); 
		if(op[0] == 'A') bas += k, Miv -= k; 
		if(op[0] == 'S') bas -= k, Miv += k, ans += T.check(Miv); 
		if(op[0] == 'F') printf("%lld\n", T.qry(k) + bas); 
	}
	printf("%lld\n", ans); 
	return 0;
}



本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2040087.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

html+css网页制作 电商华为商城首页 ui还原度100%

htmlcss网页制作 电商华为商城首页 ui还原度100% 网页作品代码简单&#xff0c;可使用任意HTML编辑软件&#xff08;如&#xff1a;Dreamweaver、HBuilder、Vscode 、Sublime 、Webstorm、Text 、Notepad 等任意html编辑软件进行运行及修改编辑等操作&#xff09;。 获取源码…

Docker日志管理

一、知识点介绍 1.ELK(Elasticserach、Logstash、Kibana) 前面笔记有 2.什么是 Filebeat Filebeat 是 ELK 组件的新成员&#xff0c; 也是 Beat 成员之一。基于 Go 语言开发&#xff0c;无任何依赖并且比 Logstash 更加轻量&#xff0c;不会带来过高的资源占用&#xff0c; …

django常用的组合搜索组件

文章目录 django常用的组合搜索组件快速使用配置信息1. 视图函数2. 前端模板3. css样式 代码实现 django常用的组合搜索组件 在项目开发中&#xff0c;如果有大量数据就要用到组合搜索&#xff0c;通过组合搜索对大块内容进行分类筛选。 快速使用 三步走&#xff1a;&#xf…

刷题记录第110天-分割等和数组

解题思路&#xff1a; 问题可转化为&#xff0c;用给定数组能否装满一个容量为数组总和一半的背包(targetsum/2)&#xff0c;即一个0-1背包问题。 0-1背包问题的关键在于数组的定义和状态转移方程以及价值的定义。dp[i][j]表示在[0…i]个物品内&#xff0c;背包容量为j能装的最…

再升级!MoneyPrinterPlus集成GPT_SoVITS

最近有很多优秀的语音合成TTS工具&#xff0c;目前MoneyPrinterPlus已经集成了ChatTTS和fasterWhisper。应朋友们的要求&#xff0c;最近MoneyPrinterPlus也集成了GPT_SoVITS这个优秀的语音合成工具。 今天给大家详细讲解一下&#xff0c;如何在MoneyPrinterPlus中使用GPT_SoV…

机器学习速成第三集——无监督学习之降维(理论部分)!

目录 主成分分析&#xff08;PCA&#xff09; 独立成分分析&#xff08;ICA&#xff09; t分布随机邻近嵌入&#xff08;t-SNE&#xff09; 线性判别分析&#xff08;LDA&#xff09; 其他降维方法 应用场景 主成分分析&#xff08;PCA&#xff09;在处理大规模数据集时…

新能源汽车电机低频电磁场仿真应用

一、背景介绍 随着新能源汽车的普及&#xff0c;电机作为新能源汽车驱动系统的核心组成部分&#xff0c;其重要性不言而喻。电机使电能转化为机械能&#xff0c;通过传动系统将机械能传递到车轮&#xff0c;驱动汽车行驶。新能源汽车电机的发展经历了从初步探索到技术成熟的多…

Localization Translate API 的对接和使用

Localization Translate API 的对接和使用 Localization Translate API 的主要功能是通过输入需要翻译的文本来获取翻译后的文本&#xff0c;同时翻译后的语言可以自定义&#xff0c;并且翻译结果可以采用 json &#xff0c; markdown 俩种主流的方法来输出。 本文档将详细介…

【安卓】多线程编程

文章目录 线程的简单应用解析异步消息处理机制使用AsyncTask 线程的简单应用 新建一个AndroidThreadTest项目&#xff0c;然后修改activity_main.xml中的代码。 <RelativeLayout xmlns:android"http://schemas.android.com/apk/res/android"android:layout_width…

CNN-GRU神经网络多输入单输出回归预测【MATLAB】

1. CNN&#xff08;卷积神经网络&#xff09;部分 作用&#xff1a; 特征提取&#xff1a;CNN擅长从输入数据中提取空间特征。在多输入情况下&#xff0c;它可以处理来自不同源的数据&#xff0c;提取有用的特征。 局部感受野&#xff1a;通过卷积操作&#xff0c;CNN能够识别…

【ACM出版,往届会后三个半月EI见刊/检索】第四届物联网与机器学习国际学术会议(IoTML 2024,8月23-25)

2024年第四届物联网与机器学习国际学术会议&#xff08;IoTML 2024&#xff09;将于2024年8月23-25日在中国南昌召开。 会议将围绕着物联网和机器学习开展&#xff0c;探讨本领域发展所面临的关键性挑战问题和研究方向&#xff0c;以期推动该领域理论、技术在高校和企业的发展和…

vector嵌套之空指针异常

文章目录 1. 题目链接2. 题目代码正确代码错误代码 1. 题目链接 118. 杨辉三角 2. 题目代码 正确代码 class Solution { public:vector<vector<int>> generate(int numRows) {vector<vector<int>> result(numRows);for(int i 0; i < numRows; i)…

STL中的栈(stack)和队列(queue)以及简单(复用)实现

适配器&#xff1a; 虽然 stack 和 queue 中也可以存放元素&#xff0c;但在 STL 中并没有将其划分在容器的行列&#xff0c;而是将其称为 容器适配器 &#xff0c;这是因为 stack 和队列只是对其他容器的接口进行了包装&#xff0c; STL 中 stack 和 queue 默认使用deque 换种…

【云备份】学习Json

文章目录 1.Json数据类型基础数据类型复合数据类型JSON数据类型的应用 2.学习jsoncpp库利用json实现序列化利用json实现反序列化 1.Json数据类型 json 是一种数据交换格式&#xff0c;采用完全独立于编程语言的文本格式来存储和表示数据。json数据交换格式是将多种数据对象组织…

CVE-2024-38077 Windows远程桌面授权服务漏洞介绍

CVE-2024-38077 是一个在Windows远程桌面授权服务&#xff08;Remote Desktop Licensing Service&#xff09;中存在的严重远程代码执行漏洞。以下是关于此漏洞的详细信息&#xff1a; 漏洞概述 漏洞编号&#xff1a;CVE-2024-38077漏洞类型&#xff1a;远程代码执行 (RCE)影…

基于单片机控制的多功能智能语音风扇

【摘要】 本文简述了一种基于单片机控制的智能多功能语音风扇的设计&#xff0c;该设计以STC11L08XE单片机为主控制器&#xff0c;通过YS-LDV7语音模块对语音信号进行采集识别&#xff0c;并将该信号上传给单片机进而控制风扇的转速和开关&#xff0c;以达到语音控制的效果。该…

Python 安装 PyTorch详细教程

本章教程,介绍如何安装PyTorch,介绍两种安装方式,一种是通过pip直接安装,一种是通过conda方式安装。 一、查看CUDA版本 二、安装PyTorch 1、pip安装方式 pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu1162、conda安装方式 …

Leetcode—3151. 特殊数组 I【简单】

2024每日刷题&#xff08;155&#xff09; Leetcode—3151. 特殊数组 I 实现代码 class Solution { public:bool isArraySpecial(vector<int>& nums) {int n nums.size();for(int i 1; i < n; i) {if(nums[i - 1] % 2 nums[i] % 2) {return false;}}return t…

【数据结构-前缀哈希】力扣1124. 表现良好的最长时间段

给你一份工作时间表 hours&#xff0c;上面记录着某一位员工每天的工作小时数。 我们认为当员工一天中的工作小时数大于 8 小时的时候&#xff0c;那么这一天就是「劳累的一天」。 所谓「表现良好的时间段」&#xff0c;意味在这段时间内&#xff0c;「劳累的天数」是严格 大…

练习实践-基础设施-文件共享-linux间的文件共享-NFS服务搭建

参考来源&#xff1a; nfs安装配置-Debian/Ubuntu 什么是NFS&#xff1f;NFS挂载 NFS详解&#xff08;概念实验演示&#xff09; 快速回顾&#xff1a; nfs服务器搭建&#xff1a;1>.服务器端&#xff1a;1&#xff09;创建共享目录2&#xff09;修改配置文件/etc/exports…