第十四届蓝桥杯省赛C++A组F题【买瓜】题解(AC)

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

70pts

题目要求我们在给定的瓜中选择一些瓜,可以选择将瓜劈成两半,使得最后的总重量恰好等于 m m m。我们的目标是求出至少需要劈多少个瓜。

首先,我们注意到每个瓜的重量最多为 1 0 9 10^9 109,而求和的重量 m m m 也最多为 1 0 9 10^9 109,每个瓜的重量最多只能被分为两份。同时,由于每个瓜可以选择劈或者不劈,所以我们可以使用深度优先搜索(DFS)来遍历所有可能的组合。

在深度优先搜索的过程中,我们需要记录当前考虑到的瓜的序号 u,当前已经选中瓜的总重量 s 以及已经劈开的瓜的数量 cnt。当满足以下条件之一时,当前搜索分支可以提前结束:

  • 当前已选瓜的总重量 s 大于目标重量 m
  • 已经劈开的瓜的数量 cnt 大于等于目标重量 m,因为劈开的瓜越多,总重量越小,不可能达到 m

当我们遍历到最后一个瓜时,检查当前选中瓜的总重量 s 是否等于目标重量 m,如果等于,则更新答案 rescntres 中的较小值。

时间复杂度:

由于每个瓜都有三种选择,所以时间复杂度为 O ( 3 n ) O(3^n) O(3n),其中 n n n 是瓜的个数。

95pts

由于 70pts 速度过慢,故需要优化,用了两个 DFS 函数(折半搜索),dfs_1dfs_2,先对前一半的瓜进行搜索,将搜索结果存储在哈希表 h 中,然后对后一半的瓜进行搜索,同时在搜索过程中与哈希表 h 中的结果进行匹配,以找到满足条件的组合。

时间复杂度:

由于每个瓜都有三种选择,所以时间复杂度为 O ( 3 n 2 ) O(3^\frac{n}{2}) O(32n),其中 n n n 是瓜的个数。同时,由于在搜索过程中进行了剪枝,实际运行时间会小于 O ( 3 n 2 ) O(3^\frac{n}{2}) O(32n),又由于哈希表的常数过大,会导致程序缓慢,故无法通过所有数据。

100pts

本题要求从给定的瓜中选择一些瓜,可以对瓜进行劈开,使得最后选出的瓜的总重量恰好为 m m m,求最少需要劈开的瓜的个数。题目可以使用分治和二分查找的思路来解决。

首先,将所有的瓜按照重量进行排序。然后,将瓜分为两部分,前 n / 2 n/2 n/2 个瓜和后 n / 2 n/2 n/2 个瓜。对于每一部分,求出所有可能的瓜的重量组合以及对应的劈开的瓜的个数。接着,将前半部分的所有重量组合排序,方便后续使用二分查找。最后,遍历后半部分的所有重量组合,使用二分查找在前半部分寻找恰好使得总重量为 m m m 的组合,并记录最少需要劈开的瓜的个数。

具体实现如下:

  1. 读入瓜的个数 n 和目标重量 m,将目标重量 m 乘以 2 2 2,将题目转换成求瓜的重量恰好为 2 m 2m 2m 的组合。
  2. 读入每个瓜的重量,将瓜的重量也乘以 2 2 2
  3. 对瓜的重量进行排序。
  4. 计算分界点 tn,将瓜分为前后两部分,前半部分为 [0, tn),后半部分为 [tn, n)
  5. 使用深度优先搜索遍历前半部分的所有组合,记录每种组合的总重量和需要劈开的瓜的个数,保存在数组 alls 中。
  6. alls 数组进行排序,然后去重。
  7. 使用深度优先搜索遍历后半部分的所有组合,对于每种组合,使用二分查找在前半部分寻找恰好使得总重量为 2 m 2m 2m 的组合,并记录最少需要劈开的瓜的个数。
  8. 输出最少需要劈开的瓜的个数,如果不存在这样的组合,则输出 -1

时间复杂度:

本题的时间复杂度主要取决于深度优先搜索和二分查找的复杂度。在最坏情况下,深度优先搜索需要遍历所有可能的组合,因此时间复杂度为 O ( 3 n 2 ) O(3^\frac{n}{2}) O(32n)。二分查找的时间复杂度为 O ( log ⁡ n ) O(\log n) O(logn)。所以总的时间复杂度为 O ( 3 n 2 log ⁡ 3 n 2 + 3 n 2 ) O(3^\frac{n}{2} \log 3^\frac{n}{2} + 3^\frac{n}{2}) O(32nlog32n+32n)

