AtCoder Beginner Contest 367(ABCDEF题)视频讲解

news2024/11/17 1:31:15

A - Shout Everyday

Problem Statement

In the Kingdom of AtCoder, residents are required to shout their love for takoyaki at A A A o’clock every day.
Takahashi, who lives in the Kingdom of AtCoder, goes to bed at B B B o’clock and wakes up at C C C o’clock every day (in the 24 24 24-hour clock). He can shout his love for takoyaki when he is awake, but cannot when he is asleep. Determine whether he can shout his love for takoyaki every day. Here, a day has 24 24 24 hours, and his sleeping time is less than 24 24 24 hours.

Constraints

0 ≤ A , B , C < 24 0\leq A,B,C\lt 24 0A,B,C<24
A A A, B B B, and C C C are pairwise different.
All input values are integers.

Input

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

A A A B B B C C C

Output

Print Yes if Takahashi can shout his love for takoyaki every day, and No otherwise.

Sample Input 1

21 8 14

Sample Output 1

Yes

Takahashi goes to bed at 8 8 8 o’clock and wakes up at 14 14 14 o’clock every day. He is awake at 21 21 21 o’clock, so he can shout his love for takoyaki every day. Therefore, print Yes.

Sample Input 2

0 21 7

Sample Output 2

No

Takahashi goes to bed at 21 21 21 o’clock and wakes up at 7 7 7 o’clock every day. He is not awake at 0 0 0 o’clock, so he cannot shout his love for takoyaki every day. Therefore, print No.

Sample Input 3

10 7 17

Sample Output 3

No

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 a, b, c;
	cin >> a >> b >> c;

	if (b > c) {
		if (a >= b && a < 24 || a <= c) cout << "No" << endl;
		else cout << "Yes" << endl;
	} else {
		if (a >= b && a <= c) cout << "No" << endl;
		else cout << "Yes" << endl;
	}

	return 0;
}

B - Cut .0

Problem Statement

A real number X X X is given to the third decimal place.
Print the real number X X X under the following conditions.
The decimal part must not have trailing 0s.
There must not be an unnecessary trailing decimal point.

Constraints

KaTeX parse error: Expected 'EOF', got '&' at position 9: 0 \le X &̲lt; 100
X X X is given to the third decimal place.

Input

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

X X X

Output

Output the answer.

Sample Input 1

1.012

Sample Output 1

1.012

1.012 can be printed as it is.

Sample Input 2

12.340

Sample Output 2

12.34

Printing 12.340 without the trailing 0 results in 12.34.

Sample Input 3

99.900

Sample Output 3

99.9

Printing 99.900 without the trailing 0s results in 99.9.

Sample Input 4

0.000

Sample Output 4

0

Printing 0.000 without trailing 0s or an unnecessary decimal point results in 0.

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);

	string s;
	cin >> s;

	while (s.size() && s.back() == '0') s.pop_back();
	if (s.back() == '.') s.pop_back();

	cout << s << endl;

	return 0;
}

C - Enumerate Sequences

Problem Statement

Print all integer sequences of length N N N that satisfy the following conditions, in ascending lexicographical order.
The i i i-th element is between 1 1 1 and R i R_i Ri, inclusive.
The sum of all elements is a multiple of K K K.

What is lexicographical order for sequences? A sequence $A = (A_1, \ldots, A_{|A|})$ is lexicographically smaller than $B = (B_1, \ldots, B_{|B|})$ if either 1. or 2. below holds:
  1. $|A|<|B|$ and $(A_{1},\ldots,A_{|A|}) = (B_1,\ldots,B_{|A|})$. There exists an integer $1\leq i\leq \min\{|A|,|B|\}$ such that both of the following are true: $(A_{1},\ldots,A_{i-1}) = (B_1,\ldots,B_{i-1})$ $A_i < B_i$
## Constraints

