<个人笔记>基础算法模板题

1.基础算法

(1)一维前缀和

#include<iostream>

using namespace std;

const int N = 1e5+10;

int p[N],res[N];
int n,Q,l,r;
 
int main()
{
	cin >> n >> Q;
	
	for(int i = 1;i<=n;++i)
	{
		cin >> p[i];
		res[i] = res[i - 1] + p[i];
	}
	
	while(Q--){
		cin >> l >> r;
		cout << res[r] - res[l - 1] << endl;
	}
	
	return 0;
	
}

(2)二维前缀和

#include<iostream>

using namespace std;

const int N = 1005;

int p[N][N],res[N][N];
int n,m,Q,x1,x2,y1,y2;

int main()
{
	cin >> n >> m >> Q;
	
	for(int i = 1;i <= n; ++i){
		for(int j = 1;j<=m;++j){
			cin >> p[i][j];
			res[i][j] = res[i - 1][j] + res[i][j - 1] - res[i - 1][j - 1] + p[i][j];
		}
	} 
	
	while(Q--)
	{
		cin >> x1 >> y1 >> x2 >> y2;
		
		cout << res[x2][y2] + res[x1 - 1][y1 - 1] - res[x1 - 1][y2] - res[x2][y1 - 1] << endl; 
	}
	
	return 0;
	
}

(3) 一维差分

#include<iostream>

using namespace std;

const int N = 1e5 + 10;

int p[N],res[N];
int n,Q,l,r,x;

int main(){
	cin >> n >> Q;
	
	for(int i = 1;i <= n;++i){
		cin >> p[i];
		res[i] = p[i] - p[i - 1];
	}
	
	while(Q--)
	{
		cin >> l >> r >> x;
		res[l] += x;
		res[r + 1] -= x;
	}
	
	int tot = 0;
	
	for(int i = 1;i<=n;++i)
	{
		tot += res[i];
		cout << tot << ' ';
		
	}
	
	return 0;
}

(4)二维差分

#include<iostream>

using namespace std;

const int N = 1005;

int p[N][N],res[N][N];

int n,m,Q,x1,y1,x2,y2,c;

void add(int x1,int y1,int x2,int y2,int c)
{
	res[x1][y1] += c;
	res[x2 + 1][y2 + 1] += c;
	res[x1][y2 + 1] -= c;
	res[x2 + 1][y1] -= c; 
}

int main()
{
	cin >> n >> m >> Q;
	for(int i = 1;i<=n;++i){
		for(int j = 1;j<=m;++j){
			cin >> p[i][j];
			add(i,j,i,j,p[i][j]);
		}
	}
	
	while(Q--)
	{
		cin >> x1 >> y1 >> x2 >> y2 >> c;
		add(x1,y1,x2,y2,c);
	}
	
	for(int i = 1;i <= n; ++i)
	{
		for(int j = 1;j <= m; ++j)
		{
			res[i][j] += res[i - 1][j] + res[i][j - 1] - res[i - 1][j - 1];
			cout << res[i][j] << ' ';
		}
		cout << endl;
	}
	
	return 0;
	
} 

(5)双指针

#include<iostream>

using namespace std;

const int N = 1e5 + 10;

int cnt[N],p[N];
int n,len = -1;

int main(){
	cin >> n;
	
	for(int i = 1;i<=n;++i){
		cin >> p[i];
	}
	
	for(int i = 1,j = 1;j <= n;++j){
		
		cnt[p[j]]++;
		
		while(cnt[p[j]] > 1)
		{
			cnt[p[i]]--;
			i++;
		}
		
		len = max(j - i + 1,len);	
	}
	
	cout << len << endl;
	
	return 0;
}

(6)区间合并

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

const int N = 1e5 + 10;

typedef pair<int,int>PII;

vector<PII>q;

int n;
int cnt = 0;

int main(){
	cin >> n;
	
	for(int i = 1;i <= n; ++i){
		int l,r;
		cin >> l >> r;
		q.push_back({l,r}); 
	}
	
	sort(q.begin(),q.end());

	
	for(int i = 0;i < q.size();++i)
	{
		int l,r;
		if(i == 0)
		{
			cnt ++;
			l = q[i].first;
			r = q[i].second;	
			continue;
		}
		
		if(q[i].first <= r) r = max(q[i].second,r);
		else{
			cnt ++;
			l = q[i].first;
			r = q[i].second;
		}
		
	}
	
	cout << cnt << endl;
	return 0;
} 