手写哈希表

由于部分平台数据较强,可能无法通过 100 % 100\% 100% 的数据,文末补充手写哈希表的做法,实测可通过 100 % 100\% 100% 数据。

AC_Code

  • C++(70%)
#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long LL;

const int N = 35;

int n, m, tn;
int w[N];
int res = 50;

void dfs(int u, LL s, int cnt)
{
    if (s > m || cnt >= m)
        return;
    if (s == m)
    {
        res = cnt;
        return;
    }
    if (u == n)
        return;
    
    dfs(u + 1, s, cnt);
    dfs(u + 1, s + w[u] / 2, cnt + 1);
    dfs(u + 1, s + w[u], cnt);
}

int main()
{
    cin >> n >> m, m *= 2;
    for (int i = 0; i < n; ++ i )
        cin >> w[i], w[i] *= 2;
    
    dfs(0, 0, 0);
    
    cout << (res == 50? -1: res) << endl;
    
    return 0;
}
  • Java(70%)
import java.util.Scanner;
import java.util.Arrays;

public class Main {
    private static final int N = 35;

    private static int n, m;
    private static int[] w = new int[N];
    private static int res = 50;

    public static void dfs(int u, long s, int cnt) {
        if (s > m || cnt >= m) {
            return;
        }
        if (s == m) {
            res = cnt;
            return;
        }
        if (u == n) {
            return;
        }

        dfs(u + 1, s, cnt);
        dfs(u + 1, s + w[u] / 2, cnt + 1);
        dfs(u + 1, s + w[u], cnt);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        n = in.nextInt();
        m = in.nextInt();
        m *= 2;

        for (int i = 0; i < n; ++i) {
            w[i] = in.nextInt();
            w[i] *= 2;
        }

        dfs(0, 0, 0);

        System.out.println((res == 50 ? -1 : res));
    }
}
  • Python(65%)
from sys import stdin

N = 35

def dfs(u, s, cnt):
    if s > m or cnt >= m:
        return
    if s == m:
        global res
        res = cnt
        return
    if u == n:
        return

    dfs(u + 1, s, cnt)
    dfs(u + 1, s + w[u] // 2, cnt + 1)
    dfs(u + 1, s + w[u], cnt)

n, m = map(int, stdin.readline().split())
m *= 2
w = [int(x) * 2 for x in stdin.readline().split()]

res = 50

dfs(0, 0, 0)

print(-1 if res == 50 else res)
  • C++(95%)
#include <iostream>
#include <cstring>
#include <algorithm>
#include <unordered_map>

using namespace std;

typedef long long LL;

const int N = 35;

int n, m, tn;
int w[N];
int res = 50;
unordered_map<int, int> h;

void dfs_1(int u, LL s, int cnt)
{
    if (s > m)
        return;
    if (u == tn)
    {
        if (h.count(s))
            h[s] = min(h[s], cnt);
        else
            h[s] = cnt;
        return;
    }
    
    dfs_1(u + 1, s, cnt);
    dfs_1(u + 1, s + w[u] / 2, cnt + 1);
    dfs_1(u + 1, s + w[u], cnt);
}

void dfs_2(int u, LL s, int cnt)
{
    if (s > m || cnt > res)
        return;
    if (u == n)
    {   
        if (h.count(m - s))
            res = min(res, h[m - s] + cnt);
        return;
    }
    
    dfs_2(u + 1, s, cnt);
    dfs_2(u + 1, s + w[u] / 2, cnt + 1);
    dfs_2(u + 1, s + w[u], cnt);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    cin >> n >> m, m *= 2;
    for (int i = 0; i < n; ++ i )
        cin >> w[i], w[i] *= 2;
    
    sort(w, w + n);
    
    tn = max(0, n / 2 - 2);
    
    dfs_1(0, 0, 0);
    dfs_2(tn, 0, 0);
    
    cout << (res == 50? -1: res) << endl;
    
    return 0;
}
  • Java(95%)
import java.util.HashMap;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final int N = 35;

    private static int n, m, tn;
    private static int[] w = new int[N];
    private static int res = 50;
    private static HashMap<Integer, Integer> h = new HashMap<>();

    public static void dfs_1(int u, long s, int cnt) {
        if (s > m) {
            return;
        }
        if (u == tn) {
            h.put((int)s, h.getOrDefault((int)s, cnt));
            return;
        }

        dfs_1(u + 1, s, cnt);
        dfs_1(u + 1, s + w[u] / 2, cnt + 1);
        dfs_1(u + 1, s + w[u], cnt);
    }

    public static void dfs_2(int u, long s, int cnt) {
        if (s > m || cnt > res) {
            return;
        }
        if (u == n) {
            if (h.containsKey((int)(m - s))) {
                res = Math.min(res, h.get((int)(m - s)) + cnt);
            }
            return;
        }

        dfs_2(u + 1, s, cnt);
        dfs_2(u + 1, s + w[u] / 2, cnt + 1);
        dfs_2(u + 1, s + w[u], cnt);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        n = in.nextInt();
        m = in.nextInt();
        m *= 2;

        for (int i = 0; i < n; ++i) {
            w[i] = in.nextInt();
            w[i] *= 2;
        }

        Arrays.sort(w, 0, n);

        tn = Math.max(0, n / 2 - 2);

        dfs_1(0, 0, 0);
        dfs_2(tn, 0, 0);

        System.out.println((res == 50 ? -1 : res));
    }
}
  • Python(80%)