All input values are integers.
1 ≤ N ≤ 8 1 \le N \le 8 1N8
2 ≤ K ≤ 10 2 \le K \le 10 2K10
1 ≤ R i ≤ 5 1 \le R_i \le 5 1Ri5

Input

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

N N N K K K
R 1 R_1 R1 R 2 R_2 R2 … \dots R N R_N RN

Output

Print the answer in the following format, where X X X is the number of sequences to print, the i i i-th of which is A i = ( A i , 1 , A i , 2 , … , A i , N ) A_i=(A_{i,1},A_{i,2},\dots,A_{i,N}) Ai=(Ai,1,Ai,2,,Ai,N):

A 1 , 1 A_{1,1} A1,1 A 1 , 2 A_{1,2} A1,2 … \dots A 1 , N A_{1,N} A1,N
A 2 , 1 A_{2,1} A2,1 A 2 , 2 A_{2,2} A2,2 … \dots A 2 , N A_{2,N} A2,N
⋮ \vdots
A X , 1 A_{X,1} AX,1 A X , 2 A_{X,2} AX,2 … \dots A X , N A_{X,N} AX,N

Sample Input 1

3 2
2 1 3

Sample Output 1

1 1 2
2 1 1
2 1 3

There are three sequences to be printed, which are ( 1 , 1 , 2 ) , ( 2 , 1 , 1 ) , ( 2 , 1 , 3 ) (1,1,2),(2,1,1),(2,1,3) (1,1,2),(2,1,1),(2,1,3) in lexicographical order.

Sample Input 2

1 2
1

Sample Output 2

There may be no sequences to print.

In this case, the output can be empty.

Sample Input 3

5 5
2 3 2 3 2

Sample Output 3

1 1 1 1 1
1 2 2 3 2
1 3 1 3 2
1 3 2 2 2
1 3 2 3 1
2 1 2 3 2
2 2 1 3 2
2 2 2 2 2
2 2 2 3 1
2 3 1 2 2
2 3 1 3 1
2 3 2 1 2
2 3 2 2 1

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;

int n, k;
int r[10], a[10];

void dfs(int u) {
	if (u > n) {
		int tot = 0;
		for (int i = 1; i <= n; i ++)
			tot += a[i];
		if (tot % k == 0) {
			for (int i = 1; i <= n; i ++) cout << a[i] << " ";
			cout << endl;
		}
		return;
	}
	for (int i = 1; i <= r[u]; i ++)
		a[u] = i, dfs(u + 1);
}

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

	cin >> n >> k;
	for (int i = 1; i <= n; i ++)
		cin >> r[i];

	dfs(1);

	return 0;
}

D - Pedometer

Problem Statement

There are N N N rest areas around a lake.

The rest areas are numbered 1 1 1, 2 2 2, …, N N N in clockwise order.

It takes A i A_i Ai steps to walk clockwise from rest area i i i to rest area i + 1 i+1 i+1 (where rest area N + 1 N+1 N+1 refers to rest area 1 1 1).

The minimum number of steps required to walk clockwise from rest area s s s to rest area t t t ( s ≠ t s \neq t s=t) is a multiple of M M M.

Find the number of possible pairs ( s , t ) (s,t) (s,t).

Constraints

All input values are integers
2 ≤ N ≤ 2 × 1 0 5 2 \le N \le 2 \times 10^5 2N2×105
1 ≤ A i ≤ 1 0 9 1 \le A_i \le 10^9 1Ai109
1 ≤ M ≤ 1 0 6 1 \le M \le 10^6 1M106

Input

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

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

Output

Print the answer as an integer.

Sample Input 1

4 3
2 1 4 3

Sample Output 1

4