(7)归并排序与逆序对

#include<iostream>
 #include<vector>
 
 
 using namespace std; 
 
 const int N = 1e5 + 10;
 
 int n,p[N];
 int cnt = 0;
 
 void merge(int l,int r)
 {
 	if(l >= r) return;
	 
	vector<int>t;
 	t.clear();
 	 	
 	int mid = (l + r) / 2;
 	merge(l,mid),merge(mid + 1,r);
 	
 	int i = l,j = mid + 1;
 	
 	while(i <= mid && j <= r)
	{
		if(p[i] > p[j])
		{
			cnt += mid - i + 1;
			t.push_back(p[j]);
			j++;
		}
		
		if(p[i] <= p[j])
		{
			t.push_back(p[i]);
			i++;
		}
	}
	
	while(i <= mid){
		t.push_back(p[i]);
		i++;
	}
	
	while(j <= r){
		t.push_back(p[j]);
		j++;
	}
 	
 	for(int i = 0;i < t.size(); ++i) p[i + l] = t[i];
	 
	return; 
 }
 
 int main()
 {
 	cin >> n;
 	
 	for(int i = 1;i <= n; ++i) cin >> p[i];
 	
 	merge(1,n);
 	
 	cout << cnt << endl;
 	
 	for(int i = 1;i <= n; ++i) cout << p[i] << ' ';
 	
 	return 0;
 	
 	
 }

(8)单调栈

#include<iostream>
#include<stack>

using namespace std;

int n,p;
stack<int>q;

int main()
{
	
	cin >> n;
	
	while(n--)
	{
		cin >> p;
		
		while(q.size() != 0 && q.top() >= p)
		{
			q.pop();
		}
		
		if(q.size() == 0) cout << -1 << ' ';
		else cout << q.top() << ' '; 
		
		q.push(p); 
	}
	
	return 0;
}

(9)单调队列

#include<iostream>

using namespace std;

const int N = 1e6 + 10;

int q[N],p[N];
int n,len;

int main()
{
	cin >> n >> len;
	
	for(int i = 0;i < n; ++i) cin >> p[i];
	
	int h,t;
	
	h = 0,t = -1;
	for(int i = 0;i < n; ++i)
	{
		while(h <= t && q[h] < i - len + 1) h++;
		while(h <= t && p[q[t]] >= p[i]) t--;
		t++;
		q[t] = i;
		if(i >= len - 1) cout << p[q[h]] << ' ';
	}
	
	cout << endl;
	
	h = 0,t = -1;
	for(int i = 0;i < n; ++i)
	{
		while(h <= t && q[h] < i - len + 1) h++;
		while(h <= t && p[q[t]] <= p[i]) t--;
		t++;
		q[t] = i;
		if(i >= len - 1) cout << p[q[h]] << ' ';
	}
	
	
	return 0;
} 

(10)整数二分


#include<iostream>

using namespace std;

const int N = 1e5 + 10;

int p[N];
int n,Q,x;

int leftfind(int x)
{
	int l = 1,r = n;
	
	while(l < r)
	{
		int mid = (l + r) / 2;
		if(p[mid] < x) l = mid + 1;
		else r = mid;
	}
	
	if(p[l] == x) return l - 1;
	else return -1;
}

int rightfind(int x){
	int l = 1,r = n;
	
	while(l < r){
		int mid = (l + r + 1) / 2;
		if(p[mid] > x) r = mid - 1;
		else l = mid;
	}
	
	if(p[l] == x) return l - 1;
	else return -1;
}

int main(){
	cin >> n >> Q;
	for(int i = 1;i <= n; ++i) cin >> p[i];
	
	while(Q--)
	{
		cin >> x;
		cout << leftfind(x) << ' ';
		cout << rightfind(x) << endl;	
	}
	
	return 0;
} 

2.数论

(1)快速幂

#include<iostream>

using namespace std;

typedef long long LL;

int Q;

LL qmi(LL a,LL b,LL mod){
	
	LL res = 1;
	while(b)
	{
		if(b&1) res = res * a % mod;
		a = a * a % mod;
		b = b >> 1;
	}
	
	return res;
}

