AtCoder Beginner Contest 359(ABCDEFG题)视频讲解

news2024/11/25 19:36:29

A - Count Takahashi

Problem Statement

You are given N N N strings.
The i i i-th string S i S_i Si ( 1 ≤ i ≤ N ) (1 \leq i \leq N) (1iN) is either Takahashi or Aoki.
How many i i i are there such that S i S_i Si is equal to Takahashi?

Constraints

1 ≤ N ≤ 100 1 \leq N \leq 100 1N100
N N N is an integer.
Each S i S_i Si is Takahashi or Aoki. ( 1 ≤ i ≤ N ) (1 \leq i \leq N) (1iN)

Input

The input is given from Standard Input in the following format:

N N N
S 1 S_1 S1
S 2 S_2 S2
⋮ \vdots
S N S_N SN

Output

Print the count of i i i such that S i S_i Si is equal to Takahashi as an integer in a single line.

Sample Input 1

3
Aoki
Takahashi
Takahashi

Sample Output 1

2

S 2 S_2 S2 and S 3 S_3 S3 are equal to Takahashi, while S 1 S_1 S1 is not.
Therefore, print 2.

Sample Input 2

2
Aoki
Aoki

Sample Output 2

0

It is possible that no S i S_i Si is equal to Takahashi.

Sample Input 3

20
Aoki
Takahashi
Takahashi
Aoki
Aoki
Aoki
Aoki
Takahashi
Aoki
Aoki
Aoki
Takahashi
Takahashi
Aoki
Takahashi
Aoki
Aoki
Aoki
Aoki
Takahashi

Sample Output 3

7

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;

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

	int n;
	cin >> n;

	int res = 0;
	for (int i = 1; i <= n; i ++) {
		string s;
		cin >> s;
		if (s == "Takahashi") res ++;
	}
	cout << res << endl;

	return 0;
}

B - Couples

Problem Statement

There are 2 N 2N 2N people standing in a row, and the person at the i i i-th position from the left is wearing clothes of color A i A_i Ai. Here, the clothes have N N N colors from 1 1 1 to N N N, and exactly two people are wearing clothes of each color.
Find how many of the integers i = 1 , 2 , … , N i=1,2,\ldots,N i=1,2,,N satisfy the following condition:
There is exactly one person between the two people wearing clothes of color i i i.

Constraints

2 ≤ N ≤ 100 2 \leq N \leq 100 2N100
1 ≤ A i ≤ N 1 \leq A_i \leq N 1AiN
Each integer from 1 1 1 through N N N appears exactly twice in A A A.
All input values are integers.

Input

The input is given from Standard Input in the following format:

N N N
A 1 A_1 A1 A 2 A_2 A2 … \ldots A 2 N A_{2N} A2N

Output

Print the answer.

Sample Input 1

3
1 2 1 3 2 3

Sample Output 1

2

There are two values of i i i that satisfy the condition: 1 1 1 and 3 3 3.
In fact, the people wearing clothes of color 1 1 1 are at the 1st and 3rd positions from the left, with exactly one person in between.

Sample Input 2

2
1 1 2 2

Sample Output 2

0

There may be no i i i that satisfies the condition.

Sample Input 3

4
4 3 2 3 2 1 4 1

Sample Output 3

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;

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

	int n;
	cin >> n;

	std::vector<int> a(2 * n);
	for (int i = 0; i < 2 * n; i ++)
		cin >> a[i];

	int res = 0;
	for (int i = 1; i < 2 * n - 1; i ++)
		if (a[i - 1] == a[i + 1])
			res ++;

	cout << res << endl;

	return 0;
}

C - Tile Distance 2

Problem Statement

The coordinate plane is covered with 2 × 1 2\times1 2×1 tiles. The tiles are laid out according to the following rules:
For an integer pair ( i , j ) (i,j) (i,j), the square A i , j = { ( x , y ) ∣ i ≤ x ≤ i + 1 ∧ j ≤ y ≤ j + 1 } A _ {i,j}=\lbrace(x,y)\mid i\leq x\leq i+1\wedge j\leq y\leq j+1\rbrace Ai,j={(x,y)ixi+1jyj+1} is contained in one tile.
When i + j i+j i+j is even, A i , j A _ {i,j} Ai,j and A i + 1 , j A _ {i + 1,j} Ai+1,j are contained in the same tile.
Tiles include their boundaries, and no two different tiles share a positive area.
Near the origin, the tiles are laid out as follows:

Takahashi starts at the point ( S x + 0.5 , S y + 0.5 ) (S _ x+0.5,S _ y+0.5) (Sx+0.5,Sy+0.5) on the coordinate plane.
He can repeat the following move as many times as he likes:
Choose a direction (up, down, left, or right) and a positive integer n n n. Move n n n units in that direction.
Each time he enters a tile, he pays a toll of 1 1 1.
Find the minimum toll he must pay to reach the point ( T x + 0.5 , T y + 0.5 ) (T _ x+0.5,T _ y+0.5) (Tx+0.5,Ty+0.5).

Constraints

0 ≤ S x ≤ 2 × 1 0 16 0\leq S _ x\leq2\times10 ^ {16} 0Sx2×1016
0 ≤ S y ≤ 2 × 1 0 16 0\leq S _ y\leq2\times10 ^ {16} 0Sy2×1016
0 ≤ T x ≤ 2 × 1 0 16 0\leq T _ x\leq2\times10 ^ {16} 0Tx2×1016
0 ≤ T y ≤ 2 × 1 0 16 0\leq T _ y\leq2\times10 ^ {16} 0Ty2×1016
All input values are integers.

Input

The input is given from Standard Input in the following format:

S x S _ x Sx S y S _ y Sy
T x T _ x Tx T y T _ y Ty

Output

Print the minimum toll Takahashi must pay.

Sample Input 1

5 0
2 5

Sample Output 1

5

For example, Takahashi can pay a toll of 5 5 5 by moving as follows:

Move left by 1 1 1. Pay a toll of 0 0 0.
Move up by 1 1 1. Pay a toll of 1 1 1.
Move left by 1 1 1. Pay a toll of 0 0 0.
Move up by 3 3 3. Pay a toll of 3 3 3.
Move left by 1 1 1. Pay a toll of 0 0 0.
Move up by 1 1 1. Pay a toll of 1 1 1.
It is impossible to reduce the toll to 4 4 4 or less, so print 5.

Sample Input 2

3 1
4 1

Sample Output 2

0

There are cases where no toll needs to be paid.

Sample Input 3

2552608206527595 5411232866732612
771856005518028 7206210729152763

Sample Output 3

1794977862420151

Note that the value to be output may exceed the range of a 32 32 32-bit integer.

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;

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

	int sx, sy, fx, fy;
	cin >> sx >> sy >> fx >> fy;

	int res = abs(sy - fy);
	if ((sx + sy & 1) && fx < sx || ((sx + sy) % 2 == 0) && fx > sx) {
		res += max(0ll, abs(sx - fx) - abs(sy - fy) >> 1);
	} else {
		res += max(0ll, abs(sx - fx) - abs(sy - fy) + 1 >> 1);
	}

	cout << res << endl;

	return 0;
}

D - Avoid K Palindrome

Problem Statement

You are given a string S S S of length N N N consisting of characters A, B, and ?.
You are also given a positive integer K K K.
A string T T T consisting of A and B is considered a good string if it satisfies the following condition:
No contiguous substring of length K K K in T T T is a palindrome.
Let q q q be the number of ? characters in S S S.
There are 2 q 2^q 2q strings that can be obtained by replacing each ? in S S S with either A or B. Find how many of these strings are good strings.
The count can be very large, so find it modulo 998244353 998244353 998244353.

Constraints

2 ≤ K ≤ N ≤ 1000 2 \leq K \leq N \leq 1000 2KN1000
K ≤ 10 K \leq 10 K10
S S S is a string consisting of A, B, and ?.
The length of S S S is N N N.
N N N and K K K are integers.

Input

The input is given from Standard Input in the following format:

N N N K K K
S S S

Output

Print the answer.

Sample Input 1

7 4
AB?A?BA

Sample Output 1

1

The given string has two ?s.
There are four strings obtained by replacing each ? with A or B:
ABAAABA
ABAABBA
ABBAABA
ABBABBA
Among these, the last three contain the contiguous substring ABBA of length 4, which is a palindrome, and thus are not good strings.
Therefore, you should print 1.

Sample Input 2

40 7
????????????????????????????????????????

Sample Output 2

116295436

Ensure to find the number of good strings modulo 998244353 998244353 998244353.

