Educational Codeforces Round 165 (Rated for Div. 2 ABCDE 题)视频讲解

A. Two Friends

Problem Statement

Monocarp wants to throw a party. He has n n n friends, and he wants to have at least 2 2 2 of them at his party.

The i i i-th friend’s best friend is p i p_i pi. All p i p_i pi are distinct, and for every i ∈ [ 1 , n ] i \in [1, n] i[1,n], p i ≠ i p_i \ne i pi=i.

Monocarp can send invitations to friends. The i i i-th friend comes to the party if both the i i i-th friend and the p i p_i pi-th friend receive an invitation (note that the p i p_i pi-th friend doesn’t have to actually come to the party). Each invitation is sent to exactly one of the friends.

For example, if p = [ 3 , 1 , 2 , 5 , 4 ] p = [3, 1, 2, 5, 4] p=[3,1,2,5,4], and Monocarp sends invitations to the friends [ 1 , 2 , 4 , 5 ] [1, 2, 4, 5] [1,2,4,5], then the friends [ 2 , 4 , 5 ] [2, 4, 5] [2,4,5] will come to the party. The friend 1 1 1 won’t come since his best friend didn’t receive an invitation; the friend 3 3 3 won’t come since he didn’t receive an invitation.

Calculate the minimum number of invitations Monocarp has to send so that at least 2 2 2 friends come to the party.

Input

The first line contains one integer t t t ( 1 ≤ t ≤ 5000 1 \le t \le 5000 1t5000) — the number of test cases.

Each test case consists of two lines:

  • the first line contains one integer n n n ( 2 ≤ n ≤ 50 2 \le n \le 50 2n50) — the number of friends;
  • the second line contains n n n integers p 1 , p 2 , … , p n p_1, p_2, \dots, p_n p1,p2,,pn ( 1 ≤ p i ≤ n 1 \le p_i \le n 1pin; p i ≠ i p_i \ne i pi=i; all p i p_i pi are distinct).

Output

Print one integer — the minimum number of invitations Monocarp has to send.

Example

Example

input
3
5
3 1 2 5 4
4
2 3 4 1
2
2 1
output
2
3
2

Note

In the first testcase, Monocarp can send invitations to friends 4 4 4 and 5 5 5. Both of them will come to the party since they are each other’s best friends, and both of them have invitations.

In the second testcase, Monocarp can send invitations to friends 1 , 2 1, 2 1,2 and 3 3 3, for example. Then friends 1 1 1 and 2 2 2 will attend: friend 1 1 1 and his best friend 2 2 2 have invitations, friend 2 2 2 and his best friend 3 3 3 have invitations. Friend 3 3 3 won’t attend since his friend 4 4 4 doesn’t have an invitation. It’s impossible to send invitations to fewer than 3 3 3 friends in such a way that at least 2 2 2 come.

In the third testcase, Monocarp can send invitations to both friends 1 1 1 and 2 2 2, and both of them will attend.

Solution

具体见文后视频。


Code

#include <bits/stdc++.h>
#define fi first
#define se second
#define int long longusing namespace std;typedef pair<int, int> PII;
typedef long long LL;void solve() {int n;cin >> n;std::vector<int> a(n + 1);for (int i = 1; i <= n; i ++)cin >> a[i];for (int i = 1; i <= n; i ++)if (i == a[a[i]]) {cout << 2 << endl;return;}cout << 3 << endl;
}signed main() {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);int dt;cin >> dt;while (dt --)solve();return 0;
}

B. Shifts and Sorting

Problem Statement

Let’s define a cyclic shift of some string s s s as a transformation from s 1 s 2 … s n − 1 s n s_1 s_2 \dots s_{n-1} s_{n} s1s2sn1sn into s n s 1 s 2 … s n − 1 s_{n} s_1 s_2 \dots s_{n-1} sns1s2sn1. In other words, you take one last character s n s_n sn and place it before the first character while moving all other characters to the right.

You are given a binary string s s s (a string consisting of only 0-s and/or 1-s).

In one operation, you can choose any substring s l s l + 1 … s r s_l s_{l+1} \dots s_r slsl+1sr ( 1 ≤ l < r ≤ ∣ s ∣ 1 \le l < r \le |s| 1l<rs) and cyclically shift it. The cost of such operation is equal to r − l + 1 r - l + 1 rl+1 (or the length of the chosen substring).