The minimum number of steps to walk clockwise from rest area 1 1 1 to rest area 2 2 2 is 2 2 2, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 1 1 1 to rest area 3 3 3 is 3 3 3, which is a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 1 1 1 to rest area 4 4 4 is 7 7 7, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 2 2 2 to rest area 3 3 3 is 1 1 1, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 2 2 2 to rest area 4 4 4 is 5 5 5, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 2 2 2 to rest area 1 1 1 is 8 8 8, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 3 3 3 to rest area 4 4 4 is 4 4 4, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 3 3 3 to rest area 1 1 1 is 7 7 7, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 3 3 3 to rest area 2 2 2 is 9 9 9, which is a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 4 4 4 to rest area 1 1 1 is 3 3 3, which is a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 4 4 4 to rest area 2 2 2 is 5 5 5, which is not a multiple of 3 3 3.
The minimum number of steps to walk clockwise from rest area 4 4 4 to rest area 3 3 3 is 6 6 6, which is a multiple of 3 3 3.
Therefore, there are four possible pairs ( s , t ) (s,t) (s,t).

Sample Input 2

2 1000000
1 1

Sample Output 2

0

Sample Input 3

9 5
9 9 8 2 4 4 3 5 3

Sample Output 3

11

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, m;
int a[N * 2];

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

	cin >> n >> m;
	for (int i = 1; i <= n; i ++)
		cin >> a[i], a[i + n] = a[i];
	for (int i = 1; i <= 2 * n; i ++) (a[i] += a[i - 1]) %= m;

	unordered_map<int, int> cnt;
	int res = 0;
	for (int i = 2; i <= n; i ++) cnt[a[i]] ++;
	
	for (int i = n + 1; i <= 2 * n; i ++) {
		res += cnt[a[i]], cnt[a[i]] ++;
		if (i > n) cnt[a[i - n + 1]] --;
	}

	cout << res << endl;

	return 0;
}

E - Permute K times

Problem Statement

You are given a sequence X X X of length N N N where each element is between 1 1 1 and N N N, inclusive, and a sequence A A A of length N N N.

Print the result of performing the following operation K K K times on A A A.
Replace A A A with B B B such that B i = A X i B_i = A_{X_i} Bi=AXi.

Constraints

All input values are integers.
1 ≤ N ≤ 2 × 1 0 5 1 \le N \le 2 \times 10^5 1N2×105
0 ≤ K ≤ 1 0 18 0 \le K \le 10^{18} 0K1018
1 ≤ X i ≤ N 1 \le X_i \le N 1XiN
1 ≤ A i ≤ 2 × 1 0 5 1 \le A_i \le 2 \times 10^5 1Ai2×105

Input

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

N N N K K K
X 1 X_1 X1 X 2 X_2 X2 … \dots X N X_N XN
A 1 A_1 A1 A 2 A_2 A2 … \dots A N A_N AN

Output

Let A ′ A' A be the sequence A A A after the operations. Print it in the following format:

A 1 ′ A'_1 A1 A 2 ′ A'_2 A2 … \dots A N ′ A'_N AN

Sample Input 1

7 3
5 2 6 3 1 4 6
1 2 3 5 7 9 11

Sample Output 1

7 2 3 5 1 9 3

In this input, X = ( 5 , 2 , 6 , 3 , 1 , 4 , 6 ) X=(5,2,6,3,1,4,6) X=(5,2,6,3,1,4,6) and the initial sequence is A = ( 1 , 2 , 3 , 5 , 7 , 9 , 11 ) A=(1,2,3,5,7,9,11) A=(1,2,3,5,7,9,11).
After one operation, the sequence is ( 7 , 2 , 9 , 3 , 1 , 5 , 9 ) (7,2,9,3,1,5,9) (7,2,9,3,1,5,9).
After two operations, the sequence is ( 1 , 2 , 5 , 9 , 7 , 3 , 5 ) (1,2,5,9,7,3,5) (1,2,5,9,7,3,5).
After three operations, the sequence is ( 7 , 2 , 3 , 5 , 1 , 9 , 3 ) (7,2,3,5,1,9,3) (7,2,3,5,1,9,3).

Sample Input 2

4 0
3 4 1 2
4 3 2 1

Sample Output 2

4 3 2 1

There may be cases where no operations are performed.

Sample Input 3