Sample Input 3

15 5
ABABA??????????

Sample Output 3

0

It is possible that there is no way to replace the ?s to obtain a good string.

Sample Input 4

40 8
?A?B??B?B?AA?A?B??B?A???B?BB?B???BA??BAA

Sample Output 4

259240

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 = 1e3 + 10, M = 11, mod = 998244353;

int n, k;
string s;
int f[N][1 << M];

bool check(int x) {
	string a, b;
	for (int i = 0; i < k; i ++)
		a += char((x >> i & 1) ^ 48);
	b = a;
	reverse(b.begin(), b.end());
	return a != b;
}

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

	cin >> n >> k >> s;
	s = ' ' + s;

	std::vector<int> avl;
	avl.push_back(0);
	for (int i = 1; i <= k; i ++) {
		std::vector<int> ok;
		while (avl.size()) {
			int tmp = avl.back();
			avl.pop_back();
			if (s[i] == '?') {
				ok.push_back(tmp), ok.push_back(tmp | (1ll << i - 1));
			} else if (s[i] == 'B') {
				ok.push_back(tmp | (1ll << i - 1));
			} else {
				ok.push_back(tmp);
			}
		}
		avl = ok;
	}
	for (auto v : avl)
		if (check(v))
			f[k][v] = 1;
	for (int i = k + 1; i <= n; i ++)
		for (int j = 0; j < 1ll << k; j ++)
			if (s[i] == '?') {
				if (check(j) && check(j >> 1)) f[i][j >> 1] = (f[i][j >> 1] + f[i - 1][j]) % mod;
				if (check(j) && check((j >> 1) | (1ll << k - 1))) f[i][(j >> 1) | (1ll << k - 1)] = (f[i][(j >> 1) | (1ll << k - 1)] + f[i - 1][j]) % mod;
			} else if (s[i] == 'B') {
				if (check(j) && check((j >> 1) | (1ll << k - 1))) f[i][(j >> 1) | (1ll << k - 1)] = (f[i][(j >> 1) | (1ll << k - 1)] + f[i - 1][j]) % mod;
			} else {
				if (check(j) && check(j >> 1)) f[i][j >> 1] = (f[i][j >> 1] + f[i - 1][j]) % mod;
			}

	int res = 0;
	for (int i = 0; i < 1ll << k; i ++)
		res = (res + f[n][i]) % mod;

	cout << res << endl;

	return 0;
}

E - Water Tank

Problem Statement

You are given a sequence of positive integers of length N N N: H = ( H 1 , H 2 , … , H N ) H=(H _ 1,H _ 2,\dotsc,H _ N) H=(H1,H2,,HN).
There is a sequence of non-negative integers of length N + 1 N+1 N+1: A = ( A 0 , A 1 , … , A N ) A=(A _ 0,A _ 1,\dotsc,A _ N) A=(A0,A1,,AN). Initially, A 0 = A 1 = ⋯ = A N = 0 A _ 0=A _ 1=\dotsb=A _ N=0 A0=A1==AN=0.
Perform the following operations repeatedly on A A A:

  1. Increase the value of $A _ 0$ by $1$. For $i=1,2,\ldots,N$ in this order, perform the following operation: If $A _ {i-1}\gt A _ i$ and $A _ {i-1}\gt H _ i$, decrease the value of $A _ {i-1}$ by 1 and increase the value of $A _ i$ by $1$.
For each $i=1,2,\ldots,N$, find the number of operations before $A _ i>0$ holds for the first time. ## Constraints

1 ≤ N ≤ 2 × 1 0 5 1\leq N\leq2\times10 ^ 5 1N2×105
1 ≤ H i ≤ 1 0 9   ( 1 ≤ i ≤ N ) 1\leq H _ i\leq10 ^ 9\ (1\leq i\leq N) 1Hi109 (1iN)
All input values are integers.

Input

The input is given from Standard Input in the following format:

N N N
H 1 H _ 1 H1 H 2 H _ 2 H2 … \dotsc H N H _ N HN

Output

Print the answers for i = 1 , 2 , … , N i=1,2,\ldots,N i=1,2,,N in a single line, separated by spaces.

Sample Input 1

5
3 1 4 1 5

Sample Output 1

4 5 13 14 26

The first five operations go as follows.
Here, each row corresponds to one operation, with the leftmost column representing step 1 and the others representing step 2.