You can perform the given operation any number of times. What is the minimum total cost to make s s s sorted in non-descending order?

Input

The first line contains a single integer t t t ( 1 ≤ t ≤ 1 0 4 1 \le t \le 10^4 1t104) — the number of test cases.

The first and only line of each test case contains a binary string s s s ( 2 ≤ ∣ s ∣ ≤ 2 ⋅ 1 0 5 2 \le |s| \le 2 \cdot 10^5 2s2105; s i ∈ s_i \in si {0, 1}) — the string you need to sort.

Additional constraint on the input: the sum of lengths of strings over all test cases doesn’t exceed 2 ⋅ 1 0 5 2 \cdot 10^5 2105.

Output

For each test case, print the single integer — the minimum total cost to make string sorted using operation above any number of times.

Example

Example

input
5
10
0000
11000
101011
01101001
output
2
0
9
5
11

Note

In the first test case, you can choose the whole string and perform a cyclic shift: 10 → \rightarrow 01. The length of the substring is 2 2 2, so the cost is 2 2 2.

In the second test case, the string is already sorted, so you don’t need to perform any operations.

In the third test case, one of the optimal strategies is the next:

  1. choose substring [ 1 , 3 ] [1, 3] [1,3]: 11000 → \rightarrow 01100;
  2. choose substring [ 2 , 4 ] [2, 4] [2,4]: 01100 → \rightarrow 00110;
  3. choose substring [ 3 , 5 ] [3, 5] [3,5]: 00110 → \rightarrow 00011.

The total cost is 3 + 3 + 3 = 9 3 + 3 + 3 = 9 3+3+3=9.

Solution

具体见文后视频。


Code

#include <bits/stdc++.h>
#define fi first
#define se second
#define int long longusing namespace std;typedef pair<int, int> PII;
typedef long long LL;void solve() {string s;cin >> s;int n = s.size();s = ' ' + s;int tot = 0, res = 0;for (int i = 1; i <= n; i ++) if (s[i] == '1')tot ++;else {if (!tot) continue;res += tot + 1;}cout << res << endl;
}signed main() {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);int dt;cin >> dt;while (dt --)solve();return 0;
}

C. Minimizing the Sum

Problem Statement

You are given an integer array a a a of length n n n.

You can perform the following operation: choose an element of the array and replace it with any of its neighbor’s value.

