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 long

using 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 long

using 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 long

using 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 long

using 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 second

using 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 题讲解)


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

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

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

相关文章

通义灵码实战系列:一个新项目如何快速启动,如何维护遗留系统代码库?

作者&#xff1a;别象 进入 2024 年&#xff0c;AI 热度持续上升&#xff0c;翻阅科技区的文章&#xff0c;AI 可谓是军书十二卷&#xff0c;卷卷有爷名。而麦肯锡最近的研究报告显示&#xff0c;软件工程是 AI 影响最大的领域之一&#xff0c;AI 已经成为了软件工程的必选项&…

FLUKE万用表17B+的电压档最大内阻

项目中遇到一个测量兆欧级别电阻两端电压的问题&#xff0c;发现按照上图中的电路搭建出来的电路测得的电压为8.25V左右&#xff0c;按理说应为9V才对&#xff0c;后来想到万用表测量电压档不同的档位会有不同内阻&#xff0c;测量的电阻应远小于万用表电压档内阻才有效。本次测…

顶尖页面性能优化跃升之道:uniapp首屏加载性能极致优化策略权威指南(白屏现象终结攻略)

页面加载性能优化至关重要&#xff0c;直接影响用户体验满意度及网站流量转化。优化加载性能可以减少用户等待时间&#xff0c;提升交互响应&#xff0c;有效减少出现白屏的情况&#xff0c;增加用户留存&#xff0c;同时有利于搜索引擎排名&#xff0c;对网站流量、品牌形象及…

【常规】解决win11的Edge浏览器掉线问题

文章目录 【问题】【解决】step1 右键点击wifi--【网络和Internet设置】step2 点击打开后&#xff0c;打开【高级网络设置】后边的箭头step3 进入下一级以后&#xff0c;点击【WLAN】右侧的箭头step4 【更多适配选项】--【编辑】step5 取消Internet协议版本6&#xff08;TCP/IP…

php反序列化字符串逃逸

字符串逃逸 字符串逃逸是通过改变序列化字符串的长度造成的php反序列化漏洞 一般是因为替换函数使得字符串长度发生变化&#xff0c;不论变长还是变短&#xff0c;原理都大致相同 在学习之前&#xff0c;要先了解序列化字符串的结构&#xff0c;在了解结构的基础上才能更好理解…

Qt Creator导入第三方so库和jar包——Qt For Android

前言 之前了解了在Android Studio下导入so库和jar包&#xff0c;现在实现如何在Qt上导入so库和jar包。 实现 下面是我安卓开发&#xff08;需调用安卓接口的代码&#xff09;的目录&#xff08;图1&#xff09;&#xff0c;此目录结构和原生态环境&#xff08;Android Studi…

PS证件照

证件照尺寸 小一寸&#xff1a;2.2cm*3.3cm 一寸&#xff1a;2.5cm*3.5cm 像素413*295 &#xff08;分辨率为300像素/英寸&#xff09; 比例5&#xff1a;7 二寸&#xff1a;3.5cm*4.9cm 二寸照相比例是4&#xff1a;3&#xff0c;像素是626*413 蓝底&#xff1a;R&a…

python学习之词云图片生成