From this diagram, A 1 > 0 A _ 1\gt0 A1>0 holds for the first time after the 4th operation, and A 2 > 0 A _ 2\gt0 A2>0 holds for the first time after the 5th operation.
Similarly, the answers for A 3 , A 4 , A 5 A _ 3, A _ 4, A _ 5 A3,A4,A5 are 13 , 14 , 26 13, 14, 26 13,14,26, respectively.
Therefore, you should print 4 5 13 14 26.

Sample Input 2

6
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000

Sample Output 2

1000000001 2000000001 3000000001 4000000001 5000000001 6000000001

Note that the values to be output may not fit within a 32 32 32-bit integer.

Sample Input 3

15
748 169 586 329 972 529 432 519 408 587 138 249 656 114 632

Sample Output 3

749 918 1921 2250 4861 5390 5822 6428 6836 7796 7934 8294 10109 10223 11373

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;
int a[N], to[N], f[N];

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

	cin >> n;

	stack<int> stk;
	for (int i = 1; i <= n; i ++) {
		cin >> a[i];
		while (stk.size() && a[stk.top()] < a[i]) stk.pop();
		if (stk.size()) to[i] = stk.top();
		stk.push(i);
	}

	for (int i = 1; i <= n; i ++)
		f[i] = f[to[i]] + (i - to[i]) * a[i], cout << f[i] + 1 << " ";

	return 0;
}

F - Tree Degree Optimization

Problem Statement

You are given a sequence of integers A = ( A 1 , … , A N ) A=(A_1,\ldots,A_N) A=(A1,,AN). For a tree T T T with N N N vertices, define f ( T ) f(T) f(T) as follows:
Let d i d_i di be the degree of vertex i i i in T T T. Then, f ( T ) = ∑ i = 1 N d i 2 A i f(T)=\sum_{i=1}^N {d_i}^2 A_i f(T)=i=1Ndi2Ai.
Find the minimum possible value of f ( T ) f(T) f(T).
The constraints guarantee the answer to be less than 2 63 2^{63} 263.

Constraints

2 ≤ N ≤ 2 × 1 0 5 2\leq N\leq 2\times 10^5 2N2×105
1 ≤ A i ≤ 1 0 9 1\leq A_i \leq 10^9 1Ai109
All input values are integers.

Input

The input is given from Standard Input in the following format:

N N N
A 1 A_1 A1 A 2 A_2 A2 … \ldots A N A_N AN

Output

Print the answer.

Sample Input 1

4
3 2 5 2

Sample Output 1

24

Consider a tree T T T with an edge connecting vertices 1 1 1 and 2 2 2, an edge connecting vertices 2 2 2 and 4 4 4, and an edge connecting vertices 4 4 4 and 3 3 3.
Then, f ( T ) = 1 2 × 3 + 2 2 × 2 + 1 2 × 5 + 2 2 × 2 = 24 f(T) = 1^2\times 3 + 2^2\times 2 + 1^2\times 5 + 2^2\times 2 = 24 f(T)=12×3+22×2+12×5+22×2=24. It can be proven that this is the minimum value of f ( T ) f(T) f(T).

Sample Input 2

3
4 3 2

Sample Output 2

15

Sample Input 3

7
10 5 10 2 10 13 15

Sample Output 3

128

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;
int a[N], d[N];

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

	cin >> n;
	for (int i = 1; i <= n; i ++)
		cin >> a[i];
	priority_queue<PII, vector<PII>, greater<PII>> heap;
	for (int i = 1; i <= n; i ++)
		d[i] = 1, heap.push({a[i] * (2 * d[i] + 1), i});

	for (int i = 1; i <= n - 2; i ++) {
		auto tmp = heap.top(); heap.pop();
		d[tmp.se] ++, heap.push({a[tmp.se] * (2 * d[tmp.se] + 1), tmp.se});
	}
	int res = 0;
	for (int i = 1; i <= n; i ++) res += d[i] * d[i] * a[i];

	cout << res << endl;

	return 0;
}

G - Sum of Tree Distance

Problem Statement

