树套树P3380

开O2过了

#include <iostream>
#include <istream>
#include <sstream>
#include <vector>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <chrono>
#include <ctime>
#include <cmath>
#include <cctype>
#include <string>
#include <cstdio>
#include <iomanip>#include <thread>
#include <mutex>
#include <condition_variable>
#include <functional>
#include <iterator>
#include <random>
using namespace std;inline int read(int& x) {char ch = getchar();int f = 1; x = 0;while (ch > '9' || ch < '0') { if (ch == '-')f = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { x = (x << 1) + (x << 3) + ch - '0'; ch = getchar(); }return x * f;
}
//void ReadFile() {
//	FILE* stream1;
//	freopen_s(&stream1,"in.txt", "r", stdin);
//	freopen_s(&stream1,"out.txt", "w", stdout);
//}static auto speedup = []() {ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); return nullptr; }();template <class _Type>
class AVL
{
public:template <class _T>struct AVLNode {//AVLNode(_T input) :l(nullptr), r(nullptr), h(1), data(input) {}AVLNode() :data(), l(nullptr), r(nullptr), h(1), c(1), sub(1) {}_T data;AVLNode* l, * r;int h, c, sub;//高度 副本个数 子树节点个数};typedef AVLNode<_Type>  value_Type;typedef AVLNode<_Type>* point;
public:AVL() :m_root(nullptr), m_tot(0) {}~AVL() { clear(m_root); }
public:typename AVL<_Type>::point GetNode(_Type&& input);int  GetHight(typename AVL<_Type>::point node) {if (node == nullptr) return 0;return node->h;}int  GetSubCnt(typename AVL<_Type>::point node) {if (node == nullptr) return 0;return node->sub;}void flush(typename AVL<_Type>::point node) {if (node == nullptr) return;node->h = max(GetHight(node->l), GetHight(node->r)) + 1;node->sub = GetSubCnt(node->l) + GetSubCnt(node->r) + node->c;}
public:typename AVL<_Type>::point insert(_Type input);//插入typename AVL<_Type>::point _insert(typename AVL<_Type>::point cur, _Type&& input);void remove(_Type input);//删除typename AVL<_Type>::point _remove(typename AVL<_Type>::point cur, _Type&& input);typename AVL<_Type>::point findKth(int k);	//查找第k大int findRank(_Type x);typename AVL<_Type>::point findPre(_Type x);	//查找x前驱typename AVL<_Type>::point findNext(_Type x);//查找x后继typename AVL<_Type>::point find(_Type x);//查找xpublic:void  rotate_left(typename AVL<_Type>::point& input);	//左旋转void  rotate_right(typename AVL<_Type>::point& input);	//右旋转typename AVL<_Type>::point revise(typename AVL<_Type>::point& node);//修正void clear(typename AVL<_Type>::point& input);void print(typename AVL<_Type>::point& input) {if (input == nullptr) return;print(input->l);m_data.insert(m_data.end(), input->c, input->data);cout << input->data << " ";print(input->r);}
public:typename AVL<_Type>::point   m_root;typename AVL<_Type>::point   m_new;//最后一个新增节点int		m_tot;//总节点个数vector<_Type> m_data;
};template <class _Type>
typename AVL<_Type>::point AVL<_Type>::GetNode(_Type&& input) {AVL<_Type>::point ret = new AVL<_Type>::value_Type();if (ret)ret->data = input, m_tot++;return m_new = ret;
}template <class _Type>
void AVL<_Type>::clear(typename AVL<_Type>::point& input) {if (input == nullptr) return;clear(input->l);clear(input->r);input->l = nullptr;input->r = nullptr;input = nullptr;
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::insert(_Type input)//插入
{m_new = nullptr;m_root = _insert(m_root, std::forward<_Type>(input));return m_new;
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::_insert(typename AVL<_Type>::point p, _Type&& input)//插入
{//找到节点位置if (p == nullptr) return GetNode(std::forward<_Type>(input));//相同元素 标记数量if (p->data == input) {p->c++;p->sub++;return p;}if (p->data > input)p->l = _insert(p->l, std::forward<_Type>(input));else p->r = _insert(p->r, std::forward<_Type>(input));return revise(p);
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::revise(typename AVL<_Type>::point& p) {if (p == nullptr) return p;int hl = GetHight(p->l), hr = GetHight(p->r), diff = hl - hr;if (diff > 1) {//LLif (GetHight(p->l->l) >= GetHight(p->l->r)) {rotate_right(p);}else {//LRrotate_left(p->l);rotate_right(p);}}else if (diff < -1) {//RLif (GetHight(p->r->l) >= GetHight(p->r->r)) {rotate_right(p->r);rotate_left(p);}else rotate_left(p);//RR}flush(p);return p;
}template <class _Type>
void AVL<_Type>::remove(_Type input)//删除
{m_root = _remove(m_root, std::forward<_Type>(input));
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::_remove(typename AVL<_Type>::point p, _Type&& input)
{if (p == nullptr) return p;if (p->data > input) {p->l = _remove(p->l, std::forward<_Type>(input));}else if (p->data < input) {p->r = _remove(p->r, std::forward<_Type>(input));}else {//已找到节点 有多个副本if (--p->c > 0) { m_tot--; return revise(p); }else {//有左右子树if (p->l && p->r) {//寻找前驱节点 一定有前驱和后继AVL<_Type>::point preplace = p->l;while (preplace->r) preplace = preplace->r;//交换数据swap(p->data, preplace->data);//副本数量swap(p->c, preplace->c);p->l = _remove(p->l, std::forward<_Type>(input));}else {m_tot--;AVL<_Type>::point preplace = p->l ? p->l : p->r;delete p;return preplace;}}}return revise(p);
}template <class _Type>
void  AVL<_Type>::rotate_left(typename AVL<_Type>::point& node)//旋转
{if (node == nullptr || node->r == nullptr) return;AVL::point r = node->r;AVL::point rl = r->l;r->l = node;node->r = rl;node = r;flush(node->l);flush(node);
}template <class _Type>
void  AVL<_Type>::rotate_right(typename AVL<_Type>::point& node)//右旋转
{if (node == nullptr || node->l == nullptr) return;AVL::point l = node->l;AVL::point lr = l->r;l->r = node;node->l = lr;node = l;flush(node->r);flush(node);
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::findKth(int k)	//查找第k大
{if (m_root == nullptr || k > m_tot) return nullptr;AVL<_Type>::point cur = m_root;while (cur) {int l = GetSubCnt(cur->l);int r = GetSubCnt(cur->r);int m = cur->c;if (k <= l) {cur = cur->l;}else if (k <= l + m) {return cur;}else {k -= l + m;cur = cur->r;}}return nullptr;
}template <class _Type>
int AVL<_Type>::findRank(_Type x) {AVL<_Type>::point cur = m_root;int ans = 0;while (cur) {if (cur->data > x) {cur = cur->l;}else if (cur->data < x) {ans += GetSubCnt(cur->l) + cur->c;cur = cur->r;}else break;}if (cur == nullptr) return ans + 1;return ans + GetSubCnt(cur->l) + 1;
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::findPre(_Type x)	//查找x前驱
{AVL<_Type>::point cur = m_root, ret = nullptr;while (cur) {if (cur->data < x)ret = cur, cur = cur->r;else cur = cur->l;}return ret;
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::findNext(_Type x)//查找x后继
{AVL<_Type>::point cur = m_root, ret = nullptr;while (cur) {if (cur->data > x)ret = cur, cur = cur->l;else cur = cur->r;}return ret;
}template <class _Type>
typename AVL<_Type>::point AVL<_Type>::find(_Type x)//查找x
{AVL<_Type>::point cur = m_root;while (cur) {if (cur->data == x) return cur;else if (cur->data > x) cur = cur->l;else cur = cur->r;}return nullptr;
}
template <typename _Type>
class Splay {
private:template <typename _T>struct SplayNode {SplayNode() :data(), l(nullptr), r(nullptr), fa(nullptr), c(1), sub(1) {}_T data;SplayNode* l, * r, * fa;int c, sub;//副本个数 子树节点个数};
public:typedef SplayNode<_Type>  value_Type;typedef SplayNode<_Type>* point;
public:Splay() :m_root(nullptr), m_tot(0) {}~Splay() { clear(m_root); }void clear(typename Splay<_Type>::point& input);
public:int  GetSubCnt(typename Splay<_Type>::point node) {if (node == nullptr) return 0;return node->sub;}void flush(typename Splay<_Type>::point node) {if (node == nullptr) return;node->sub = GetSubCnt(node->l) + GetSubCnt(node->r) + node->c;}typename Splay<_Type>::point GetNode(_Type&& input);
public:typename Splay<_Type>::point insert(_Type input);//插入void remove(_Type input);//删除typename Splay<_Type>::point find(_Type x);//查找xtypename Splay<_Type>::point splay(typename  Splay<_Type>::point& input, typename  Splay<_Type>::point target = nullptr);//typename Splay<_Type>::point findKth(int k);	//查找第k大int findRank(_Type x);typename Splay<_Type>::point findPre(_Type x);	//查找x前驱typename Splay<_Type>::point findNext(_Type x);//查找x后继void reverse(int l, int r);
public:void  rotate_left(typename  Splay<_Type>::point& input);	//左旋转void  rotate_right(typename Splay<_Type>::point& input);	//右旋转
private:typename Splay<_Type>::point   m_root;int m_tot;
};//
template <class _Type>
typename Splay<_Type>::point Splay<_Type>::GetNode(_Type&& input) {Splay<_Type>::point ret = new Splay<_Type>::value_Type();if (ret)ret->data = input, m_tot++;return ret;
}
template <class _Type>
void Splay<_Type>::clear(typename Splay<_Type>::point& input) {if (input == nullptr) return;clear(input->l);clear(input->r);input->l = nullptr;input->r = nullptr;input = nullptr;
}template <class _Type>
void Splay<_Type>::reverse(int l, int r)
{l = findKth(l);r = findKth(r + 2);Splay(l, 0);Splay(r, l);}
template <class _Type>
typename Splay<_Type>::point Splay<_Type>::findKth(int k)	//查找第k大
{if (m_root == nullptr || k > m_tot) return nullptr;Splay<_Type>::point cur = m_root;while (cur) {int l = GetSubCnt(cur->l);int r = GetSubCnt(cur->r);int m = cur->c;if (k <= l) {cur = cur->l;}else if (k <= l + m) {return splay(cur);}else {k -= l + m;cur = cur->r;}}return nullptr;
}template <class _Type>
int Splay<_Type>::findRank(_Type x) {Splay<_Type>::point cur = m_root;int ans = 0;while (cur) {if (cur->data > x) {cur = cur->l;}else if (cur->data < x) {ans += GetSubCnt(cur->l) + cur->c;cur = cur->r;}else break;}if (cur == nullptr) return ans + 1;ans += GetSubCnt(cur->l) + 1;splay(cur);return ans;
}template <class _Type>
typename Splay<_Type>::point Splay<_Type>::findPre(_Type x)	//查找x前驱
{Splay<_Type>::point cur = m_root, ret = nullptr;while (cur) {if (cur->data < x)ret = cur, cur = cur->r;else cur = cur->l;}return splay(ret);
}template <class _Type>
typename Splay<_Type>::point Splay<_Type>::findNext(_Type x)//查找x后继
{Splay<_Type>::point cur = m_root, ret = nullptr;while (cur) {if (cur->data > x)ret = cur, cur = cur->l;else cur = cur->r;}return splay(ret);
}template <class _Type>
typename Splay<_Type>::point Splay<_Type>::find(_Type x)//查找x
{Splay<_Type>::point cur = m_root;while (cur) {if (cur->data == x) {break;}else if (cur->data > x) {cur = cur->l;}else {cur = cur->r;}}return splay(cur);
}template <class _Type>
typename Splay<_Type>::point Splay<_Type>::insert(_Type input)//插入
{if (m_root == nullptr) return m_root = GetNode(std::forward<_Type>(input));else {Splay<_Type>::point cur = m_root;while (cur) {if (cur->data == input) {cur->c++;m_tot++;break;}else if (cur->data > input) {if (cur->l)cur = cur->l;else {cur->l = GetNode(std::forward<_Type>(input));cur->l->fa = cur;cur = cur->l;break;}}else {if (cur->r)cur = cur->r;else {cur->r = GetNode(std::forward<_Type>(input));cur->r->fa = cur;cur = cur->r;break;}}}return splay(cur);}
}template <class _Type>
void Splay<_Type>::remove(_Type input)//删除
{Splay<_Type>::point p = find(input), l, r;if (p == nullptr) return;p = splay(p);if (--p->c > 0)return;if (p->l == nullptr) {m_root = p->r;if (p->r)p->r->fa = nullptr;}else if (p->r == nullptr) {m_root = p->l;if (p->l)p->l->fa = nullptr;}else {//分裂成2棵子树l = p->l;r = p->r;l->fa = r->fa = nullptr;m_root = l;l = findPre(p->data); //查找左子树的前驱 相当于左子树的最大值 没有右子树//合并2棵子树l->r = r;r->fa = l;}delete p;m_tot--;flush(m_root);
}template <class _Type>
typename Splay<_Type>::point Splay<_Type>::splay(typename  Splay<_Type>::point& input, typename  Splay<_Type>::point target)
{if (input == nullptr) return nullptr;while (input->fa != target) {Splay<_Type>::point fa = input->fa, ffa = fa->fa;bool bol = fa->l == input;//父节点是目标节点if (ffa == target) {//左子树if (bol) rotate_right(fa);else rotate_left(fa);}else {bool bofl = ffa->l == fa;//LLif (bofl && bol) {rotate_right(ffa);rotate_right(fa);}else if (!bofl && !bol) {//RRrotate_left(ffa);rotate_left(fa);}else if (bofl && !bol) {//LRrotate_left(fa);rotate_right(ffa);}else {//RLrotate_right(fa);rotate_left(ffa);}}}if (target == nullptr)m_root = input;return input;
}template <class _Type>
void  Splay<_Type>::rotate_left(typename Splay<_Type>::point& node)//左旋转
{if (node == nullptr || node->r == nullptr) return;Splay::point r = node->r;Splay::point rl = r->l;if (node->fa) {if (node->fa->l == node) node->fa->l = r;else node->fa->r = r;}r->fa = node->fa;node->fa = r;r->l = node;node->r = rl;if (rl)rl->fa = node;node = r;flush(node->l);flush(node);
}template <class _Type>
void  Splay<_Type>::rotate_right(typename Splay<_Type>::point& node)//右旋转
{if (node == nullptr || node->l == nullptr) return;Splay::point l = node->l;Splay::point lr = l->r;if (node->fa) {if (node->fa->l == node) node->fa->l = l;else node->fa->r = l;}l->fa = node->fa;node->fa = l;l->r = node;node->l = lr;if (lr)lr->fa = node;node = l;flush(node->r);flush(node);
}
const int maxn = 5e4 + 7,INF = 2147483647;
int arr[maxn], n, m;class segment {
public:typedef long long int ll;segment() {}void build(int l, int r, int idx) {for (int i = l; i <= r; i++) {root[idx].insert(arr[i]);}if (l == r) return;int mid = (l + r) >> 1;int lson = idx * 2, rson = lson + 1;build(l, mid, lson);build(mid + 1, r, rson);}void _modify(int l, int r, int idx, int cl, int cr, int x,int y) {if (l > cr || r < cl) return;root[idx].remove(arr[x]);root[idx].insert(y);if (l == r) return;int mid = (l + r) >> 1, lson = idx * 2, rson = lson + 1;if (mid >= cl) _modify(l, mid, lson, cl, cr, x,y);if (mid < cr) _modify(mid + 1, r, rson, cl, cr, x,y);}void modify(int x, int y) {_modify(1, n, 1, x, x,x, y);arr[x] = y;}int queryrank(int p, int l, int r, int cl,int cr,int k) // query the highest rank of value 'k'{	if (l > cr || r < cl) return 0;if (l >= cl && r <= cr) {return root[p].findRank(k) - 1;}int mid = (l + r) >> 1;return queryrank(p * 2, l,mid, cl, cr, k) + queryrank(p * 2 + 1,mid + 1,r, cl, cr, k);}int querynum(int u, int v, int k) // query the value of kth num{int l = 0, r = 1e8;while (l < r){int mid = (l + r + 1) / 2;int c = queryrank(1, 1, n, u, v, mid);if (c < k)l = mid;elser = mid - 1;}return r;}int querypre(int p, int l, int r,int cl,int cr, int k){if (l > cr || r < cl) return -INF;if (l >= cl && r <= cr) {AVL<int>::point ret = root[p].findPre(k);if(ret != nullptr)return ret->data;return -INF;}int mid = (l + r) >> 1;return max(querypre(p * 2, l,mid,cl, cr, k), querypre(p * 2 + 1,mid + 1,r, cl, cr, k));}int querysuf(int p, int l, int r,int cl,int cr, int k){if (l > cr || r < cl)return INF;if (l >= cl && r <= cr) {AVL<int>::point ret = root[p].findNext(k);if(ret != nullptr)return ret->data;return INF;}int mid = (l + r) >> 1;return min(querysuf(p * 2,l,mid, cl, cr, k), querysuf(p * 2 + 1,mid + 1,r, cl, cr, k));}public:AVL<int> root[maxn << 3];
};
segment tree;int main()
{//ReadFile();read(n);read(m);for (int i = 1; i <= n; i++)read(arr[i]);tree.build(1, n,1);int opt, x, y;for (int i = 0; i < m; ++i){read(opt);if (opt == 3){read(x); read(y);tree.modify(x,y);}else{int l, r, k;read(l); read(r); read(k);if (opt == 1) printf("%d\n", tree.queryrank(1, 1, n, l, r, k) + 1);else if (opt == 2) printf("%d\n", tree.querynum(l, r, k));else if (opt == 4) printf("%d\n", tree.querypre(1, 1, n, l, r, k));else printf("%d\n", tree.querysuf(1, 1, n, l, r, k));}}return 0;
}

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

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

相关文章

【JavaScript手撕代码】new

目录 手写 手写 /* * param {Function} fn 构造函数 * return {*} **/ function myNew(fn, ...args){if(typeof fn ! function){return new TypeError(fn must be a function)}// 先创建一个对象let obj Object.create(fn.prototype)// 通过apply让this指向obj, 并调用执行构…

Spring事务管理: 构建稳健的数据库事务处理

&#x1f337;&#x1f341; 博主猫头虎&#xff08;&#x1f405;&#x1f43e;&#xff09;带您 Go to New World✨&#x1f341; &#x1f984; 博客首页——&#x1f405;&#x1f43e;猫头虎的博客&#x1f390; &#x1f433; 《面试题大全专栏》 &#x1f995; 文章图文…

爬虫逆向实战(29)-某蜂窝详情页(cookie、混淆、MD5、SHA)

一、数据接口分析 主页地址&#xff1a;某蜂窝 1、抓包 通过抓包可以发现数据是静态的&#xff0c;在html中。 2、判断是否有加密参数 请求参数是否加密&#xff1f; 无请求头是否加密&#xff1f; 无响应是否加密&#xff1f; 无cookie是否加密&#xff1f; 通过查看“c…

建站系列(六)--- 后端开发语言

目录 相关系列文章前言一、常见后端开发语言二、PHP三、Java四、Python五、Go 相关系列文章 建站系列&#xff08;一&#xff09;— 网站基本常识 建站系列&#xff08;二&#xff09;— 域名、IP地址、URL、端口详解 建站系列&#xff08;三&#xff09;— 网络协议 建站系列…

测试验证文章

Foreign Brand Home is a website that focuses on sharing international brands, recommending quality branded products from around the world with one-click access to the official website.​​​​​​​Impact-Site-Verification: b4f89f66-ae3a-4c0f-9699-c6e792ba

如何预防最新的Mallox变种malloxx勒索病毒感染您的计算机?

导言&#xff1a; 在数字时代&#xff0c; .malloxx 勒索病毒的威胁一直悬在我们头上&#xff0c;如何应对这种威胁&#xff0c;以及在数据被勒索后如何恢复它们&#xff0c;都是备受关注的话题。本文91数据恢复将向您介绍 .malloxx 勒索病毒的独特工作方式&#xff0c;提供与众…

stm32同芯片但不同flash工程更换Device出现报错

目录 1. 问题描述2. 解决方案 1. 问题描述 stm32同芯片但不同flash工程更换Device出现报错 2. 解决方案 更换Device&#xff0c;我是从ZE换为C8&#xff1a; 把这个从HD更换为MD 解决&#xff01;

解析Spring Boot中的Profile:配置文件与代码的双重掌控

目录 创建一个spring boot 项目spring boot 中的配置体系配置文件与 Profile代码控制与Profile 创建一个spring boot 项目 基于 Spring Boot 创建 Web 应用程序的方法有很多,我们选择在idea中直接进行创建&#xff0c;服务器URL选择Spring Initializer 网站&#xff0c;类型选…

Android Studio开发入门教程:如何更改APP的图标?

更改APP的图标&#xff08;安卓系统&#xff09; 环境&#xff1a;Windows10、Android Studio版本如下图、雷电模拟器。 推荐图标库 默认APP图标 将新图标拉进src/main/res/mipmap-hdpi文件夹&#xff08;一般app的icon图标是存放在mipmap打头的文件夹下的&#xff09; 更改sr…

flutter Could not get unknown property ‘ndkVersion’

使用的 flutter 版本为 3.7.2 &#xff0c;编译运行 如下 Could not get unknown property ‘ndkVersion’ for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension 解决方法是 在flutter-3.7.2\packages\flutter_tools\gradle\flutter.gradle配置…

Spring Boot深度解析:快速开发的秘密

&#x1f337;&#x1f341; 博主猫头虎&#xff08;&#x1f405;&#x1f43e;&#xff09;带您 Go to New World✨&#x1f341; &#x1f984; 博客首页——&#x1f405;&#x1f43e;猫头虎的博客&#x1f390; &#x1f433; 《面试题大全专栏》 &#x1f995; 文章图文…

C语言——指针进阶(2)

继续上次的指针&#xff0c;想起来还有指针的内容还没有更新完&#xff0c;今天来补上之前的内容&#xff0c;上次我们讲了函数指针&#xff0c;并且使用它来实现一些功能&#xff0c;今天我们就讲一讲函数指针数组等内容&#xff0c;废话不多说&#xff0c;我们开始今天的学习…

页面分布引导新手指引(driver.js)

页面分布引导&#xff08;driver.js&#xff09; 最近由于有一个需求——做新手指引&#xff0c;在新用户进入页面的时候提供指引和帮助,快速让用户熟悉页面的功能,但是为了不要过多影响现有的页面逻辑和样式,找到一款非常好用的工具driver.js:Driver.js是一个功能强大且高度可…

成都瀚网科技有限公司:抖音商家怎么免费入驻?

随着抖音成为全球最受欢迎的短视频平台之一&#xff0c;越来越多的商家开始关注抖音上的商机。抖音商家的进驻可以帮助商家扩大品牌影响力和销售渠道。那么&#xff0c;如何免费进入抖音成为商家呢&#xff1f;下面就为大家介绍一下具体步骤。 1、抖音商家如何免费注册&#xf…

Mojo安装使用初体验

一个声称比python块68000倍的语言 蹭个热度&#xff0c;安装试试 系统配置要求&#xff1a; 不支持Windows系统 配置要求: 系统&#xff1a;Ubuntu 20.04/22.04 LTSCPU&#xff1a;x86-64 CPU (with SSE4.2 or newer)内存&#xff1a;8 GiB memoryPython 3.8 - 3.10g or cla…

opensearch与elasticsearch对比

OpenSearch是一个基于Elasticsearch的开源搜索和分析引擎&#xff0c;它与Elasticsearch有很多相似之处&#xff0c;但也有一些不同之处&#xff1a; 开源许可证&#xff1a;OpenSearch使用Apache License 2.0开源许可证&#xff0c;而Elasticsearch使用的是Elastic License。…

C++斩题录|递归专题 | leetcode50. Pow(x, n)

个人主页&#xff1a;平行线也会相交 欢迎 点赞&#x1f44d; 收藏✨ 留言✉ 加关注&#x1f493;本文由 平行线也会相交 原创 收录于专栏【手撕算法系列专栏】【LeetCode】 &#x1f354;本专栏旨在提高自己算法能力的同时&#xff0c;记录一下自己的学习过程&#xff0c;希望…

Discourse 可以支持的存储类型

根据官方的这个主题&#xff1a;Configure an S3 compatible object storage provider for uploads - sysadmin - Discourse Meta Discourse 可以支持很多不同的对象存储。 感觉上是只要和 S3 兼容的基本上都能用。 建议 从对象存储的角度考虑&#xff0c;还是建议使用 S3。…

Golang开发--channel的使用

在 Go 语言中&#xff0c;channel&#xff08;通道&#xff09;是一种用于在 goroutine 之间进行通信和同步的并发原语。它提供了一种安全且简单的方式来传递数据。 通道的详细描述和使用方法 1.定义通道&#xff1a; 通道是通过使用 make 函数来创建的。通道有特定的类型&am…

C# Linq源码分析之Take(五)

概要 本文在C# Linq源码分析之Take&#xff08;四&#xff09;的基础上继续从源码角度分析Take的优化方法&#xff0c;主要分析Where.Select.Take的使用案例。 Where.Select.Take的案例分析 该场景模拟我们显示中将EF中与数据库关联的对象进行过滤&#xff0c;然后转换成Web…