蓝桥杯自我复习打卡

news2025/4/12 14:28:34

总复习,打卡1.

一。排序

1。选段排序

太可恶了,直接全排输出,一个测试点都没过。

AC

  首先,这个【l,r】区间一定要包含p,或者q,pq一个都不包含的,[l,r]区间无论怎么变,都对ans没有影响。

  其次,[l,r}区间端点一定要是l,或者r,或者两者都是,不然区间排序后,对应的a[p]不一定是最小的,a[q]也不一定是最大的。

  最后,minn=min(maxx,a[i]),均可以minn=min(minn,a[i])。

我们分别固定一个区间端点,然后去枚举另一个端点,求两个值,还有ans,利用大顶堆,big队列堆顶-minn,以保证ans尽可能大,small队列也是如此。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e6+5;
ll a[N];
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,p,q;cin>>n>>p>>q;
	for(ll i=1;i<=n;i++)cin>>a[i];
	
	priority_queue<ll,vector<ll>,greater<ll>> small;
	priority_queue<ll,vector<ll>,less<ll>> big;
	
	ll minn=a[p],maxx=a[q];
	ll len=q-p+1;
	big.push(a[p]);
	ll ans=0;
	
	for(ll i=p+1;i<=n;i++){
		minn=min(maxx,a[i]);
		big.push(a[i]);
		if(big.size()>len)big.pop();
		ans=max(ans,big.top()-minn);
	}
	
	small.push(a[q]);
	for(ll i=q-1;i>=1;i--){
		maxx=max(maxx,a[i]);
		small.push(a[i]);
		if(small.size()>len)small.pop();
		ans=max(ans,maxx-small.top());
	}
	
	cout<<ans;
	
	return 0;
}

 下面看细节,minn=min(minn,a[i])),minn=min(maxx,a[i])的区别。

2。字串排序 

 (待补.......)

3。排序

P2824 [HEOI2016/TJOI2016] 排序 

#include<bits/stdc++.h>
using namespace std;
typedef long  long ll;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,m;cin>>n>>m;
	vector<ll> a(n+1,0);
	for(ll i=1;i<=n;i++)cin>>a[i];
	while(m--){
		ll op,l,r;cin>>op>>l>>r;
		if(op==0){
			sort(a.begin()+l,a.begin()+r+1);
		}else if(op==1){
			sort(a.rbegin()+l,a.rbegin()+r+1);
		}
	}
	ll q;cin>>q;
	cout<<a[q];
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ll n, m; 
    cin >> n >> m;
    vector<ll> a(n + 1, 0);  // 注意下标从1开始

    // 输入数组
    for(ll i = 1; i <= n; i++) {
        cin >> a[i];
    }

    // 处理m次操作
    while(m--) {
        ll op, l, r;
        cin >> op >> l >> r;
        if(op == 0) {
            // 从a[l]到a[r]进行升序排序
            sort(a.begin() + l, a.begin() + r + 1); // 正常的升序排序
        } else if(op == 1) {
            // 从a[l]到a[r]进行降序排序
            sort(a.begin() + l, a.begin() + r + 1, greater<ll>()); // 使用greater进行降序排序
        }
    }

    ll q;
    cin >> q;
    cout << a[q] << endl;

    return 0;
}

线段树。。。。。此处略过。。。 

 

4。区间排序

AC 

#include<bits/stdc++.h>
using namespace std;
typedef long  long ll;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,m;cin>>n;
	vector<ll> a(n+1,0);
	for(ll i=1;i<=n;i++)cin>>a[i];
	cin>>m;
	while(m--){
		ll l,r;cin>>l>>r;
		sort(a.begin()+l,a.begin()+r+1);
	}
	for(ll i=1;i<=n;i++)cout<<a[i]<<' ';
	return 0;
}

5。奖牌排序

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

struct node {
	ll x, y, z;
	
	// 重载操作符==
	bool operator==(const node& other) const {
		return x == other.x && y == other.y && z == other.z;
	}
};

bool cmp1(const node &a, const node &b) {
	if (a.x != b.x) return a.x > b.x;
	else return 1;
}

bool cmp2(const node &a, const node &b) {
	if (a.y != b.y) return a.y > b.y;
	else return 1;
}