You are given a tree with N N N vertices. The i i i-th edge connects vertices u i u_i ui and v i v_i vi bidirectionally.
Additionally, you are given an integer sequence A = ( A 1 , … , A N ) A=(A_1,\ldots,A_N) A=(A1,,AN).
Here, define f ( i , j ) f(i,j) f(i,j) as follows:
If A i = A j A_i = A_j Ai=Aj, then f ( i , j ) f(i,j) f(i,j) is the minimum number of edges you need to traverse to move from vertex i i i to vertex j j j. If A i ≠ A j A_i \neq A_j Ai=Aj, then f ( i , j ) = 0 f(i,j) = 0 f(i,j)=0.
Calculate the value of the following expression:

$\displaystyle \sum_{i=1}^{N-1}\sum_{j=i+1}^N f(i,j)$.
## Constraints

2 ≤ N ≤ 2 × 1 0 5 2 \leq N \leq 2 \times 10^5 2N2×105
1 ≤ u i , v i ≤ N 1 \leq u_i, v_i \leq N 1ui,viN
1 ≤ A i ≤ N 1 \leq A_i \leq N 1AiN
The input graph is a tree.
All input values are integers.

Input

The input is given from Standard Input in the following format:

N N N
u 1 u_1 u1 v 1 v_1 v1
⋮ \vdots
u N − 1 u_{N-1} uN1 v N − 1 v_{N-1} vN1
A 1 A_1 A1 A 2 A_2 A2 … \ldots A N A_N AN

Output

Print the answer.

Sample Input 1

4
3 4
4 2
1 2
2 1 1 2

Sample Output 1

4

f ( 1 , 4 ) = 2 , f ( 2 , 3 ) = 2 f(1,4)=2, f(2,3)=2 f(1,4)=2,f(2,3)=2. For all other KaTeX parse error: Expected 'EOF', got '&' at position 17: …, j\ (1 \leq i &̲lt; j \leq N), we have f ( i , j ) = 0 f(i,j)=0 f(i,j)=0, so the answer is 2 + 2 = 4 2+2=4 2+2=4.

Sample Input 2

8
8 6
3 8
1 4
7 8
4 5
3 4
8 2
1 2 2 2 3 1 1 3

Sample Output 2

19

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, B = 448;

int n;
int a[N], dep[N], idx[N], tot[N], cnt[N], acl[N][B + 10], id[N];
int f[N << 1][20], Euler[N << 1], pl[N], m, sub;
std::vector<int> g[N], pos[N], big;

void dfs(int u, int fa) {
	Euler[ ++ m] = u, pl[u] = m;
	for (auto v : g[u]) {
		if (v == fa) continue;
		dep[v] = dep[u] + 1;
		dfs(v, u), Euler[ ++ m] = u;
	}
}
void dfs2(int u, int fa) {
	if (id[a[u]]) acl[u][id[a[u]]] ++;
	for (auto v : g[u]) {
		if (v == fa) continue;
		dfs2(v, u);
		for (auto i : big) acl[u][i] += acl[v][i];
	}
	for (auto i : big) {
		int sum = 0, res = 0;
		for (auto v : g[u]) {
			if (v == fa) continue;
			res += acl[v][i] * sum, sum += acl[v][i];
		}
		sub += res * dep[u] * 2;
	}
	if (id[a[u]]) sub += (acl[u][id[a[u]]] - 1) * dep[u] * 2;
}
void build() {
	for (int j = 0; j <= log2(m); j ++)
		for (int i = 1; i + (1ll << j) - 1 <= m; i ++)
			if (!j) f[i][j] = i;
			else {
				if (dep[Euler[f[i][j - 1]]] < dep[Euler[f[i + (1ll << j - 1)][j - 1]]]) f[i][j] = f[i][j - 1];
				else f[i][j] = f[i + (1ll << j - 1)][j - 1];
			}
}
int query(int l, int r) {
	int k = log2(r - l + 1);
	if (dep[Euler[f[l][k]]] < dep[Euler[f[r - (1ll << k) + 1][k]]]) return f[l][k];
	return f[r - (1ll << k) + 1][k];
}
int lca(int a, int b) {
	if (pl[a] > pl[b]) swap(a, b);
	return Euler[query(pl[a], pl[b])];
}

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

	cin >> n;
	for (int i = 1; i < n; i ++) {
		int u, v;
		cin >> u >> v;
		g[u].push_back(v), g[v].push_back(u);
	}
	for (int i = 1; i <= n; i ++)
		cin >> a[i], pos[a[i]].push_back(i);
	dfs(1, -1), build();

	int res1 = 0, res2 = 0, tmp = 0;
	for (int i = 1; i <= n; i ++) {
		if (pos[a[i]].size() <= B) {
			for (int j = 0; j < idx[a[i]]; j ++)
				res2 += dep[lca(i, pos[a[i]][j])] * 2;
			idx[a[i]] ++;
		} else if (!id[a[i]]) id[a[i]] = ++ tmp, big.push_back(tmp);
		res1 += tot[a[i]] + cnt[a[i]] * dep[i];
		tot[a[i]] += dep[i], cnt[a[i]] ++;
	}
	dfs2(1, -1);
	cout << res1 - res2 - sub << endl;

	return 0;
}