9 1000000000000000000
3 7 8 5 9 3 7 4 2
9 9 8 2 4 4 3 5 3

Sample Output 3

3 3 3 3 3 3 3 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;

const int N = 2e5 + 10;

int n, k;
int to[N][62], a[N];

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

	cin >> n >> k;
	for (int i = 1; i <= n; i ++)
		cin >> to[i][0];
	for (int i = 1; i <= n; i ++)
		cin >> a[i];

	for (int j = 1; j < 62; j ++)
		for (int i = 1; i <= n; i ++)
			to[i][j] = to[to[i][j - 1]][j - 1];

	for (int i = 1; i <= n; i ++) {
		int p = i;
		for (int j = 61; j >= 0; j --)
			if (k >> j & 1) p = to[p][j];

		cout << a[p] << " ";
	}
	cout<< endl;

	return 0;
}

F - Rearrange Query

Problem Statement

You are given sequences of positive integers of length N N N: A = ( A 1 , A 2 , … , A N ) A=(A_1,A_2,\ldots,A_N) A=(A1,A2,,AN) and B = ( B 1 , B 2 , … , B N ) B=(B_1,B_2,\ldots,B_N) B=(B1,B2,,BN).
You are given Q Q Q queries to process in order. The i i i-th query is explained below.
You are given positive integers l i , r i , L i , R i l_i,r_i,L_i,R_i li,ri,Li,Ri. Print Yes if it is possible to rearrange the subsequence ( A l i , A l i + 1 , … , A r i ) (A_{l_i},A_{l_i+1},\ldots,A_{r_i}) (Ali,Ali+1,,Ari) to match the subsequence ( B L i , B L i + 1 , … , B R i ) (B_{L_i},B_{L_i+1},\ldots,B_{R_i}) (BLi,BLi+1,,BRi), and No otherwise.

Constraints

$ 1\leq N,Q\leq 2\times 10^5$
$ 1\leq A_i,B_i\leq N$
$ 1\leq l_i \leq r_i\leq N$
$ 1\leq L_i \leq R_i\leq N$
All input values are integers.

Input

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

N N N Q Q Q
A 1 A_1 A1 A 2 A_2 A2 … \ldots A N A_N AN
B 1 B_1 B1 B 2 B_2 B2 … \ldots B N B_N BN
l 1 l_1 l1 r 1 r_1 r1 L 1 L_1 L1 R 1 R_1 R1
l 2 l_2 l2 r 2 r_2 r2 L 2 L_2 L2 R 2 R_2 R2
⋮ \vdots
l Q l_Q lQ r Q r_Q rQ L Q L_Q LQ R Q R_Q RQ

Output

Print Q Q Q lines. The i i i-th line should contain the answer to the i i i-th query.

Sample Input 1

5 4
1 2 3 2 4
2 3 1 4 2
1 3 1 3
1 2 3 5
1 4 2 5
1 5 1 5

Sample Output 1

Yes
No
No
Yes

For the 1st query, it is possible to rearrange ( 1 , 2 , 3 ) (1,2,3) (1,2,3) to match ( 2 , 3 , 1 ) (2,3,1) (2,3,1). Hence, we print Yes.
For the 2nd query, it is impossible to rearrange ( 1 , 2 ) (1,2) (1,2) in any way to match ( 1 , 4 , 2 ) (1,4,2) (1,4,2). Hence, we print No.
For the 3rd query, it is impossible to rearrange ( 1 , 2 , 3 , 2 ) (1,2,3,2) (1,2,3,2) in any way to match ( 3 , 1 , 4 , 2 ) (3,1,4,2) (3,1,4,2). Hence, we print No.
For the 4th query, it is possible to rearrange ( 1 , 2 , 3 , 2 , 4 ) (1,2,3,2,4) (1,2,3,2,4) to match ( 2 , 3 , 1 , 4 , 2 ) (2,3,1,4,2) (2,3,1,4,2). Hence, we print Yes.