bool cmp3(const node &a, const node &b) {
	if (a.z != b.z) return a.z > b.z;
	else return 1;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	ll n;
	cin >> n;
	vector<node> nodes(n);
	
	for (ll i = 0; i < n; i++) {
		cin >> nodes[i].x >> nodes[i].y >> nodes[i].z;
	}
	
	vector<node> n1(n), n2(n), n3(n);
	n1 = nodes;
	n2 = nodes;
	n3 = nodes;
	
	sort(n1.begin(), n1.end(), cmp1);
	sort(n2.begin(), n2.end(), cmp2);
	sort(n3.begin(), n3.end(), cmp3);
	
	for (ll i = 0; i < n; i++) {
		ll idx1 = find(n1.begin(), n1.end(), nodes[i]) - n1.begin();
		ll idx2 = find(n2.begin(), n2.end(), nodes[i]) - n2.begin();
		ll idx3 = find(n3.begin(), n3.end(), nodes[i]) - n3.begin();
		cout << min({idx1, idx2, idx3})+1 << '\n';
	}
	
	return 0;
}

AC 

#include<bits/stdc++.h>
using namespace std;
typedef int ll;
const ll N=200005;
ll a[N],b[N],c[N];
ll a1[N],b1[N],c1[N];
ll n;
bool cmp(ll x,ll y){
	return x>y;
}
int erfen1(int x)//在a数组中二分查找
{
	int l = 0,r = n+1;
	while(l+1 < r)
	{
		int mid = (l+r)/2;
		if(a[mid] <= x) r = mid;//右边的都不是答案
		else l = mid;//左边的都不是答案
	}
	return r;
}

int erfen2(int x)//在b数组中二分查找
{
	int l = 0,r = n+1;
	while(l+1 < r)
	{
		int mid = (l+r)/2;
		if(b[mid] <= x) r = mid;
		else l = mid;
	}
	return r;
}

int erfen3(int x)//在c数组中二分查找
{
	int l = 0,r = n+1;
	while(l+1 < r)
	{
		int mid = (l+r)/2;
		if(c[mid] <= x) r = mid;
		else l = mid;
	}
	return r;
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	for(ll i=1;i<=n;i++){
		cin>>a1[i]>>b1[i]>>c1[i];
		a[i] = a1[i];
		b[i] = b1[i];
		c[i] = c1[i];
	}
	sort(a+1,a+n+1,cmp);
	sort(b+1,b+n+1,cmp);
	sort(c+1,c+n+1,cmp);
	
	//for(ll i=1;i<=n;i++)cout<<a[i]<<" "<<b[i]<<" "<<c[i]<<'\n';
	
	for(ll i=1;i<=n;i++){
		ll idx1=erfen1(a1[i]);
		ll idx2=erfen2(b1[i]);
		ll idx3=erfen3(c1[i]);
		cout<<min({idx1,idx2,idx3})<<'\n';
	}
	return 0;
}

6。排列排序

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

int a[1000005];

int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        int n, ans = 0;
        scanf("%d", &n);
        for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
        int i = 1;
        while (i <= n)
        {
            if (a[i] == i) // 当前元素已经在正确的位置
            {
                i++;
            }
            else // 不在正确位置
            {
                int maxv = a[i];
                int j = i + 1;
                maxv = max(maxv, a[j]);
                while (j <= n && maxv > j) // 继续扩展区间直到可以排序
                {
                    j++;
                    maxv = max(maxv, a[j]);
                }
                ans += (j - i + 1);
                i = j + 1; // 跳过已处理的区间
            }
        }
        cout << ans << endl;
    }
    return 0;
}

7。数列排序 

 

这题老演员了,逆序遍历,每个数前面如果有比它大的数,就和比他大的最大的那个数交换位置,纸上模拟是对的,但事实却差强人意 。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e5 + 5;
ll a[N];

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n; cin >> n;
    for (ll i = 1; i <= n; i++) cin >> a[i];

    ll count = 0;
    for (ll i = n; i >= 2; i--) {
        auto it = max_element(a + 1, a + i);
        if (it != a + i - 1) {  // 如果当前最大元素不在当前位置
            swap(*it, a[i - 1]);  // 交换
            count++;
        }
    }

    cout << count << '\n';
    return 0;
}