视频题解

AtCoder Beginner Contest 359(A ~ G 题讲解)


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

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

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

相关文章

idea2022激活

下载激活脚本 解压后&#xff0c;打开文件夹如下&#xff1a;ja-netfilter.jar 为激活补丁&#xff1a; 复制补丁所在的整个文件夹到硬盘某个位置 将 ja-netfilter补丁所在的整个文件夹移动到电脑上某个位置&#xff0c;我是放到了 D 盘下&#xff1a; &#xff08;路径中不…

Nginx负载均衡之Memcached缓存模块

Nginx 的 ngx_http_memcached_module 模块本身并没有提供缓存功能&#xff0c;它只是一个将用户请求转发到 Memcached 服务器的代理模块。 在以 Memcached 服务器为缓存应用的方案中&#xff0c;Memcached 作为内容缓存的存储服务器&#xff0c;用户通过 URL 为 Memcac…

Android面试题精选——再聊Android-Handler机制

​ static final ThreadLocal sThreadLocal new ThreadLocal(); //创建当前线程的Looper对象 private static void prepare(boolean quitAllowed) { if (sThreadLocal.get() ! null) { throw new RuntimeException(“Only one Looper may be created per thread”); } sThre…

【课程总结】Day10:卷积网络的基本组件

前言 由于接下来的课程内容将围绕计算机视觉展开&#xff0c;其中接触最多的内容是卷积、卷积神经网络等…因此&#xff0c;本篇内容将从卷积入手&#xff0c;梳理理解&#xff1a;卷积的意义、卷积在图像处理中的作用以及卷积神经网络的概念&#xff0c;最后利用pytorch搭建一…

详解互联网基石之HTTPS

一、HTTPS简介 HTTPS&#xff08;HyperText Transfer Protocol Secure&#xff09;是一种用于安全通信的网络传输协议。它是HTTP的加密版本&#xff0c;通过使用TLS&#xff08;Transport Layer Security&#xff09;或其前身SSL&#xff08;Secure Sockets Layer&#xff09;来…

Leetcode3185. 构成整天的下标对数目 II

Every day a Leetcode 题目来源&#xff1a;3185. 构成整天的下标对数目 II 解法1&#xff1a;哈希 本质思路类同经典的“两数之和”。枚举右&#xff0c;用哈希表维护左。 枚举 j&#xff0c;并维护 cnt[x] 表示所有满足 i < j 的下标 i 中&#xff0c;有几个 hours[i]…

服务器硬件的基础知识

引言 服务器是现代数据中心和企业IT基础设施的核心组成部分。了解服务器硬件的基本知识不仅有助于选择和维护服务器&#xff0c;还能提高系统性能和可靠性。本文将详细介绍服务器硬件的各个方面&#xff0c;包括处理器、内存、存储、网络、散热和电源等&#xff0c;帮助读者全…

数据库系统概论、数据管理的三种方式

一、数据库系统概论 数据库系统管理数据的的方式是用数据库来组织和存储数据&#xff0c;利用数据库管理系统&#xff0c;在操作系统的支持下&#xff0c;统一管理和控制存储在磁盘上的数据库&#xff0c;各类用户通过不同的方式&#xff0c;借助于数据库管理系统&#xff08;…

Android简单登录界面布局设计

<ImageView android:id“id/yxlg” android:layout_marginTop“12dp” android:layout_marginLeft“80dp” android:layout_width“30dp” android:layout_height“30dp” android:background“drawable/net” /> <TextView android:paddingTop“5dp” andr…

【面试干货】HashSet 和 TreeSet 的区别