For example, if a = [ 3 , 1 , 2 ] a=[3, 1, 2] a=[3,1,2], you can get one of the arrays [ 3 , 3 , 2 ] [3, 3, 2] [3,3,2], [ 3 , 2 , 2 ] [3, 2, 2] [3,2,2] and [ 1 , 1 , 2 ] [1, 1, 2] [1,1,2] using one operation, but not [ 2 , 1 , 2 [2, 1, 2 [2,1,2] or [ 3 , 4 , 2 ] [3, 4, 2] [3,4,2].

Your task is to calculate the minimum possible total sum of the array if you can perform the aforementioned operation at most k k k times.

Input

The first line contains a single integer t t t ( 1 ≤ t ≤ 1 0 4 1 \le t \le 10^4 1t104) — the number of test cases.

The first line of each test case contains two integers n n n and k k k ( 1 ≤ n ≤ 3 ⋅ 1 0 5 1 \le n \le 3 \cdot 10^5 1n3105; 0 ≤ k ≤ 10 0 \le k \le 10 0k10).

The second line contains n n n integers a 1 , a 2 , … , a n a_1, a_2, \dots, a_n a1,a2,,an ( 1 ≤ a i ≤ 1 0 9 1 \le a_i \le 10^9 1ai109).

Additional constraint on the input: the sum of n n n over all test cases doesn’t exceed 3 ⋅ 1 0 5 3 \cdot 10^5 3105.

Output

For each test case, print a single integer — the minimum possible total sum of the array if you can perform the aforementioned operation at most k k k times.

Example

input
4
3 1
3 1 2
1 3
5
4 2
2 2 1 3
6 3
4 1 2 2 4 3
output
4
5
5
10

Note

In the first example, one of the possible sequences of operations is the following: [ 3 , 1 , 2 ] → [ 1 , 1 , 2 [3, 1, 2] \rightarrow [1, 1, 2 [3,1,2][1,1,2].

In the second example, you do not need to apply the operation.

In the third example, one of the possible sequences of operations is the following: [ 2 , 2 , 1 , 3 ] → [ 2 , 1 , 1 , 3 ] → [ 2 , 1 , 1 , 1 ] [2, 2, 1, 3] \rightarrow [2, 1, 1, 3] \rightarrow [2, 1, 1, 1] [2,2,1,3][2,1,1,3][2,1,1,1].

In the fourth example, one of the possible sequences of operations is the following: [ 4 , 1 , 2 , 2 , 4 , 3 ] → [ 1 , 1 , 2 , 2 , 4 , 3 ] → [ 1 , 1 , 1 , 2 , 4 , 3 ] → [ 1 , 1 , 1 , 2 , 2 , 3 ] [4, 1, 2, 2, 4, 3] \rightarrow [1, 1, 2, 2, 4, 3] \rightarrow [1, 1, 1, 2, 4, 3] \rightarrow [1, 1, 1, 2, 2, 3] [4,1,2,2,4,3][1,1,2,2,4,3][1,1,1,2,4,3][1,1,1,2,2,3].

Solution

具体见文后视频。


Code

#include <bits/stdc++.h>
#define fi first
#define se second
#define int long longusing namespace std;typedef pair<int, int> PII;
typedef long long LL;const int N = 3e5 + 20;int n, k;
int a[N], f[N][20];
int mn[N][20];void build() {int m = log2(n) + 1;for (int j = 0; j < m; j ++)for (int i = 1; i <= n - (1ll << j) + 1; i ++)if (!j) mn[i][j] = a[i] - a[i - 1];else mn[i][j] = min(mn[i][j - 1], mn[i + (1ll << j - 1)][j - 1]);
}
int query(int l, int r) {int t = log2(r - l + 1);return min(mn[l][t], mn[r - (1ll << t) + 1][t]);
}void solve() {cin >> n >> k;for (int i = 1; i <= n; i ++)cin >> a[i], a[i] += a[i - 1];for (int i = 0; i <= n; i ++)for (int j = 0; j <= k; j ++)f[i][j] = -1e16;build();f[0][k] = 0;for (int i = 1; i <= n; i ++)for (int t = 0; t <= k; t ++) {f[i][t] = f[i - 1][t];for (int j = max(1ll, i - k); j <= i; j ++) {if (t + (i - j) <= k)f[i][t] = max(f[i][t], f[j - 1][t + (i - j)] + a[i] - a[j - 1] - query(j, i) * (i - j + 1));}}int res = 0;for (int i = 0; i <= k; i ++)res = max(res, f[n][i]);cout << a[n] - res << endl;for (int i = 0; i <= n; i ++)a[i] = 0;}signed main() {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);int dt;cin >> dt;while (dt --)solve();return 0;
}

D. Shop Game

Problem Statement

Alice and Bob are playing a game in the shop. There are n n n items in the shop; each item has two parameters: a i a_i ai (item price for Alice) and b i b_i bi (item price for Bob).

Alice wants to choose a subset (possibly empty) of items and buy them. After that, Bob does the following:

  • if Alice bought less than k k k items, Bob can take all of them for free;
  • otherwise, he will take k k k items for free that Alice bought (Bob chooses which k k k items it will be), and for the rest of the chosen items, Bob will buy them from Alice and pay b i b_i bi for the i i i-th item.

Alice’s profit is equal to ∑ i ∈ S b i − ∑ j ∈ T a j \sum\limits_{i \in S} b_i - \sum\limits_{j \in T} a_j iSbijTaj, where S S S is the set of items Bob buys from Alice, and T T T is the set of items Alice buys from the shop. In other words, Alice’s profit is the difference between the amount Bob pays her and the amount she spends buying the items.

Alice wants to maximize her profit, Bob wants to minimize Alice’s profit. Your task is to calculate Alice’s profit if both Alice and Bob act optimally.

Input

The first line contains a single integer t t t ( 1 ≤ t ≤ 1 0 4 1 \le t \le 10^4 1t104) — the number of test cases.

The first line of each test case contains two integers n n n and k k k ( 1 ≤ n ≤ 2 ⋅ 1 0 5 1 \le n \le 2 \cdot 10^5 1n2105; 0 ≤ k ≤ n 0 \le k \le n 0kn).

The second line contains n n n integers a 1 , a 2 , … , a n a_1, a_2, \dots, a_n a1,a2,,an ( 1 ≤ a i ≤ 1 0 9 1 \le a_i \le 10^9 1ai109).

The third line contains n n n integers b 1 , b 2 , … , b n b_1, b_2, \dots, b_n b1,b2,,bn ( 1 ≤ b i ≤ 1 0 9 1 \le b_i \le 10^9 1bi109).

Additional constraint on the input: the sum of n n n over all test cases doesn’t exceed 2 ⋅ 1 0 5 2 \cdot 10^5 2105.

Output

For each test case, print a single integer — Alice’s profit if both Alice and Bob act optimally.

Example

Example

input
4
2 0
2 1
1 2
4 1
1 2 1 4
3 3 2 3
4 2
2 1 1 1
4 2 3 2
6 2
1 3 4 9 1 3
7 6 8 10 6 8
output
1
1
0
7

Note

In the first test case, Alice should buy the 2 2 2-nd item and sell it to Bob, so her profit is 2 − 1 = 1 2 - 1 = 1 21=1.

In the second test case, Alice should buy the 1 1 1-st, the 2 2 2-nd and the 3 3 3-rd item; then Bob takes the 1 1 1-st item for free and pays for the 2 2 2-nd and the 3 3 3-rd item. Alice’s profit is ( 3 + 2 ) − ( 1 + 2 + 1 ) = 1 (3+2) - (1+2+1) = 1 (3+2)(1+2+1)=1. Bob could take 2 2 2-nd item for free instead; this does not change Alice’s profit. Bob won’t take the 3 3 3-rd item for free, since this would lead to a profit of 2 2 2.

Solution

具体见文后视频。

Code

#include <bits/stdc++.h>
#define fi first
#define se second
#define int long longusing namespace std;typedef pair<int, int> PII;
typedef long long LL;const int N = 2e5 + 10;int n, k;
PII item[N], cpy[N];void solve() {cin >> n >> k;for (int i = 1; i <= n; i ++)cin >> item[i].fi;for (int i = 1; i <= n; i ++)cin >> item[i].se, cpy[i] = item[i];if (!k) {int res = 0;for (int i = 1; i <= n; i ++)res += max(0ll, item[i].se - item[i].fi);cout << res << endl;return;}sort(item + 1, item + 1 + n, [&](PII a, PII b) {if (a.se == b.se) return a.fi > b.fi;return a.se < b.se;});int tot = 0, res = 0, sum = 0;for (int i = 1; i <= n; i ++)sum += max(0ll, item[i].se - item[i].fi);multiset<int> s;for (int i = n; i >= n - k + 1; i --) {s.insert(item[i].fi), tot += item[i].fi;sum -= max(0ll, item[i].se - item[i].fi);}for (int i = n - k; i >= 0; i --) {// cout << item[i].se << ":" << sum << " " << tot << "->" << sum - tot << endl;res = max(res, sum - tot);auto it = s.end();it --;if (*it > item[i].fi) {tot -= *it, s.erase(it), s.insert(item[i].fi), tot += item[i].fi;}sum -= max(0ll, item[i].se - item[i].fi);}cout << res << endl;
}signed main() {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);int dt;cin >> dt;while (dt --)solve();return 0;
}

E. Unique Array

Problem Statement

You are given an integer array a a a of length n n n. A subarray of a a a is one of its contiguous subsequences (i. e. an array [ a l , a l + 1 , … , a r ] [a_l, a_{l+1}, \dots, a_r] [al,al+1,,ar] for some integers l l l and r r r such that 1 ≤ l < r ≤ n 1 \le l < r \le n 1l<rn). Let’s call a subarray unique if there is an integer that occurs exactly once in the subarray.

You can perform the following operation any number of times (possibly zero): choose an element of the array and replace it with any integer.

Your task is to calculate the minimum number of aforementioned operation in order for all the subarrays of the array a a a to be unique.

Input

The first line contains a single integer t t t ( 1 ≤ t ≤ 1 0 4 1 \le t \le 10^4 1t104) — the number of test cases.

The first line of each test case contains a single integer n n n ( 1 ≤ n ≤ 3 ⋅ 1 0 5 1 \le n \le 3 \cdot 10^5 1n3105).

The second line contains n n n integers a 1 , a 2 , … , a n a_1, a_2, \dots, a_n a1,a2,,an ( 1 ≤ a i ≤ n 1 \le a_i \le n 1ain).

Additional constraint on the input: the sum of n n n over all test cases doesn’t exceed 3 ⋅ 1 0 5 3 \cdot 10^5 3105.

Output

For each test case, print a single integer — the minimum number of aforementioned operation in order for all the subarrays of the array a a a to be unique.

Example

input
4
3
2 1 2
4
4 4 4 4
5
3 1 2 1 2
5
1 3 2 1 2
output
0
2
1
0

Note

In the second test case, you can replace the 1 1 1-st and the 3 3 3-rd element, for example, like this: [ 3 , 4 , 1 , 4 ] [3, 4, 1, 4] [3,4,1,4].

In the third test case, you can replace the 4 4 4-th element, for example, like this: [ 3 , 1 , 2 , 3 , 2 ] [3, 1, 2, 3, 2] [3,1,2,3,2].

Solution

具体见文后视频。


Code

#include <bits/stdc++.h>
#define fi first
#define se secondusing namespace std;typedef pair<int, int> PII;
typedef long long LL;const int N = 3e5 + 10;int n;
int a[N], l[N], r[N], p[N];
struct Segment {int l, r;int mn, len, lazy;
}tr[N << 2];
int q[N], hh, tt, f[N];void pushup(int u) {tr[u].mn = min(tr[u << 1].mn, tr[u << 1 | 1].mn), tr[u].len = 0;if (tr[u << 1].mn == tr[u].mn) tr[u].len += tr[u << 1].len;if (tr[u << 1 | 1].mn == tr[u].mn) tr[u].len += tr[u << 1 | 1].len;
}void pushdown(int u) {if (tr[u].lazy) {tr[u << 1].mn += tr[u].lazy, tr[u << 1].lazy += tr[u].lazy;tr[u << 1 | 1].mn += tr[u].lazy, tr[u << 1 | 1].lazy += tr[u].lazy;tr[u].lazy = 0;}
}void build(int u, int l, int r) {tr[u] = {l, r}, tr[u].len = r - l + 1;if (l == r) return;int mid = l + r >> 1;build(u << 1, l, mid), build(u << 1 | 1, mid + 1, r);
}void modify(int u, int l, int r, int d) {if (tr[u].l >= l && tr[u].r <= r) {tr[u].mn += d, tr[u].lazy += d;return;}pushdown(u);int mid = tr[u].l + tr[u].r >> 1;if (mid >= l) modify(u << 1, l, r, d);if (mid < r) modify(u << 1 | 1, l, r, d);pushup(u);
}int query(int u, int l, int r) {if (tr[u].l >= l && tr[u].r <= r) {if (tr[u].mn > 0) return tr[u].r - tr[u].l + 1;return tr[u].r - tr[u].l + 1 - tr[u].len;}pushdown(u);int mid = tr[u].l + tr[u].r >> 1, res = 0;if (mid >= l) res += query(u << 1, l, r);if (mid < r) res += query(u << 1 | 1, l, r);return res;
}void solve() {cin >> n;for (int i = 1; i <= n; i ++) p[i] = 0;for (int i = 1; i <= n; i ++)cin >> a[i], l[i] = p[a[i]] + 1, p[a[i]] = i;for (int i = 1; i <= n; i ++) p[i] = n + 1;for (int i = n; i >= 1; i --)r[i] = p[a[i]] - 1, p[a[i]] = i;// (l[i], i) -> (i, r[i])std::vector<array<int, 4>> opr;for (int i = 1; i <= n; i ++) {opr.push_back({i, l[i], i, 1});opr.push_back({r[i] + 1, l[i], i, -1});}sort(opr.begin(), opr.end());build(1, 1, n);q[0] = 0, q[ ++ tt] = 1, hh = 0, tt = 0, f[1] = 1;int lim = 0;for (int i = 1, j = 0; i <= n; i ++) {while (j < opr.size() && opr[j][0] == i) {modify(1, opr[j][1], opr[j][2], opr[j][3]);j ++;}int l = 1, r = i;while (l < r) {int mid = l + r + 1 >> 1;if (query(1, mid, i) == i - mid + 1) r = mid - 1;else l = mid;}if (query(1, 1, i) == i) p[i] = 0;else p[i] = l;lim = max(lim, p[i]);while (hh <= tt && q[hh] < lim) hh ++;f[i + 1] = f[q[hh]] + 1;while (hh <= tt && f[q[tt]] > f[i + 1]) tt --;q[ ++ tt] = i + 1;}int res = 2e9;for (int i = lim; i <= n; i ++)res = min(res, f[i]);cout << res << endl;
}signed main() {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);int dt;cin >> dt;while (dt --)solve();return 0;
}

视频讲解

Educational Codeforces Round 165 (Rated for Div. 2)(A ~ E 题讲解)


最后祝大家早日在这里插入图片描述

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

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

相关文章

并发编程之线程池的设计和原理

一、线程池 提前创建一系列的线程&#xff0c;保存在这个线程池中&#xff0c;有任务要执行的时候&#xff0c;从线程池中取出线程来执行。没有任务的时候&#xff0c;线程池放回去。 二、为什么要使用线程池 线程使用上的问题: 线程的频繁创建 和 销毁 线程的数量过多&…

政安晨:【Keras机器学习示例演绎】(二十六)—— 图像相似性搜索的度量学习

目录 概述 设置 数据集 嵌入模型 测试 政安晨的个人主页&#xff1a;政安晨 欢迎 &#x1f44d;点赞✍评论⭐收藏 收录专栏: TensorFlow与Keras机器学习实战 希望政安晨的博客能够对您有所裨益&#xff0c;如有不足之处&#xff0c;欢迎在评论区提出指正&#xff01; 本文…

基于Pytorch深度学习——多层感知机

本文章来源于对李沐动手深度学习代码以及原理的理解&#xff0c;并且由于李沐老师的代码能力很强&#xff0c;以及视频中讲解代码的部分较少&#xff0c;所以这里将代码进行尽量逐行详细解释 并且由于pytorch的语法有些小伙伴可能并不熟悉&#xff0c;所以我们会采用逐行解释小…

Word域代码学习(简单使用)-【SEQ】

Word域代码学习(简单使用)-【SEQ】 快捷键 序号快捷键操作1 Ctrl F9 插入域代码花括号2 F9 显示域代码结果3 Shift F9 切换为域代码4 Windows Alt F9 切换全部域代码 域代码说明 域代码不区分大小写在word中&#xff0c;依次选择插入➡文档部件➡域即可选择插入…

Linux 学习 --- 编辑 vi 命令

1、vi 基本概念&#xff08;了解&#xff09; 基本上 vi 可以分为三种状态&#xff0c;分别是命令模式 (command mode)、插入模式 (Insert mode) 和底行模式 (last line mode)&#xff0c;各模式的功能区分如下: 命令行模式 command mode&#xff09;  控制屏幕光标的移动&a…

PotatoPie 4.0 实验教程(31) —— FPGA实现摄像头图像高斯滤波

什么是高斯滤波 高斯滤波是一种常见的图像处理技术&#xff0c;用于去除图像中的噪声和平滑图像。它的原理基于统计学中的高斯分布&#xff08;也称为正态分布&#xff09;。 在高斯滤波中&#xff0c;一个二维的高斯核函数被用来对图像中的每个像素进行加权平均。这个高斯核…

jvm 马士兵 01

01.JVM是什么 JVM是一个跨平台的标准 JVM只识别class文件&#xff0c;符合JVM规范的class文件都可以被识别

AI智能名片商城小程序:引领企业迈向第三增长极

随着数字化浪潮的席卷&#xff0c;私域流量的重要性逐渐凸显&#xff0c;为企业增长提供了全新的动力。在这一背景下&#xff0c;AI智能名片商城系统崭露头角&#xff0c;以其独特的优势&#xff0c;引领企业迈向第三增长极。 私域流量的兴起&#xff0c;为企业打开了一扇新的销…

【codeforces】Immobile Knight

Immobile Knight 我感觉自己不太适合写codeforces&#xff0c;简单题也比较考验思维&#xff0c;当时这题看了半天以为是搜索&#xff0c;写了20分钟暴力交了&#xff0c;还好对的&#xff0c;20个人19个人5分钟不到速通第一题&#xff0c;唯留我一人在第一题凌乱。下来看看这…

深度学习中的归一化:BN,LN,IN,GN的优缺点

目录 深度学习中归一化的作用常见归一化的优缺点 深度学习中归一化的作用 加速训练过程 归一化可以加速深度学习模型的训练过程。通过调整输入数据的尺度&#xff0c;归一化有助于改善优化算法的收敛速度。这是因为归一化后的数据具有相似的尺度&#xff0c;使得梯度下降等优化…

密码学基础练习五道 RSA、elgamal、elgamal数字签名、DSA数字签名、有限域(GF)上的四则运算

1.RSA #include <stdlib.h>#include <stdio.h>#include <string.h>#include <math.h>#include <time.h>#define PRIME_MAX 200 //生成素数范围#define EXPONENT_MAX 200 //生成指数e范围#define Element_Max 127 //加密单元的…

dockerfile 搭建lamp 实验模拟

一 实验目的 二 实验 环境 1, 实验环境 192.168.217.88一台机器安装docker 并做mysql nginx php 三台容器 2&#xff0c; 大致框架 3&#xff0c; php php:Nginx服务器不能处理动态页面&#xff0c;需要由 Nginx 把动态请求交给 php-fpm 进程进行解析 php有三…

LT6911UXB HDMI2.0 至四端口 MIPI DSI/CSI,带音频 龙迅方案

1. 描述LT6911UXB 是一款高性能 HDMI2.0 至 MIPI DSI/CSI 转换器&#xff0c;适用于 VR、智能手机和显示应用。HDMI2.0 输入支持高达 6Gbps 的数据速率&#xff0c;可为4k60Hz视频提供足够的带宽。此外&#xff0c;数据解密还支持 HDCP2.2。对于 MIPI DSI / CSI 输出&#xff0…

van-cascader(vant2)异步加载的bug

问题描述&#xff1a;由于一次性返回所有的级联数据的话&#xff0c;数据量太大&#xff0c;接口响应时间太久&#xff0c;因此采用了异步加载的方案&#xff0c;看了vant的官方示例代码&#xff0c;照着改了下&#xff0c;很轻松地实现了功能。正当我感叹世界如此美好的时候&a…

【C++ —— 多态】

C —— 多态 多态的概念多态的定义和实现多态的构成条件虚函数虚函数的重写虚函数重写的两个例外协变&#xff1a;析构函数的重写 C11 override和final重载、覆盖(重写)、隐藏(重定义)的对比 抽象类概念接口继承和实现继承 多态的继承虚函数表多态的原理动态绑定和静态绑定 单继…

数据库(MySQL)基础:多表查询(一)

一、多表关系 概述 项目开发中&#xff0c;在进行数据库表结构设计时&#xff0c;会根据业务需求及业务模块之间的关系&#xff0c;分析并设计表结构&#xff0c;由于业务之间相互关联&#xff0c;所以各个表结构之间也存在着各种联系&#xff0c;基本上分为三种&#xff1a;…

OceanBase开发者大会实录-陈文光:AI时代需要怎样的数据处理技术?

本文来自2024 OceanBase开发者大会&#xff0c;清华大学教授、蚂蚁技术研究院院长陈文光的演讲实录—《AI 时代的数据处理技术》。完整视频回看&#xff0c;请点击这里&#xff1e;> 大家好&#xff0c;我是清华大学、蚂蚁技术研究院陈文光&#xff0c;今天为大家带来《AI 时…

【C语言】atoi和atof函数的使用

人生应该树立目标&#xff0c;否则你的精力会白白浪费。&#x1f493;&#x1f493;&#x1f493; 目录 •&#x1f319;知识回顾 &#x1f34b;知识点一&#xff1a;atoi函数的使用和实现 • &#x1f330;1.函数介绍 • &#x1f330;2.代码演示 • &#x1f330;3.atoi函数的…

Flask框架进阶-Flask流式输出和受访配置--纯净详解版

Flask流式输出&#x1f680; 在工作的项目当中遇到了一种情况&#xff0c;当前端页面需要对某个展示信息进行批量更新&#xff0c;如果直接将全部的数据算完之后&#xff0c;再返回更新&#xff0c;则会导致&#xff0c;前端点击刷新之后等待时间过长&#xff0c;开始考虑到用进…

liceo靶机复现

liceo-hackmyvm 靶机地址&#xff1a;https://hackmyvm.eu/machines/machine.php?vmLiceo 本机环境&#xff1a;NAT模式下&#xff0c;使用VirtualBox 信息收集&#xff1a; 首先局域网内探测靶机IP 发现IP为10.0.2.4 开启nmap扫描一下看看开了什么端口 扫描期间看一下web页…