逆天,居然可以直接暴力。。。。。。。。应该Just do it。。。。。。这个题写法超级多,我看甚至还有人用dfs,树状数组。。

 AC

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e5 + 5;
ll a[N];
ll b[N];
map<ll, ll> F;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    ll n;
    cin >> n;
    
    // 输入数组 a 和 b
    for (ll i = 1; i <= n; i++) {
        cin >> a[i];
        b[i] = a[i];
        F[a[i]] = i;  // 记录每个元素的位置
    }
    
    // 排序数组 b
    sort(b + 1, b + n + 1);

    ll count = 0;
    for (ll i = 1; i <= n; i++) {
        if (a[i] != b[i]) {
            count++;
            ll x = F[b[i]];  // 获取 b[i] 在 a 数组中的原位置
            F[a[i]] = x;      // 更新位置映射
            swap(a[x], a[i]); // 交换
        }
    }

    cout << count << '\n';
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
struct node
{
	int z,p;//其值、位置 
}a[100005];
int n,b[100005],ans=0;
bool cmp(node n1,node n2){return n1.z<n2.z;}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&b[i]);
		a[i].z=b[i];
		a[i].p=i;
	}//输入 
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++)//可以改成i<n 
	{
		if(a[i].z==b[i])continue;
		int j=a[i].p;ans++;
		swap(b[i],b[j]);//注意了 b[i]和b[j]已交换 不要搞混对象 
		int l=i+1,r=n,mid;
		while(l<=r)//二分查找 
		{
			mid=(l+r)/2;
			if(a[mid].z>b[j])r=mid-1;
			else if(a[mid].z<b[j])l=mid+1;
			else break;//找到了 
		}
		a[mid].p=j;//修改地址 
	}
	printf("%d\n",ans);
	return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n), sorted_a(n);
    
    // 读取输入
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        sorted_a[i] = a[i];
    }
    
    // 排序后得到的数列
    sort(sorted_a.begin(), sorted_a.end());

    // 映射原数组到排序数组的索引
    vector<int> index_map(n);
    for (int i = 0; i < n; i++) {
        auto it = find(sorted_a.begin(), sorted_a.end(), a[i]);
        index_map[i] = distance(sorted_a.begin(), it);
    }
    
    vector<bool> visited(n, false);
    int min_swaps = 0;

    // 遍历每个元素
    for (int i = 0; i < n; i++) {
        // 如果这个元素已经被访问过或者已经在正确的位置上,跳过
        if (visited[i] || index_map[i] == i)
            continue;

        // 计算环的长度
        int cycle_length = 0;
        int j = i;
        while (!visited[j]) {
            visited[j] = true;
            j = index_map[j];  // 跳到下一个索引
            cycle_length++;
        }

        // 对于每个环,需要交换的次数是环的长度 - 1
        if (cycle_length > 1) {
            min_swaps += (cycle_length - 1);
        }
    }

    cout << min_swaps << endl;
    return 0;
}

 非AC

本来不想用struct,想简化一下,结果弄巧成拙,我好像知道我哪里错了。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+5;
ll a[N];
ll b[N];
ll erfen(ll x,ll l,ll r){
	ll mid=0;
	while(l<=r){
		mid=(l+r)/2;
		if(b[mid]>x)r=mid-1;
		else if(b[mid]<x)l=mid+1;
		else break;
	}
	return mid;
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n;cin>>n;
	for(ll i=1;i<=n;i++)cin>>a[i],b[i]=a[i];
	
	sort(b+1,b+n+1);
	
	ll count=0;
	for(ll i=1;i<=n;i++){
		if(b[i]!=a[i]){
			ll idx=erfen(a[i],i+1,n);
			swap(a[idx],a[i]);
			count++;
		}
	}
	cout<<count<<'\n';
	return 0;
}

修改一下:

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n;cin>>n;
	ll a[n+1];
	ll b[n+1];
	map<ll,ll> mp;
	for(ll i=1;i<=n;i++){
		cin>>a[i];
		mp[a[i]]=i;
		b[i]=a[i];
	}
	sort(b+1,b+n+1);///不要写成b+n了。。。。是b+n+1.....
	ll count=0;
	for(ll i=1;i<=n;i++){
		if(a[i]!=b[i]){
			count++;
			ll idx=mp[b[i]];
			swap(a[idx],a[i]);
			mp[a[i]]=i;
			mp[a[idx]]=idx;
			//a[idx]=a[i];
		}
	}
	cout<<count<<'\n';
	return 0;
}

8。分数排序