from itertools import combinations

def dfs_1(u, s, cnt):
    if s > m:
        return
    if u == tn:
        if s in h:
            h[s] = min(h[s], cnt)
        else:
            h[s] = cnt
        return

    dfs_1(u + 1, s, cnt)
    dfs_1(u + 1, s + w[u] // 2, cnt + 1)
    dfs_1(u + 1, s + w[u], cnt)

def dfs_2(u, s, cnt):
    global res  # 声明 res 为全局变量
    if s > m or cnt > res:
        return
    if u == n:
        if m - s in h:
            res = min(res, h[m - s] + cnt)
        return

    dfs_2(u + 1, s, cnt)
    dfs_2(u + 1, s + w[u] // 2, cnt + 1)
    dfs_2(u + 1, s + w[u], cnt)

n, m = map(int, input().split())
m *= 2
w = list(map(int, input().split()))
w = [x * 2 for x in w]

w.sort()

tn = max(0, n // 2 - 2)

h = {}
res = 50

dfs_1(0, 0, 0)
dfs_2(tn, 0, 0)

print(-1 if res == 50 else res)
  • C++(100%)
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>

#define x first
#define y second

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 35;

int n, m, tn, t;
int w[N];
int res = 50;
PII alls[1 << 21];

void dfs_1(int u, LL s, int cnt)
{
    if (s > m)
        return;
    if (u == tn)
    {
        alls[t ++] = {s, cnt};
        return;
    }
    
    dfs_1(u + 1, s, cnt);
    dfs_1(u + 1, s + w[u], cnt);
    dfs_1(u + 1, s + w[u] / 2, cnt + 1);
}

void dfs_2(int u, LL s, int cnt)
{
    if (s > m || cnt >= res)
        return;
    if (u == n)
    {   
        int l = 0, r = t - 1;
        while (l < r)
        {
            int mid = l + r >> 1;
            if (alls[mid].x + s >= m)
                r = mid;
            else
                l = mid + 1;
        }
        
        if (alls[l].x + s == m)
            res = min(res, alls[l].y + cnt);
        
        return;
    }
    
    dfs_2(u + 1, s, cnt);
    dfs_2(u + 1, s + w[u], cnt);
    dfs_2(u + 1, s + w[u] / 2, cnt + 1);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    cin >> n >> m, m *= 2;
    for (int i = 0; i < n; ++ i )
        cin >> w[i], w[i] *= 2;
    
    sort(w, w + n);
    
    tn = max(0, n / 2 - 2);
    
    dfs_1(0, 0, 0);
    
    sort(alls, alls + t);
    int k = 1;
    for (int i = 1; i < t; ++ i )
        if (alls[i].x != alls[i - 1].x)
            alls[k ++] = alls[i];
    t = k;
    
    dfs_2(tn, 0, 0);
    
    cout << (res == 50? -1: res) << endl;
    
    return 0;
}
  • Java(100%)
import java.io.*;
import java.util.*;

public class Main {
    private static final int N = 35;

    private int n, m, tn, t;
    private int[] w = new int[N];
    private int res = 50;
    private Pair[] alls = new Pair[1 << 21];

    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
    }

    private void solve() throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        String[] input = in.readLine().split(" ");
        n = Integer.parseInt(input[0]);
        m = Integer.parseInt(input[1]) * 2;

        input = in.readLine().split(" ");
        for (int i = 0; i < n; ++i) {
            w[i] = Integer.parseInt(input[i]) * 2;
        }

        Arrays.sort(w, 0, n);

        tn = Math.max(0, n / 2 - 2);

        dfs_1(0, 0, 0);

        Arrays.sort(alls, 0, t, Comparator.comparingInt(Pair::getX));

        int k = 1;
        for (int i = 1; i < t; ++i) {
            if (alls[i].x != alls[i - 1].x) {
                alls[k++] = alls[i];
            }
        }
        t = k;

        dfs_2(tn, 0, 0);

        out.println(res == 50 ? -1 : res);
        out.flush();
    }

    private void dfs_1(int u, long s, int cnt) {
        if (s > m)
            return;
        if (u == tn) {
            alls[t++] = new Pair((int) s, cnt);
            return;
        }

        dfs_1(u + 1, s, cnt);
        dfs_1(u + 1, s + w[u], cnt);
        dfs_1(u + 1, s + w[u] / 2, cnt + 1);
    }

    private void dfs_2(int u, long s, int cnt) {
        if (s > m || cnt >= res)
            return;
        if (u == n) {
            int l = 0, r = t - 1;
            while (l < r) {
                int mid = l + r >> 1;
                if (alls[mid].x + s >= m)
                    r = mid;
                else
                    l = mid + 1;
            }

            if (alls[l].x + s == m)
                res = Math.min(res, alls[l].y + cnt);

            return;
        }

        dfs_2(u + 1, s, cnt);
        dfs_2(u + 1, s + w[u], cnt);
        dfs_2(u + 1, s + w[u] / 2, cnt + 1);
    }

    static class Pair {
        int x, y;

        Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        int getX() {
            return x;
        }
    }
}
  • Python(100%)
import sys
from typing import List, Tuple

N = 35

n, m, tn, t = 0, 0, 0, 0
w = [0] * N
res = 50
alls: List[Tuple[int, int]] = [(0, 0)] * (1 << 21)


def dfs_1(u: int, s: int, cnt: int):
    global t, alls
    if s > m:
        return
    if u == tn:
        alls[t] = (s, cnt)
        t += 1
        return

    dfs_1(u + 1, s, cnt)
    dfs_1(u + 1, s + w[u], cnt)
    dfs_1(u + 1, s + w[u] // 2, cnt + 1)


def dfs_2(u: int, s: int, cnt: int):
    global res, alls
    if s > m or cnt >= res:
        return
    if u == n:
        l, r = 0, t - 1
        while l < r:
            mid = (l + r) // 2
            if alls[mid][0] + s >= m:
                r = mid
            else:
                l = mid + 1

        if alls[l][0] + s == m:
            res = min(res, alls[l][1] + cnt)

        return

    dfs_2(u + 1, s, cnt)
    dfs_2(u + 1, s + w[u], cnt)
    dfs_2(u + 1, s + w[u] // 2, cnt + 1)


def main():
    global n, m, tn, t, w, alls, res

    n, m = map(int, sys.stdin.readline().strip().split())
    m *= 2
    w = list(map(int, sys.stdin.readline().strip().split()))
    w = [x * 2 for x in w]

    w.sort()

    tn = max(0, n // 2 - 2)

    dfs_1(0, 0, 0)

    alls = sorted(alls[:t], key=lambda x: x[0])

    k = 1
    for i in range(1, t):
        if alls[i][0] != alls[i - 1][0]:
            alls[k] = alls[i]
            k += 1
    t = k

    dfs_2(tn, 0, 0)

    print(-1 if res == 50 else res)


if __name__ == "__main__":
    main()
  • C++(手写哈希表 100%)
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>

#define x first
#define y second

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 35, M = 1e7 + 7, null = 2e9 + 7;

int n, m, tn, t;
int w[N];
int res = N;
PII h[M];

int find(int s)
{
    int k = s % M;
    
    while (h[k].x != s && h[k].x != null)
    {
        k ++;
        if (k == M)
            k = 0;
    }
    
    return k;
}

void dfs_1(int u, LL s, int cnt)
{
    if (s > m)
        return;
    if (u == tn)
    {
        int k = find(s);
        h[k] = {s, min(h[k].y, cnt)};
        return;
    }
    
    dfs_1(u + 1, s, cnt);
    dfs_1(u + 1, s + w[u], cnt);
    dfs_1(u + 1, s + w[u] / 2, cnt + 1);
}

void dfs_2(int u, LL s, int cnt)
{
    if (s > m || cnt >= res)
        return;
    if (u == n)
    {   
        int tar = m - s;
        int k = find(tar);
        if (h[k].x != null)
            res = min(res, cnt + h[k].y);
        return;
    }
    
    dfs_2(u + 1, s, cnt);
    dfs_2(u + 1, s + w[u], cnt);
    dfs_2(u + 1, s + w[u] / 2, cnt + 1);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    cin >> n >> m, m <<= 1;
    for (int i = 0; i < n; ++ i )
        cin >> w[i], w[i] <<= 1;
    
    for (int i = 1; i < M; ++ i )
        h[i] = {null, null};
    
    sort(w, w + n);
    
    tn = max(0, n / 2 - 1);
    
    dfs_1(0, 0, 0);
    
    dfs_2(tn, 0, 0);
    
    cout << (res == N? -1: res) << '\n';
    
    return 0;
}

【在线测评】

在这里插入图片描述

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

3.2ui功能讲解之graph页面

本节重点介绍 : graph页面target页面flags页面status页面tsdb-status页面 访问地址 $ip:9090 graph页面 autocomplete 可以补全metrics tag信息或者 内置的关键字 &#xff0c;如sum聚合函数table查询 instante查询&#xff0c; 一个点的查询graph查询调整分辨率 resolutio…

中原汉族与北方游牧民族舞蹈文化在这段剧中表现得淋漓尽致,且看!

中原汉族与北方游牧民族舞蹈文化在这段剧中表现得淋漓尽致&#xff0c;且看&#xff01; 《神探狄仁杰》之使团喋血记是一部深入人心的历史侦探剧&#xff0c;不仅以其曲折离奇的案情和狄仁杰的睿智形象吸引观众&#xff0c;更以其对唐代文化的精准再现而备受赞誉。#李秘书讲写…

云计算【第一阶段(23)】Linux系统安全及应用

一、账号安全控制 1.1、账号安全基本措施 1.1.1、系统账号清理 将非登录用户的shell设为/sbin/nologin锁定长期不使用的账号删除无用的账号 1.1.1.1、实验1 用于匹配以/sbin/nologin结尾的字符串&#xff0c;$ 表示行的末尾。 &#xff08;一般是程序用户改为nologin&…

JavaScript——对象的创建

目录 任务描述 相关知识 对象的定义 对象字面量 通过关键字new创建对象 通过工厂方法创建对象 使用构造函数创建对象 使用原型(prototype)创建对象 编程要求 任务描述 本关任务&#xff1a;创建你的第一个 JavaScript 对象。 相关知识 JavaScript 是一种基于对象&a…

Spring Boot配置文件properties/yml/yaml

一、Spring Boot配置文件简介 &#xff08;1&#xff09;名字必须为application,否则无法识别。后缀有三种文件类型&#xff1a; properties/yml/yaml&#xff0c;但是yml和yaml使用方法相同 &#xff08;2&#xff09; Spring Boot 项⽬默认的配置文件为 properties &#xff…

kafka线上问题:rebalance

我是小米,一个喜欢分享技术的29岁程序员。如果你喜欢我的文章,欢迎关注我的微信公众号“软件求生”,获取更多技术干货! 大家好,我是小米。今天,我们来聊聊一个在大数据处理领域常见但又令人头疼的问题——Kafka消费组内的重平衡(rebalance)。这可是阿里巴巴面试中的经…

惠海 H6912 升压恒流芯片IC 支持2.6-40V升12V24V36V48V60V100V 10A 摄影灯 太阳能灯 UV灯 杀菌灯

1.产品描述 H6912是一款外围电路简洁的宽调光比升压调光LED恒流驱动器&#xff0c;可适用于2.6-40V输入 电压范围的LED恒流照明领域。H6912可以实现高精度的恒流效果&#xff0c;输出电流恒流精度≤士3%&#xff0c;电压工作范围为2.6-40V.可以轻松满足锂电池及中低压的应用需…

第十四届蓝桥杯省赛C++B组D题【飞机降落】题解(AC)

解题思路 这道题目要求我们判断给定的飞机是否都能在它们的油料耗尽之前降落。为了寻找是否存在合法的降落序列&#xff0c;我们可以使用深度优先搜索&#xff08;DFS&#xff09;的方法&#xff0c;尝试所有可能的降落顺序。 首先&#xff0c;我们需要理解题目中的条件。每架…

R语言学习笔记1-介绍与安装

R语言学习笔记1-介绍与安装 简介应用领域R语言优势安装步骤&#xff08;linux版本&#xff09;在R脚本中绘制简单的条形图示例 简介 R语言是一种非常强大和流行的据分析和统计建模工具。它是一种开源的编程语言和环境&#xff0c;专门设计用于数据处理、统计分析和可视化。 应…

PHP贵州非遗推广小程序-计算机毕业设计源码14362

摘 要 本文设计并实现了一个基于贵州非遗推广的小程序&#xff0c;旨在通过小程序平台推广和展示贵州省非物质文化遗产。该小程序提供了非遗项目介绍、相关活动展示、购买非遗产品等功能。 首先&#xff0c;我们收集了贵州省各个非遗项目的资料和相关信息&#xff0c;并将其整理…

vue3中使用弹幕组件vue-danmaku

1、最开始使用的是vue3-marquee&#xff0c;后面发现一直有一个bug无法解决&#xff0c;就是鼠标hover到第一个弹幕上字体就会变粗&#xff0c;已经提了issue给作者&#xff0c;但是目前还未答复&#xff0c;所以就换了方案。 地址如下&#xff1a; https://github.com/megasa…

同时安装JDK8和JDK17+环境变量默认无法修改

一、问题描述 当在windows系统中&#xff0c;同时安装JDK8和JDK17&#xff0c;环境变量默认就为jdk17&#xff0c;且从jdk17切换为jdk8后不生效&#xff0c;使用"java -version"命令查看后还是17版本。 解决方法 首先&#xff0c;产生的原因是&#xff0c;在安装…

【高性能服务器】多进程并发模型

&#x1f525;博客主页&#xff1a; 我要成为C领域大神&#x1f3a5;系列专栏&#xff1a;【C核心编程】 【计算机网络】 【Linux编程】 【操作系统】 ❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ 本博客致力于知识分享&#xff0c;与更多的人进行学习交流 对于常见的C/S模型…

MySQL 9.0创新版发布!功能又进化了!

作者&#xff1a;IT邦德 中国DBA联盟(ACDU)成员&#xff0c;10余年DBA工作经验&#xff0c; Oracle、PostgreSQL ACE CSDN博客专家及B站知名UP主&#xff0c;全网粉丝10万 擅长主流Oracle、MySQL、PG、高斯及Greenplum备份恢复&#xff0c; 安装迁移&#xff0c;性能优化、故障…

【ARM系列】1of N SPI

1 of N模式 SPI 概述配置流程 概述 GIC-600AE支持1 of N模式SPI。在此模式下可以将SPI target到多个core&#xff0c;并且GIC-600AE可以选择哪些内核接收SPI。 GIC-600AE只向处于powered up 并且使能中断组的core发送SPI。 GIC-600AE会优先考虑那些被认为是active的核&#xf…

如何利用Stable Diffusion在AI绘画领域赚钱,(附详细教程)小白兼职必看!

前言 AIGC 现已成为内容生产的引擎&#xff0c;正为内容创作领域带来前所未有的变革。它不仅能够在文本、图像、视频、音频等单一模态上生成内容&#xff0c;更能实现跨模态的生成&#xff0c;打通了多模态间的壁垒。 对于“普通人”来说&#xff0c;理解并有效的学会利用 AI…

方法重载与重写的区别

1.方法重载和重写都是实现多态的方式&#xff0c;区别在于重载是编译时多态&#xff0c;重写是运行时多态。 2.重载是在同一个类中&#xff0c;两个方法的方法名相同&#xff0c;参数列表不同&#xff08;参数类型、顺序、个数&#xff09;&#xff0c;与方法返回值无关&#x…

电路里电源不仅仅是电源

电源往往被认为是直流控制电路中重要的考虑因素之一——但我们也不能忽视其他关键因素&#xff1a;电源滤波器、转换器和备用电源模块。 输入电源是任何电气控制系统的基本配置。没有电源&#xff0c;就没有传感器、控制器、负载设备&#xff0c;什么都没有。因此&#xff0c;…

windows下搭建python+jupyter notebook

一.下载python 下面网址下载python3 https://www.python.org/ 二. 安装jupyter notebook 三. 修改配置 四. 检测是否正常运行

夸克网盘拉新暑期大涨价!官方授权渠道流程揭秘

夸克网盘拉新暑期活动来袭&#xff0c;价格大涨&#xff01;从7月1日开始持续两个月&#xff0c;在这两个月里夸克网盘拉新的移动端用户&#xff0c;一个从原来的5元涨到了10元。这对做夸克网盘拉新的朋友来说&#xff0c;真的是福利的。趁着暑期时间多&#xff0c;如果有想做夸…