int main()
{
	cin >> Q;
	
	while(Q--)
	{
		LL a,b,c;
		cin >> a >> b >> c;
		cout << qmi(a,b,c) << endl;
	}
	
	return 0;
} 

(2)约数个数

#include<unordered_map>
#include<iostream>

using namespace std;

unordered_map<int,int>q;
unordered_map<int,int>::iterator it;

const int mod = 1e9 + 7;

typedef long long LL; 

void handle(int x){
	
	for(int i = 2;i * i <= x;++i)
	{
		if(x % i == 0)
		{
			int cnt = 0;
			while(x % i == 0){
				x = x / i;
				cnt++;
			}
			q[i] += cnt;
		}
	}
	if(x > 1) q[x] += 1;
	
}

int Q,x;
LL ans = 1;

int main()
{
	cin >> Q;
	
	while(Q--)
	{
		cin >> x;
		handle(x); 
	}
	
	for(it = q.begin();it != q.end();++it){
		int a = it->first;
		int b = it->second;
		
		LL res = 1;
		
		for(int i = 1;i <= b; ++i)
		{
			LL res = (res * a + 1) % mod;
		}
		
		ans = ans * res % mod;
		
		
	}
	
	cout << ans << endl;
}

(3)约数之和

#include<unordered_map>
#include<iostream>

using namespace std;

unordered_map<int,int>q;
unordered_map<int,int>::iterator it;

const int mod = 1e9 + 7;

typedef long long LL; 

void handle(int x){
	
	for(int i = 2;i * i <= x;++i)
	{
		if(x % i == 0)
		{
			int cnt = 0;
			while(x % i == 0){
				x = x / i;
				cnt++;
			}
			q[i] += cnt;
		}
	}
	if(x > 1) q[x] += 1;
	
}

int Q,x;
LL ans = 1;

int main()
{
	cin >> Q;
	
	while(Q--)
	{
		cin >> x;
		handle(x); 
	}
	
	for(it = q.begin();it != q.end();++it)
	{
		int a = it->first;
		int b = it->second;
	
		LL res = 1;
		
		while(b--) 
		{
			res = (res * a + 1) % mod;
		}
		
		ans = ans * res % mod;
			
	}
	
	cout << ans << endl;
	
	return 0;
}

(4)组合数(一)

#include<iostream>

using namespace std;

typedef long long LL;

const int mod = 1e9 + 7;
const int N = 2005;

int c[N][N];
int main()
{
	
	for(int i = 0;i < N; ++i){
		for(int j = 0;j <= i; ++j)
		{
			if(j == 0) c[i][j] = 1;
			else c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
		}
	}
	
	int Q;
	cin >> Q;
	
	while(Q--)
	{
		int a,b;
		cin >> a >> b;
		
		cout << c[a][b] << endl; 
	}
	
	return 0;
}

(5)组合数(二)

#include<iostream>

using namespace std;

const int N = 1e5 + 5;
const int mod = 1e9 + 7;

typedef long long LL;

LL f[N],inf[N];


LL qmi(LL a,LL b,LL mod)
{
	LL res = 1;
	
	while(b)
	{
		if(b & 1) res = res * a % mod;
		a = a * a % mod;
		b = b >> 1;
		
	}
	
	return res;
} 

int main()
{
	f[0] = inf[0] = 1;
	for(int i = 1;i < N;++i)
	{
		f[i] = f[i - 1] * i % mod;
		inf[i] = qmi(f[i],mod - 2,mod);
	}
	
	int Q,a,b;
	cin >> Q;
	while(Q--)
	{
		cin >> a >> b;
		
		LL ans = f[a] * inf[b] % mod * inf[a - b] % mod;
		
		cout << ans << endl;
	}
	
	return 0;	
	
} 

(6)位运算

#include<iostream>

using namespace std;

int main(){
	int Q,x,cnt = 0;
	
	cin >> Q;
	
	while(Q--)
	{
		cnt = 0;
		cin >> x;
	
	    while(x)
		{
	  	  if(x&1) cnt++;
		  x = x >> 1;
	    }
	
	    cout << cnt << ' ';
	}
	return 0;
}

(7)快速幂求解逆元

#include<iostream>

using namespace std;

typedef long long LL;

LL qmi(LL a,LL b,LL mod){
	LL res = 1;
	
	while(b){
		
		if(b & 1) res = res * a % mod;
		a = a * a % mod;
		b = b >> 1;
		
	}
	
	return res;
} 