暴力才27分

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PII;
const ll N = 1e5 + 5;
ll a[N];
ll b[N];
ll c[N];

// 自定义比较函数,按最简分数的大小排序
bool cmp(const PII &a, const PII &b) {
    long double x = a.first * 1.0 / a.second;
    long double y = b.first * 1.0 / b.second;
    return x < y;
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n, q; 
    cin >> n >> q;

    // 输入 a 和 b 数组
    for (ll i = 1; i <= n; i++) cin >> a[i];
    for (ll i = 1; i <= n; i++) cin >> b[i];
    
    // 输入查询数组 c
    for (ll i = 1; i <= q; i++) cin >> c[i];

    // 用 vector 存储所有分数
    vector<PII> ppp;
    
    // 生成所有分数并存储
    for (ll i = 1; i <= n; i++) {
        for (ll j = 1; j <= n; j++) {
            ll yueshu = __gcd(a[i], b[j]);
            ll x = a[i] / yueshu;
            ll y = b[j] / yueshu;
            ppp.push_back({x, y});
        }
    }

    // 对分数按值进行排序
    sort(ppp.begin(), ppp.end(), cmp);

    // 输出查询的分数
    for (ll i = 1; i <= q; i++) {
        cout << ppp[c[i] - 1].first << " " << ppp[c[i] - 1].second << '\n';
    }

    return 0;
}

AC

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll N	=1e6+10;
ll a[N],b[N];
bool p[N];

ll check(ld x,ll n){
	ll i=1,j=0;
	ll sum=0;
 	while(i<=n){
		while((ld)a[j+1]<(ld)x*b[i]&&j<n)j++;
		sum+=j;
		i++;
	}
	return sum;
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,q;cin>>n>>q;
	for(ll i=1;i<=n;i++)cin>>a[i],p[a[i]]=1;
	for(ll i=1;i<=n;i++)cin>>b[i];
	sort(a+1,a+1+n);
	sort(b+1,b+n+1);
	
	//for(ll i=1;i<=n;i++)cout<<a[i]<<" "<<b[i]<<'\n';
	
	while(q--){
		ll c;cin>>c;
		ld r=(ld)a[n]/b[1];
		ld l=(ld)a[1]/b[n];
		ld mid=0;
		while((r-l)>=1e-13){
			mid=(l+r)/2;
			if(check(mid,n)>=c)r=mid;//精度比较高,所以步长不可以为一了,也即不可以r=mid-1;l=mid+1;
			else l=mid;
			//else break;
		}
		ll fz=0;
		for(ll i=1;i<=n;i++){
			fz=round(l*b[i]);
			if(fz<=1e6&&p[fz]==1&&fabs(fz-l*b[i])<1e-7){
				ll yueshu=__gcd(fz,b[i]);
				//fz/=yueshu,b[i]/=yueshu;//不要这样会影响后面的数的计算
				cout<<fz/yueshu<<" "<<b[i]/yueshu<<'\n';
				break;
			}
		}
	}
	return 0;
}

9。排列排序问题 

1~n的排列正序或者逆序,通过切割成若干子序列,重排子序列或者反转,使最终的整个排列有序,我们知道如果相邻元素不相差1,比如1 5 7 6 2 4 3,其中无论15怎么翻转都不会使最终序列有序,所以1,5一定要切割开,通过重排使其有序,题目也就转化成了,求abs(a[i+1]-a[i])>1的个数了。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e6+5;
ll a[N];
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n;cin>>n;
	for(ll i=1;i<=n;i++)cin>>a[i];

	
		ll cnt=0;
		for(ll i=1;i<n;i++){
			if(abs(a[i+1]-a[i])>1)
				cnt++;
		}
		cout<<cnt<<'\n';
	
	return 0;
}

10。排序集合

​
#include<bits/stdc++.h>
using namespace std;
int n, k;

int main() {
    // 读取输入
    scanf("%d%d", &n, &k);

    // 特殊情况,如果k == 1,意味着空集
    if (k == 1) {
        printf("0\n");
        return 0;
    }

    k--; // 从0开始计数,因此减去1

    // 遍历所有的元素
    for (int i = 1; i <= n; i++) {
        // 如果k已经为0,说明我们已经找到了目标子集
        if (k == 0) {
            break;
        }

        // 如果k小于等于 2^(n-i),说明当前元素i必定在第k小的子集中
        if (k <= pow(2, n - i)) {
            printf("%d ", i); // 输出当前元素
            k--; // 减去已经选择的这个元素对应的子集数量
        } else {
            // 如果k大于 2^(n-i),说明当前元素i不在第k小的子集中
            k -= pow(2, n - i); // 跳过包含当前元素i的子集,更新k
        }
    }

    return 0;
}