Sample Input 2

4 4
4 4 4 4
4 4 4 4
1 2 2 3
3 3 1 1
1 3 1 4
1 4 2 3

Sample Output 2

Yes
Yes
No
No

Solution

具体见文末视频。


Code

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
const int N = 2e5 + 10;

int n, q, len;
int a[N], b[N], len1[N], len2[N];
pair<ull, ull> res1[N], res2[N];
ull hsh1, hsh2;
struct Query {
    int id, l, r;
    bool operator< (const Query &tmp)const {
        if (l / len == tmp.l / len) return r < tmp.r;
        return l / len < tmp.l / len;
    }
}qry1[N], qry2[N];

ull h(ull x) {
    return (ull)x * x * x * 1237123 + 19260817;
}
ull f(int x) {
    ull cur = h(x & ((1ll << 31) - 1)) + h(x >> 31);
    return cur;
}
ull h2(ull x) {
    return (ull)x * x * 1145141 + 998244353;
}
ull f2(int x) {
    ull cur = h2(x & ((1ll << 27) - 1)) + h2(x >> 27);
    return cur;
}
void add1(int po) {
    int x = a[po];
    hsh1 += f(x), hsh2 += f2(x);
}
void del1(int po) {
    int x = a[po];
    hsh1 -= f(x), hsh2 -= f2(x);
}
void add2(int po) {
    int x = b[po];
    hsh1 += f(x), hsh2 += f2(x);
}
void del2(int po) {
    int x = b[po];
    hsh1 -= f(x), hsh2 -= f2(x);
}