int main(){
	int Q;
	cin >> Q;
	
	while(Q--){
		LL a,p;
		cin >> a >> p;
		if(a % p == 0){
			cout << "impossible" << endl;
			continue; 
		}
		
		cout << qmi(a,p - 2,p) << endl;
	}
	
	return 0;
}

(8)gcd

#include<iostream>

using namespace std;

int gcd(int a,int b)
{
	return b?gcd(b,a%b):a;
}

int Q,a,b;

int main()
{
	cin >> Q;
	
	while(Q--)
	{
		cin >> a >> b;	
		cout << gcd(a,b) << endl;
	}
	
	return 0;
	
	
}

(9)欧拉函数

#include<iostream>

using namespace std;

typedef long long LL;

LL euler(int x)
{
	LL res = x;
	
	for(int i = 2;i * i <= x;++i){
		if(x % i == 0)
		{
			res = res * (i - 1) / i;
			while(x % i == 0) x = x/i;
		}	
	}
	
	if(x > 1) res = res * (x - 1) / x; 
	
	return res;
}

int main(){
	int Q,x;
	
	cin >> Q; 
	
	while(Q--)
	{
		cin >> x;
		cout << euler(x) << endl;
	} 
	
	return 0;
}

3.图论

(1)djistra

#include<iostream>
#include<queue>
#include<cstring>
#include<vector>

using namespace std;

const int N = 1e6 + 10;

int dist[N];
bool st[N];
int ne[N],e[N],w[N],h[N],idx;

int n,m;

typedef pair<int,int>PII;
priority_queue<PII,vector<PII>,greater<PII>>q;

void add(int a,int b,int c)
{
	e[idx] = b,ne[idx] = h[a],w[idx] = c,h[a] = idx++;
}

int djistra()
{
	dist[1] = 0;
	q.push({0,1});
	
	while(q.size() != 0)
	{
		PII t = q.top();
		q.pop();
		
		int v = t.second,d = t.first;
		
		if(st[v]) continue;
		st[v] = true;
		
		for(int i = h[v];i != -1;i = ne[i])
		{
			int j = e[i];
			if(dist[j] > d + w[i])
			{
				dist[j] = d + w[i];
				q.push({dist[j],j});
			}
			
		}	
	}  
	
	if(dist[n] == 0x3f3f3f3f) return -1;
	else return dist[n];
	
}

int main()
{
	memset(h, -1 ,sizeof(h));
	memset(dist, 0x3f, sizeof(dist));
	
	cin >> n >> m;
	
	for(int i = 1;i <= m; ++i)
	{
		
		int a,b,c;
		
		cin >> a >> b >> c;
		
		add(a,b,c);
	}
	
	cout << djistra() << endl;
	
	return 0;
	
}

(2)floyd

#include<iostream>
#include<cstring>

using namespace std;

const int N = 205;

int p[N][N];

int n,m,k;

void floyd(){
	
	for(int k = 1;k <= n; ++k){
		for(int i = 1;i <= n; ++i){
			for(int j = 1;j <= n; ++j){
				if(p[i][j] > p[i][k] + p[k][j]) p[i][j] = p[i][k] + p[k][j];
			}
		}
	}
}

int main()
{
	
	cin >> n >> m >> k;
	
	memset(p,0x3f,sizeof(p));
	
	for(int i = 1;i <= n; ++i) p[i][i] = 0;
 	
	for(int i = 1;i <= m; ++i)
	{
		int a,b,c;
		cin >> a >> b >> c;
		p[a][b] = min(p[a][b],c);
	}
	
	
	floyd(); 

	
	while(k--)
	{
		int a,b;
		
		cin >> a >> b;
		
		if(p[a][b] > 0x3f3f3f3f/2) cout << "impossible" << endl;
		else cout << p[a][b] << endl;
		
	}
	
	return 0;
	
	
}

(3)spfa

#include<iostream>
#include<cstring>
#include<queue>

using namespace std;

const int N = 1e6 + 10;

int dist[N];
int h[N],e[N],ne[N],w[N],idx;
bool st[N];

int n,m;

void add(int a,int b,int c)
{
	e[idx] = b,ne[idx] = h[a],w[idx] = c,h[a] = idx++;
}