代码实现 import jieba import wordcloudf open("D:/Pythonstudy/data/平凡的世界.txt", "r", encoding"utf-8") t f.read() print(t) f.close() ls jieba.lcut(t) txt " ".join(ls)w wordcloud.WordCloud(font_path"D:/cc…

【Unity动画系统】详解Root Motion动画在Unity中的应用(二)

Root Motion遇到Blend Tree 如果Root Motion动画片段的速度是1.8&#xff0c;那么阈值就要设置为1.8&#xff0c;那么在代码中的参数就可以直接反映出Root Motion的最终移动速度。 Compute Thresholds&#xff1a;根据Root Motion中某些数值自动计算这里的阈值。 Velocity X/…

使用 Python 和 OpenCV 进行实时目标检测的详解

使用到的模型文件我已经上传了&#xff0c;但是不知道能否通过审核&#xff0c;无法通过审核的话&#xff0c;就只能 靠大家自己发挥实力了&#xff0c;^_^ 目录 简介 代码介绍 代码拆解讲解 1.首先&#xff0c;让我们导入需要用到的库&#xff1a; 2.然后&#xff0c;设…

《QT实用小工具·四十三》历史编辑器(支持历史搜索 关键字匹配)

1、概述 源码放在文章末尾 该项目实现了在输入框中输入部分信息能全部展现之前的历史输入信息&#xff0c;支持历史搜索和关键词匹配&#xff0c;项目demo演示如下所示&#xff1a; 项目部分代码如下所示&#xff1a; #include "historymodel.h" #include <QM…

Java发送请求-http+https的

第一步&#xff1a;建议ssl连接对象&#xff0c;信任所有证书 第二步&#xff1a;代码同时支持httphttps 引入源码类 是一个注册器 引入这个类&#xff0c;和它的方法create 注册器&#xff0c;所以对http和https都进行注册&#xff0c;参数为id和item&#xff0c;其中http的…

【已解决】pandas读excel中长数字变成科学计数法的问题

pandas 读excel中的长数字时&#xff0c;即使excel中已经设置为文本&#xff0c;读进df后也会自动变成科学计数法。 在日常的数据分析和处理工作中&#xff0c;Excel和pandas是数据分析师们不可或缺的得力助手。然而&#xff0c;在使用pandas读取Excel文件时&#xff0c;我们有…

CSAPP | Floating Point

CSAPP | Floating Point b i b_i bi​ b i − 1 b_{i-1} bi−1​ … b 2 b_2 b2​ b 1 b_1 b1​ b 0 b_0 b0​ b − 1 b_{-1} b−1​ b − 2 b_{-2} b−2​ b − 3 b_{-3} b−3​ … b − j b_{-j} b−j​ S ∑ k − j i b k 2 k S\sum_{k-j}^{i}b_k\times2^k S∑k…

如何批量复制多个文件到多个目录中(批量复制文件,多对多文件高效操作的方法)

首先&#xff0c;需要用到的这个工具&#xff1a; 度娘网盘 提取码&#xff1a;qwu2 蓝奏云 提取码&#xff1a;2r1z 现在开始说具体操作 1、首先&#xff0c;我准备了3个文件夹和两个可爱的图片&#xff1a; 当然&#xff0c;在实际使用的时候肯定不止这些&#xff0c;我这…

升级 Vite 5 出现警告 The CJS build of Vite‘s Node API is deprecated

错误描述 vue3-element-admin 项目将Vite4 升级至 Vite5 后,项目运行出现如下警告: The CJS build of Vites Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.图片 问题原因 Vite 官方弃用 C…

怎么用微信小程序实现远程控制台球室

怎么用微信小程序实现远程控制台球室呢&#xff1f; 本文描述了使用微信小程序调用HTTP接口&#xff0c;实现控制台球室&#xff0c;控制球台上方的照明灯&#xff0c;单台设备可控制多张球台的照明灯。 可选用产品&#xff1a;可根据实际场景需求&#xff0c;选择对应的规格 …

【源码解析】深入Pandas的心脏DataFrame 含十大功能、源码实现与编程知识点

作者介绍&#xff1a;10年大厂数据\经营分析经验&#xff0c;现任大厂数据部门负责人。 会一些的技术&#xff1a;数据分析、算法、SQL、大数据相关、python 欢迎加入社区&#xff1a;码上找工作 作者专栏每日更新&#xff1a; LeetCode解锁1000题: 打怪升级之旅 python数据分析…

Arcpy开发记录

一.GDB数据库相关 1.单独的shape更新时&#xff0c;不会有限制&#xff0c;数据会自动截取 2.在GDB下&#xff0c;使用UpdateCursor更新字段时&#xff0c;填入的数据长度必须与字段长度要求一致&#xff0c;否则报错&#xff1a; 二.arcpy.da.UpdateCursor相关 updateRow后关…

【无线通信开发应用】nRF905数据手册深度解读

希望通过两个stm32、两个nRF905无线通信模块、串口来实现两机通信。具体功能为&#xff1a; 板子A、B分别包含一个stm32单片机和一个nRF905无线模块&#xff0c;欲实现板子A、B之间的通信。 其中&#xff0c;PC端串口助手可向板子A的stm32发送字符‘A’控制板子B上的LED亮灯&am…