​

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

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

相关文章

Java零基础入门笔记:(6)面向对象

前言 本笔记是学习狂神的java教程&#xff0c;建议配合视频&#xff0c;学习体验更佳。 【狂神说Java】Java零基础学习视频通俗易懂_哔哩哔哩_bilibili 第1-2章&#xff1a;Java零基础入门笔记&#xff1a;(1-2)入门&#xff08;简介、基础知识&#xff09;-CSDN博客 第3章…

【3天快速入门WPF】13-MVVM进阶

目录 1. 窗体设置2. 字体图标3. 控件模板4. 页面逻辑4.1. 不使用MVVM4.2. MVVM模式实现本篇我们开发一个基于MVVM的登录页面,用来回顾下之前学习的内容 登录页面如下: 窗体取消了默认的标题栏,调整为带阴影的圆角窗体,左侧放一张登录背景图,右边自绘了一个关闭按钮,文本框…

【MongoDB】在Windows11下安装与使用

官网下载链接&#xff1a;Download MongoDB Community Server 官方参考文档&#xff1a;https://www.mongodb.com/zh-cn/docs/manual/tutorial/install-mongodb-on-windows/#std-label-install-mdb-community-windows 选择custom类型&#xff0c;其他默认 注意&#xff0c;此选…

deepseek使用记录18——文化基因美食篇

子篇&#xff1a;薪火相传的味觉辩证法——从燧人氏到预制菜的文化突围 一、石器时代的启蒙&#xff1a;食物探索中的原始辩证法 在贾湖遗址的陶罐残片上&#xff0c;碳化稻米与蜂蜜的结晶层相互交叠&#xff0c;这是9000年前先民对"甘"与"饱"的首次辩证…

2025学年安徽省职业院校技能大赛 “信息安全管理与评估”赛项 比赛样题任务书

2024-2025 学年广东省职业院校技能大赛 “信息安全管理与评估”赛项 技能测试试卷&#xff08;五&#xff09; 第一部分&#xff1a;网络平台搭建与设备安全防护任务书第二部分&#xff1a;网络安全事件响应、数字取证调查、应用程序安全任务书任务1 &#xff1a;内存取证&…

在 Ansys Maxwell 中分析磁场

在 Ansys Maxwell 中分析磁场 分析磁场的能力对于理解电磁系统至关重要。Ansys Maxwell 为工程师提供了强大的工具&#xff0c;帮助他们探索磁场数据并从中提取有价值的见解。在本指南中&#xff0c;我将深入研究 Ansys Maxwell 中的几种基本技术和方法&#xff0c;以有效地分…

DeepSeek FlashMLA:用技术创新破解大模型落地难题

注&#xff1a;此文章内容均节选自充电了么创始人&#xff0c;CEO兼CTO陈敬雷老师的新书《自然语言处理原理与实战》&#xff08;人工智能科学与技术丛书&#xff09;【陈敬雷编著】【清华大学出版社】 文章目录 DeepSeek大模型技术系列十四DeepSeek大模型技术系列十四》DeepS…

[补充]原码、反、补、移码的转换

近期在学习Java的类型转换的知识&#xff0c;强制类型转换的时候会遇到数据&#xff08;丢失&#xff09;溢出的问题。 最后在IDEA控制台输出的时候&#xff0c;出现了负数。了解了一下强制类型转换在计算机中的原理&#xff0c;随后就复习了一下原码、反、补、移码的转换的知…

安装Node.js

1.打开官网&#xff0c;下载安装包 2.安装过程中&#xff0c;全部默认&#xff0c;next. 3.在安装根目录下&#xff0c;新建两个文件夹【node_cache】和【node_global】 4.检测是否安装成功 打开控制台&#xff0c;node -v, npm -v, 显示版本号。 5.配置环境变量 1>从no…

【力扣】堆相关总结

priority_queue std::priority_queue 是 C 标准库中的一个容器适配器&#xff0c;提供了堆&#xff08;Heap&#xff09;数据结构的功能。它通常用于实现优先队列&#xff0c;允许你高效地插入元素和访问最大或最小元素。 头文件 #include <queue> 基本定义 std::pri…