void spfa()
{
	queue<int>q;
	
	dist[1] = 0;
	st[1] = true; 
	
	q.push(1);
	
	while(q.size() != 0)
	{
		auto t = q.front();
		q.pop();
		
		st[t] = false;
		
		for(int i = h[t]; i != -1; i = ne[i])
		{
			int j = e[i];
			
			if(dist[j] > dist[t] + w[i])
			{
				dist[j] = dist[t] + w[i];
				
				if(st[j]) continue;
				st[j] = true;
				q.push(j);		
			}	
		}	
	}
	
	if(dist[n] == 0x3f3f3f3f) cout << "impossible" << endl;
	else cout << dist[n] << endl;	
}


int main()
{
	memset(h,-1,sizeof(h));
	memset(dist,0x3f,sizeof(dist));
	
	cin >> n >> m;
	
	for(int i = 1;i <= m;++i)
	{
		int a,b,c;
		cin >> a >> b >> c;
		add(a,b,c);
	}
	
	spfa();
	
	return 0; 
}

(4)树的遍历

#include<iostream>
#include<cstring>

using namespace std;

const int N = 1e5 + 10;

bool st[N];
int e[N * 2],ne[N * 2],h[N * 2],idx = 0;
int n,ans = 0x3f3f3f3f;

void add(int a,int b)
{
	e[idx] = b,ne[idx] = h[a],h[a] = idx++;
}

int dfs(int u)
{
	st[u] = true;
	int sum = 0,tot = -1;
	for(int i = h[u];i != -1;i = ne[i]){
		
		int j = e[i];
		
		if(st[j])
		{
		  int k = dfs(j);
		  sum += k;
		  tot = max(tot,k);
			
		}		
		
	}
	
	tot = max(n - 1 - sum,tot);
	ans = min(tot,ans);
	
	return sum + 1;
	
}

int main()
{
	memset(h,-1,sizeof(h));
	
	cin >> n;
	
	for(int i = 1;i <= n-1;++i)
	{
		int a,b;
		cin >> a >> b;
		add(a,b);
		add(b,a);
	}
	
	dfs(1);
	
	cout << ans << endl;
	
	return 0;
	
}


(5)图的遍历

#include<iostream>
#include<cstring>
#include<queue>

using namespace std;

const int N = 1e5 + 10;

int ne[N],h[N],e[N],idx = 0;
int dist[N];
bool st[N];
int n,m;

void add(int a,int b){
	e[idx] = b,ne[idx] = h[a],h[a] = idx++;
} 

void bfs(int u)
{
	st[u] = true;
	queue<int>q;
	q.push(1);
	
	while(q.size() != 0)
	{
		int t = q.front();
		q.pop();
		st[t] = true;
		
		for(int i = h[t]; i != -1; i = ne[i])
		{
			
			int j = e[i];
			
			if(st[j]) continue;
			
			if(dist[j] > dist[t] + 1) dist[j] = dist[t] + 1;
			q.push(j);
		}
		 
	}
	
	return;
	
}

int main()
{
	memset(h,-1,sizeof(h));
	memset(dist,0x3f,sizeof(dist));
	
	cin >> n >> m;
	
	for(int i = 1;i <= m; ++i){
		int a,b;
		cin >> a >> b;
		
		add(a,b);
	}
	
	dist[1] = 0;
	bfs(1);
	
	if(dist[n] == 0x3f3f3f3f) cout << "-1" << endl;
	else cout << dist[n] << endl;
	
    return 0;
}

(6)拓扑序列

#include<iostream>
#include<cstring>
#include<vector>
#include<queue>

using namespace std;

const int N = 1e5 + 10;

int in[N];
int h[N],ne[N],e[N],idx = 0;
bool st[N];

vector<int>ans;
int n,m;

void add(int a,int b)
{
	e[idx] = b,ne[idx] = h[a],h[a] = idx++;
}

void bfs()
{	
	
	queue<int>q;
	
	for(int i = 1;i <= n; ++i) if(in[i] == 0) q.push(i);
	
	while(q.size() != 0)
	{
		int t = q.front();
		q.pop();
		ans.push_back(t);
		
		for(int i = h[t];i != -1;i = ne[i])
		{
			int j = e[i];
			in[j]--;
			if(in[j] == 0) q.push(j);
		}
	} 
	
	return;
	
}