int main() {
    cin >> n >> q;
    for (int i = 1; i <= n; i ++)
        cin >> a[i];
    for (int i = 1; i <= n; i ++)
        cin >> b[i];

    len = max(sqrt((double)n * n / q), 1.0);
    for (int i = 1; i <= q; i ++) {
        int l1, r1, l2, r2;
        cin >> l1 >> r1 >> l2 >> r2;
        qry1[i] = {i, l1, r1}, qry2[i] = {i, l2, r2};
        len1[i] = r1 - l1 + 1, len2[i] = r2 - l2 + 1;
    }

    sort(qry1 + 1, qry1 + 1 + q);
    sort(qry2 + 1, qry2 + 1 + q);

    for (int i = 1, l = 1, r = 0; i <= q; i ++) {
        int lo = qry1[i].l, ro = qry1[i].r, id = qry1[i].id;
        while (l > lo) add1( -- l);
        while (l < lo) del1(l ++);
        while (r > ro) del1(r --);
        while (r < ro) add1( ++ r);
        res1[id] = make_pair(hsh1, hsh2);
    }
    hsh1 = hsh2 = 0;
    for (int i = 1, l = 1, r = 0; i <= q; i ++) {
        int lo = qry2[i].l, ro = qry2[i].r, id = qry2[i].id;
        while (l > lo) add2( -- l);
        while (l < lo) del2(l ++);
        while (r > ro) del2(r --);
        while (r < ro) add2( ++ r);
        res2[id] = make_pair(hsh1, hsh2);
    }

    for (int i = 1; i <= q; i ++) {
        if (res1[i] == res2[i] && len1[i] == len2[i]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

视频题解

AtCoder Beginner Contest 367(A ~ F 题讲解)


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

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

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

相关文章

flink车联网项目前篇:项目设计(第64天)

系列文章目录 车联网项目设计 5.1 数仓分层 5.2 数仓主题数据建模数据仓库建模方法论 2.1 关系建模 2.1.1 ER模型 2.1.2 关系模式范式 文章目录 系列文章目录前言5. 车联网项目设计5.1 数仓分层5.2 数仓主题 1. 数据建模2. 数据仓库建模方法论2.1 关系建模2.1.1 ER模型2.1.2 关…

[Meachines] [Medium] TartarSauce Wordpress-gwolle-gb-RFI+tar权限提升+定时器备份文件权限提升

信息收集 IP AddressOpening Ports10.10.10.88TCP:80 $ nmap -p- 10.10.10.88 --min-rate 1000 -sC -sV PORT STATE SERVICE VERSION 80/tcp open tcpwrappedWordpress & gwolle-gb & RFI $ feroxbuster --url http://10.10.10.88/ $ wpscan --url http://10.…

汽车IVI中控OS Linux driver开发实操(二十五):GPIO设备驱动的上手编写

概述: 1、验证GPIO是否有效。 2、如果有效,则可以从内核GPIO子系统请求GPIO。 3、将GPIO导出到sysfs(这是可选的)。 4、设置GPIO的方向 5、如果将GPIO设置为输出引脚,则将其设置为高/低。 6、设置去抖动间隔,如果将其设置为输入引脚,则读取状态。您还可以为边缘/级别触…

图像直方图计算

1. 图像直方图&#xff08;Image histogram&#xff09; 图像直方图&#xff0c;又叫影像直方图&#xff0c;是一种用来表现数位影像中像素分布的直方图&#xff0c;根据统计影像中不同亮度的像素总数&#xff0c;我们可以画出一张代表这张影像的影像直方图&#xff0c;透过这…

排序算法【快速排序】

一、快速排序算法原理 直接采用实际的例子解释原理&#xff0c;实际的数组如下图所示。 排序算法流程如下所示 然后按照上面顺序递归下去&#xff0c;直到排序完成推出。 二、算法代码 #include <stdio.h> #include "test.h"/* 快速排序算法 */ void quick_s…

Camera基础知识系列(1)——凸\凹透镜

目录 前言 一. 凸\凹透镜 1 凸透镜 1.1 凸透镜成像 1.2 物距\像距 1.3 凸透镜成像规律 2. 凹透镜 2.1 凹透镜成像规律 二. 相机 相机镜头 前言 平日里总是时不时地听到别人讲起一些摄影相关的术语&#xff0c;比如&#xff1a;光圈、焦距、等效焦距、EV、画幅、景深、快门…

使用Qdrant+FastText实现向量存储和检索

1 概述 在《使用FastText库训练词向量》一文中&#xff0c;已经训练并保存好了一个用 FastText 训练的词向量模型-model_0809_001。在接下来的实践中&#xff0c;将直接使用该词向量模型来生成对应数据的向量&#xff0c;然后将向量和对应的负载存储到 Qdrant 中&#xff0c;然…

基于Conda的Python版本管理与Python包管理

文章目录 前言Conda是什么Conda与Anaconda安装Anaconda安装包windows v2024.06-1安装包更多版本安装包(Windows/Mac/Linux) 安装 使用步骤创建Python环境激活Python环境安装Python包列出和切换 Python 版本管理多个环境 总结 前言 开发环境中&#xff0c;需要使用不同的Python…

eNSP 华为三层交换机配置DHCP

华为三层交换机配置DHCP 华为DHCP原理&#xff1a;&#xff08;思科四个都是广播包&#xff09; 1、客户端广播发送DHCP Discover包。用于发现当前局域网中的DHCP服务器。 2、DHCP服务器单播发送DHCP Offer包给客户端。携带分配给客户端的IP地址。 3、客户端广播发送DHCP Resqe…

如何给Airtest脚本/报告增加log记录

1. 前言 尽管Airtest脚本运行过程中会输出非常丰富的log信息&#xff0c;并且Airtest报告也会把我们脚本的的运行步骤显示出来&#xff0c;但有时候&#xff0c;我们会需要在脚本里面&#xff0c;插入一些自定义的log内容&#xff08;比如某些关键点&#xff09;&#xff0c;并…

UR5e机器人Gazebo仿真模拟

Gazebo仿真环境 Gazebo是一款开源的机器人仿真平台&#xff0c;基于物理引擎&#xff0c;能够模拟机器人在真实世界中的运动和交互。它支持多种机器人模型与传感器&#xff0c;以及丰富的环境场景&#xff0c;为机器人研发提供了便捷的测试平台。 UR5e机器人Gazebo仿真模拟步骤…

基于Windows系统和‌Linux系统,以tomcat为案例,讲解如何新增自启动服务。

文章目录 引言‌I Linux系统‌(以CentOS为例)基础知识:运行级别(run level)基于chkconfig 工具,设置服务启动类型。基于systemctl 新增系统服务制定定时任务优化停止Tomcat服务命令II 基于Windows系统设置服务自启动的常规操作安装多个tomcat服务,并设置自启动。引言 场景…

IDEA中@Test测试时无法通过键盘输入

在IDEA中使用Test发现Scanner无法在控制台输入&#xff0c;如下所示&#xff1a; 发现这里是只读模式&#xff0c;无法进行输入。 解决方案&#xff1a; 找到编辑虚拟机选项&#xff0c;添加如下&#xff1a; -Deditable.java.test.consoletrue 如下所示:(重启一次IEDA)

R语言统计分析——多元线性回归

参考资料&#xff1a;R语言实战【第2版】 1、多元线性回归 当预测变量不止一个时&#xff0c;简单线性回归就变成了多元线性回归。从技术上来说&#xff0c;多项式回归可以算是多元线性回归的特例&#xff1a;二次回归有两个预测变量&#xff08;X和X^2&#xff09;。 以基础包…

使用DOM破坏启动xss

实验环境&#xff1a; Lab: Exploiting DOM clobbering to enable XSS | Web Security Academy (portswigger.net) 分析&#xff1a; 找破坏点&#xff1a; 第一个输入框可以看见是<texarrea>;不能插入语句.&#xff1a; 构造一个语句试试 <img src1 οnerrοraler…

深入理解HTTPS协议:CA证书的安全机制

文章目录 一、HTTP的不足二、HTTP 加密 证书 完整性保护 HTTPS三、加密与解密1、对称密钥加密2、非对称密钥加密3、证书 一、HTTP的不足 HTTP 主要有这些不足&#xff0c;例举如下&#xff1a; 通信使用明文&#xff08;不加密&#xff09;&#xff0c;内容可能会被窃听不…

kettle获取URL接口数据

使用kettle获取URL接口数据结果保留到文件里 1 生成记录里添加URL信息 2 使用Rest_Client组件处理URL数据结果保存到字段里&#xff08;json的&#xff09; 3 使用json_input 组件处理json数据 4 保存结果到文件里

【protobuf】ProtoBuf——proto3语法详解、字段规则、消息类型的定义与使用、通讯录的写入和读取功能实现

文章目录 ProtoBuf5. proto3语法详解5.1 字段规则5.2 消息类型的定义与使用 ProtoBuf 5. proto3语法详解 在语法详解部分&#xff0c;依旧通过项目推进的方式开展教学。此部分会对通讯录多次升级&#xff0c;用 2.x 表示升级的版本&#xff0c;最终将完成以下内容的升级&#x…

2 C 语言开发工具的选择、 MinGW 的安装与配置、VS Code 的安装与配置、插件推荐

目录 1 开发工具的选择 1.1 Visual Studio 1.2 Code::Block 1.3 Clion 1.4 VS Code 1.5 在线编辑工具 2 开发工具安装 2.1 安装 MinGW-w64 2.1.1 MinGW-w64 介绍 2.1.2 解压 MinGW 2.1.3 将 MinGW 添加至环境变量 2.1.4 验证安装 2.2 安装 VS Code 2.2.1 下载安装…

无刷直流电机的个人总结

电机分类 主要分为两大类&#xff1a;有刷电机&#xff0c;无刷电机 有刷电机 原理图截图来源&#xff0c;工作原理就是对转子线圈通电后产生磁性和外壳中的永磁体相互作用&#xff0c;导致转子转动。而在转子转动过程中如果不改变电流方向&#xff0c;那么磁性不变&#xf…