【前端基础】3、HTML的常用元素(h、p、img、a、iframe、div、span)、不常用元素(strong、i、code、br)

HTML结构 一个HTML包含以下部分&#xff1a; 文档类型声明html元素 head元素body元素 例&#xff08;CSDN&#xff09;&#xff1a; 一、文档类型声明 HTML最一方的文档称为&#xff1a;文档类型声明&#xff0c;用于声明文档类型。即&#xff1a;<!DOCTYPE html>…

【漫话机器学习系列】113.逻辑回归(Logistic Regression) VS 线性回归(Linear Regression)

逻辑回归 vs 线性回归&#xff1a;详解对比 在机器学习和统计学中&#xff0c;逻辑回归&#xff08;Logistic Regression&#xff09; 和 线性回归&#xff08;Linear Regression&#xff09; 都是非常常见的模型。尽管它们的数学表达式有一定的相似性&#xff0c;但它们的应用…

Redis---缓存穿透,雪崩,击穿

文章目录 缓存穿透什么是缓存穿透&#xff1f;缓存穿透情况的处理流程是怎样的&#xff1f;缓存穿透的解决办法缓存无效 key布隆过滤器 缓存雪崩什么是缓存雪崩&#xff1f;缓存雪崩的解决办法 缓存击穿什么是缓存击穿&#xff1f;缓存击穿的解决办法 区别对比 在如今的开发中&…

Skywalking介绍,Skywalking 9.4 安装,SpringBoot集成Skywalking

一.Skywalking介绍 Apache SkyWalking是一个开源的分布式追踪与性能监视平台&#xff0c;特别适用于微服务架构、云原生环境以及基于容器&#xff08;如Docker、Kubernetes&#xff09;的应用部署。该项目由吴晟发起&#xff0c;并已加入Apache软件基金会的孵化器&#xff0c;…

Thonny+MicroPython+ESP32开发环境搭建

1、下载&安装Thonny 安装成功后&#xff0c;会在桌面生成快捷键 双击快捷键&#xff0c;打开程序&#xff0c;界面如下 2、下载MicroPython 下载地址&#xff1a;MicroPython - Python for microcontrollers v1.19版(推荐&#xff0c;此版本稳定)&#xff1a; https://do…

数据结构:反射 和 枚举

目录 一、反射 1、定义 2、反射相关的类 3、Class类 &#xff08;2&#xff09;常用获得类中属性相关的方法&#xff1a; &#xff08;3&#xff09;获得类中注解相关的方法&#xff1a; &#xff08;4&#xff09;获得类中构造器相关的方法&#xff1a; &#xff08;…

前缀和算法 算法4

算法题中帮助复习的知识 vector<int > dp( n ,k); n为数组大小 ,k为初始化 哈希表unordered_map<int ,int > hash; hash.find(k)返回值是迭代器 ,找到k返回其迭代器 没找到返回hash.end() hash.count(k)返回值是数字 ,找到k返回1 ,没找到返回0. C和java中 负数…

USRP7440-通用软件无线电平台

1、产品描述 USRP7440基于第三代XILINX Zynq UltraScale RFSoC架构&#xff0c;它将射频ADC、DAC、ARM、FPGA等集成一体&#xff0c;瞬时带宽可以达到2.5GHz&#xff0c;尤其适合于射频直采应用&#xff0c;比如通信与雷达。 第一代RFSOC高达4GHz • 8x 或 16x 6.554GSPS DAC…

yunedit-post ,api测试比postman更好

postman应该是大家最熟悉的api测试软件了&#xff0c;但是由于它是外国软件&#xff0c;使用它的高端功能注册和缴费都比较麻烦。生成在线文档分享也经常无法访问被拦截掉。 这里可以推荐一下yunedit-post&#xff0c;该有的功能都有。 https://www.yunedit.com/postdetail …

移动零

一 &#xff1a;题目 二&#xff1a;思路 双指针法&#xff1a; 两个指针将数组划分成三个部分&#xff1a; 解释&#xff1a; ①&#xff1a;所以一开始dest要等于-1&#xff0c;因为没有非零的元素&#xff0c;cur0&#xff0c;因为要从头开始遍历数组 ②&#xff1a;cur为…