int main()
{
	memset(h,-1,sizeof(h));
	
	cin >> n >> m;
	
	
	for(int i = 1;i <= m;++i){
		
		int a,b;
		cin >> a >> b;
		
		in[b]++;
		
		add(a,b);
	}
	
	bfs(); 
	
	if(ans.size() != n) cout << "-1" << endl;
	else{
		for(int i = 0;i < n; ++i) cout << ans[i] << ' '; 
	}
	
	return 0;
	
} 

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

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

相关文章

明文scheme拉起此小程序

微信开发文档说明&#xff1a;https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/url-scheme.html 1、开发者无需调用平台接口&#xff0c;在MP平台->设置->隐私与安全->明文Scheme拉起此小程序声明后&#xff0c;可自行根据如下格式拼接app…

【静态分析】软件分析课程实验A1-活跃变量分析和迭代求解器

1 作业导览 为 Java 实现一个活跃变量分析&#xff08;Live Variable Analysis&#xff09;。实现一个通用的迭代求解器&#xff08;Iterative Solver&#xff09;&#xff0c;用于求解数据流分析问题&#xff0c;也就是本次作业中的活跃变量分析。 Live Variable Analysis 详…

facenet人脸检测+人脸识别+性别识别+表情识别+年龄识别的C++部署

文章目录 一. 人脸检测二.人脸识别facenet2.1 训练人脸识别模型2.2 导出ONNX2.3 测试 三.人脸属性&#xff08;性别、年龄、表情、是否戴口罩&#xff09;3.1 训练3.2 导出ONNX3.3 测试 四. 集成应用五、Jetson 部署5.1 NX5.2 NANO 一. 人脸检测 代码位置&#xff1a;1.detect …

深入理解数据结构第五弹——排序(2)——快速排序

排序&#xff08;1&#xff09;&#xff1a;深入了解数据结构第四弹——排序&#xff08;1&#xff09;——插入排序和希尔排序-CSDN博客 前言&#xff1a; 在前面我们已经讲过了几种排序方式&#xff0c;他们的效率有快有慢&#xff0c;今天我们来学习一种非常高效的排序方式…

【windows-搭建Ubuntu22LTS】

一、环境要求 1. windows版本要求 至少Windows 10 2020年5月(2004) 版, Windows 10 2019年5月(1903) 版&#xff0c;或者 Windows 10 2019年11月(1909) 版 2. 控制面板开启相关的程序(需要重启) 二、Microsoft store安装unbuntu 下载后直接运行&#xff08;稍微等会&#…

Linux软件安装和部署Java代码

文章目录 1.软件安装1.1.软件安装方式1.2.常用软件安装1.2.1 安装jdk1.2.2 安装Tomcat1.2.3 安装MySQL1.2.4 安装lrzsz 2.项目部署2.1.手工部署项目2.2 通过Shell脚本自动部署项目 1.软件安装 1.1.软件安装方式 &#xff08;1&#xff09;二进制发布包安装&#xff1a; 软件已…

基于SSM的学校在线考试系统的设计与实现

功能需求 管理员模块 管理员模块是整个学校在线考试系统中最为重要的管理者&#xff0c;能够对网站内的各种信息进行管理&#xff0c;能够对教师、学生的个人资料进行管理&#xff0c;对于已经离校的学生将其剔除考试名单&#xff0c;将新入校的学生纳入到考试名单中。对于入…

用 element ui 实现季度选择器

由于在数据项目中经常以各种时间条件查询数据&#xff0c;所以时间选择器&#xff08;DatePicker&#xff09;组件是很常用的组件。但是在我使用的 Element UI 中&#xff0c;缺少了季度选择器的功能。 简易实现 一开始我根据时间范围使用 select 去遍历,如 2024-Q1、2023-Q4…

win/mac达芬奇19下载:DaVinci Resolve Studio 19

DaVinci Resolve Studio 19 是一款功能强大的视频编辑和调色软件&#xff0c;广泛应用于电影、电视和网络节目的后期制作。这款软件不仅提供了专业的剪辑、调色和音频处理工具&#xff0c;还引入了全新的DaVinci Neural Engine AI工具&#xff0c;对100多项功能进行了大规模升级…

美化博客文章(持续更新)

&#x1f381;个人主页&#xff1a;我们的五年 &#x1f50d;系列专栏&#xff1a;游戏实现&#xff1a;贪吃蛇​​​​​​ &#x1f337;追光的人&#xff0c;终会万丈光芒 前言&#xff1a; 该文提供我的一些文章设计的一些方法 目录 1.应用超链接 1.应用超链接