【面试干货】HashSet 和 TreeSet 的区别 1、实现方式HashSetTreeSet 2、性能添加、删除和查找操作的时间复杂度HashSetTreeSet 3、元素唯一性4、迭代顺序HashSetTreeSet 5、使用场景HashSetTreeSet 6、示例代码 &#x1f496;The Begin&#x1f496;点点关注&#xff0c;收藏不…

fastapi+vue3+primeflex前后端分离开发项目第一个程序

安装axios axios是用来请求后端接口的。 https://www.axios-http.cn/docs/intro pnpm 是一个前端的包管理工具&#xff0c;当我们需要给前端项目添加新的依赖的时候&#xff0c;就可以使用pnpm install 命令进行安装。 pnpm install axios安装 primeflex primeflex是一个cs…

MySQL之复制(十二)

复制 复制的问题和解决方案 未定义的服务器ID 如果没有在my.cnf里面定义服务器ID,可以通过CHANGE MASTER TO 来设置备库&#xff0c;但却无法启动复制。 mysql>START SLAVE; ERROR 1200(HY000):The server is not configured as slave;fix in config file or with CHANG…

【shell脚本速成】mysql备份脚本

文章目录 案例需求脚本应用场景&#xff1a;解决问题脚本思路实现代码 &#x1f308;你好呀&#xff01;我是 山顶风景独好 &#x1f388;欢迎踏入我的博客世界&#xff0c;能与您在此邂逅&#xff0c;真是缘分使然&#xff01;&#x1f60a; &#x1f338;愿您在此停留的每一刻…

ubuntu链接mysql

C链接mysql 报错 sudo apt-get update sudo apt-get install libmysqlclient-dev 指令编译 g -o mysql_example mysql_example.cpp -I/usr/include/mysql -lmysqlclient g mysql_test.cpp mysql_config --cflags --libs 安装mysql sudo apt updatesudo apt install mysql-…

2024各省自考报名时间汇总❗所需材料❗

天津&#xff1a;5月27日-5月31日&#xff08;已结束&#xff09; 河北&#xff1a;6月10日~6月15日&#xff08;已结束&#xff09; 贵州&#xff1a;6月17日~26日 山东&#xff1a;6月18日~6月24日 江西&#xff1a;6月26日-7月7日&#xff08;6月下旬&#xff09; 浙江&…

pytest测试框架pytest-xdist插件并发执行测试用例

Pytest提供了丰富的插件来扩展其功能&#xff0c;本章介绍下插件pytest-xdist&#xff0c;主要是提供并行测试、分布式测试、循环测试等功能&#xff0c;可以加快测试速度。 pytest-xdist官方显示没有严格的python和pytest版本限制。 pytest-xdist安装 使用pip命令安装: pip…

如何解决代码中if…else-过多的问题,建议收藏

逻辑表达模式固定的 if…else 实现与示例 if (param.equals(value1)) { doAction1(someParams); } else if (param.equals(value2)) { doAction2(someParams); } else if (param.equals(value3)) { doAction3(someParams); } // … 可重构为 Map<?, Function<?>…

电脑有哪些重复文件删除工具?分享四个一键去重软件!

重复文件删除工具有哪些&#xff0c;哪个重复文件删除工具好用&#xff1f;日常工作生活中&#xff0c;如果需要对重复文件进行查找和删除&#xff0c;我们可以借助专业的金舟重复删除工具、czkawka、Wise Duplicate Finder和DiskBoss四种方法解决&#xff0c;具体操作如下&…

2024年6月大众点评成都餐饮店铺POI分析22万家

2024年6月大众点评成都餐饮店铺POI共有221002家 店铺POI点位示例&#xff1a; 店铺id CACuqlcUQApLA7Ki 店铺名称 峨眉山豆腐脑(百吉街店) 十分制服务评分 7.3 十分制环境评分 7.5 十分制划算评分 7.1 人均价格 18 评价数量 38 店铺地址 百吉街86号1层 大类 美食 中类…

MySOL数据库基础

一、数据库简介 1.数据库的特点 存储大量信息&#xff0c;方便检索和访问。保持数据的完整性&#xff0c;一致性&#xff0c;降低数据冗余。应用共享和安全。 2.数据库的基本概念 数据&#xff1a;描述事物的符号记录&#xff0c;包括数字&#xff0c;文字&#xff0c;图形…