差速机器人模型LQR 控制仿真——路径模拟

LQR路径跟踪要求路径中带角度&#xff0c;即坐标&#xff08;x,y,yaw&#xff09;&#xff0c;而一般我们的规划出来的路径不带角度。这里通过总结相关方法&#xff0c;并提供一个案例。 将点路径拟合成一条完整的线路径算法 将点路径拟合成一条完整的线路径是一个常见的问题…

【Java开发指南 | 第十五篇】Java Character 类、String 类

读者可订阅专栏&#xff1a;Java开发指南 |【CSDN秋说】 文章目录 Java Character 类转义序列 Java String 类连接字符串 Java Character 类 Character 类是 Java 中用来表示字符的包装类&#xff0c;它提供了一系列静态方法用于对字符进行操作&#xff0c;其主要分为静态方法…

06 JavaScript学习:语句

JavaScript 语句是用来执行特定任务或操作的一组指令。它可以包括变量声明、条件语句、循环语句、函数调用等。JavaScript 语句以分号结尾&#xff0c;每个语句都会被解释器执行。 分号 ; 在JavaScript中&#xff0c;分号&#xff08;;&#xff09;用于表示语句的结束。尽管在…

python爬虫-----深入了解 requests 库(第二十五天)

&#x1f388;&#x1f388;作者主页&#xff1a; 喔的嘛呀&#x1f388;&#x1f388; &#x1f388;&#x1f388;所属专栏&#xff1a;python爬虫学习&#x1f388;&#x1f388; ✨✨谢谢大家捧场&#xff0c;祝屏幕前的小伙伴们每天都有好运相伴左右&#xff0c;一定要天天…

【汇编语言】初识汇编

【汇编语言】初识汇编 文章目录 【汇编语言】初识汇编前言由机器语言到汇编语言机器语言与机器指令汇编语言与汇编指令汇编语言程序示例 计算机组成指令和数据的表示计算机的存储单元计算机的总线 内存读写与地址空间CPU对存储器的读写内存地址空间 总结 前言 为什么要学习汇编…

Numpy重修系列(一) --- 初识Numpy

一、为什么使用Numpy&#xff1f; 1.1、简介 Python科学计算基础包&#xff0c;提供 多维数组对象 、派生对象&#xff08;掩码数组、矩阵&#xff09; 数组的快速操作&#xff08;数学计算、逻辑、形状变化、排序、选择、输入输出、离散傅里叶变换、基本线性代数、基本统计运…

数据分析案例-中国黄金股票市场的EDA与价格预测

&#x1f935;‍♂️ 个人主页&#xff1a;艾派森的个人主页 ✍&#x1f3fb;作者简介&#xff1a;Python学习者 &#x1f40b; 希望大家多多支持&#xff0c;我们一起进步&#xff01;&#x1f604; 如果文章对你有帮助的话&#xff0c; 欢迎评论 &#x1f4ac;点赞&#x1f4…

【数据结构】单链表经典算法题的巧妙解题思路

目录 题目 1.移除链表元素 2.反转链表 3.链表的中间节点 4.合并两个有序链表 5.环形链表的约瑟夫问题 解析 题目1&#xff1a;创建新链表 题目2&#xff1a;巧用三个指针 题目3&#xff1a;快慢指针 题目4&#xff1a;哨兵位节点 题目5&#xff1a;环形链表 介绍完了…

Activity——spring方式创建activiti所需数据表结构

文章目录 前言依赖引入编写数据库连接等配置配置日志文件编写java代码生成数据库表结构问题反馈与解决思路问题一&#xff1a;Cause: java.sql.SQLSyntaxErrorException: Table activiti_02.act_ge_property doesnt exist 为什么文件名必须写死&#xff1f; 前言 在之前创建ac…

循序渐进丨使用 Python 向 MogDB 数据库批量操作数据的方法

当我们有时候需要向数据库里批量插入数据&#xff0c;或者批量导出数据时&#xff0c;除了使用传统的gsql copy命令&#xff0c;也可以通过Python的驱动psycopg2进行批量操作。本文介绍了使用psycopg2里的executemany、copy_from、copy_to、copy_expert等方式来批量操作 MogDB …