2024.3.3 訓練記錄(7)

這幾天又忘記每天復習了,以后在實驗室復習完再回去好了

最近做1800的題目好多dp啊太ex了

文章目錄

  • 牛客 練習賽122D 圓
  • CF 1396B Stoned Game
  • CF 1355C Count Triangles
  • CF 1437C Chef Monocarp
  • CF 271D Good Substrings
  • CF 1475D Cleaning the Phone
  • CF 1362D2 Prefix-Suffix Palindrome (Hard version)
  • CF 722C Destroying Array

牛客 練習賽122D 圓

題目鏈接

雖然沒能自己做出來但是還是挺高興的,首先是因為用到了之前在atc碰到過然后記錄下來的一個trick,就是把圓拉成一條線,弦看作曲線來判斷有沒有交點,然后也自己想到了轉換成求區間最大的思路

剩下沒想到的點就是:要記錄下來以每個點結束的弦的起始位置,之后更新的時候會用到

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;void solve()
{int n, m;cin >> n >> m;int sum = 0;vector<vector<int>> w(n + 1, vector<int>(n + 1));vector<set<int>> eg(n + 1);for (int i = 0; i < m; i ++ ){int a, b, c;cin >> a >> b >> c;sum += c;w[min(a, b)][max(a, b)] = max(w[min(a, b)][max(a, b)], c);eg[max(a, b)].insert(min(a, b));}vector<vector<int>> dp(n + 1, vector<int>(n + 1));for (int len = 2; len <= n; len ++ ){for (int l = 1; l + len - 1 <= n; l ++ ){int r = l + len - 1;dp[l][r] = max(dp[l][r], dp[l + 1][r - 1]);dp[l][r] = max({dp[l][r], dp[l + 1][r], dp[l][r - 1], dp[l + 1][r - 1] + w[l][r]});for (auto ver : eg[r]){if (ver < l) continue;dp[l][r] = max({dp[l][r], dp[l][ver - 1] + dp[ver][r]});}}}cout << sum - dp[1][n] << '\n';
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;// cin >> t;while (t -- ){solve();}
}

CF 1396B Stoned Game

題目鏈接

感覺沒有1800 虛高了

優先隊列模擬一下,每次取能取的最多的就可以

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;void solve()
{int n;cin >> n;vector<int> a(n);priority_queue<PII> q;for (int i = 0; i < n; i ++ ){cin >> a[i];q.push({a[i], i});}int idx1 = -1, idx2 = -1;bool flag = true; // true表示T的回合 反之while (q.size()){auto t = q.top();q.pop();if (flag){if (t.second == idx2){if (q.size() == 0){cout << "HL\n";return;}auto tt = q.top();q.pop();q.push(t);idx1 = tt.second;tt.first -- ;if (tt.first != 0) q.push(tt);}else{t.first -- ;idx1 = t.second;if (t.first != 0) q.push(t);}flag = false;}else{if (t.second == idx1){if (q.size() == 0){cout << "T\n";return;}auto tt = q.top();q.pop();q.push(t);idx2 = tt.second;tt.first -- ;if (tt.first != 0) q.push(tt);}else{t.first -- ;idx2 = t.second;if (t.first != 0) q.push(t);}flag = true;}}if (flag) cout << "HL\n";else cout << "T\n";
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;cin >> t;while (t -- ){solve();}
}

CF 1355C Count Triangles

題目鏈接

組合數學

枚舉x+y的值,因為x最小是a,y最小是b,所以x+y最小是a+b,同時z最小是c,所以x+y最小要是c+1,因此x+y的最小值為max(a+b, c+1),最大值是c+b

現在x+y=i,有多少符合條件的z呢?z的最大值是d和 i - d 里小的那個,最小值是c,所以z有min(i - 1, d) - c + 1種情況

再看對于每個y有多少個符合條件的x呢?

y的取值范圍是bc之間,所以x的取值范圍是[i-c, i-b],同時x還有[a,b]的限制,于是x的取值情況min(i - b, b) - max(i - c, a) + 1

乘法原理

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;void solve()
{int a, b, c, d;cin >> a >> b >> c >> d;int ans = 0;for (int i = max(a + b, c + 1); i <= c + b; i ++ ) // 枚舉x+y{ans += (min(i - 1, d) - c + 1) * (min(i - b, b) - max(i - c, a) + 1);}cout << ans << '\n';
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;// cin >> t;while (t -- ){solve();}
}

CF 1437C Chef Monocarp

題目鏈接

dp

dp[i][j] 表示第 i 盤菜在第 j 時間拿出來的最小值

轉移方程:dp[i][j] = min(dp[i][j - 1], dp[i - 1][j - 1] + abs(t[i] - j))

(dp真的好難想到啊…

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;void solve()
{int n;cin >> n;vector<int> t(n + 1);for (int i = 1; i <= n; i ++ ) cin >> t[i];sort(t.begin(), t.end());vector<vector<int>> dp(n + 1, vector<int>(2 * n + 1, INF));for (int i = 0; i <= 2 * n; i ++ ) dp[0][i] = 0;for (int i = 1; i <= n; i ++ ){for (int j = 1; j <= n * 2; j ++ ){dp[i][j] = min(dp[i][j - 1], dp[i - 1][j - 1] + abs(t[i] - j));}}int ans = INF;for (int i = 1; i <= n * 2; i ++ ) ans = min(ans, dp[n][i]);cout << ans << '\n';
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;cin >> t;while (t -- ){solve();}
}

CF 271D Good Substrings

題目鏈接

第一次寫出來1800的字符串!

一開始想單純枚舉左右端點利用前綴和,再放到set里判斷,但是substr的復雜度肯定就爆了

然后想到trie樹,枚舉每個位置為開頭,把從該位置一直到末尾的字符串存進trie樹就可以啦,然后在每個符合條件的地方都打上標記,最后dfs一下整個樹,記錄ans

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 2e6 + 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;int k;
map<char, bool> mp;
int nxt[N][26], cnt;
bool st[N]; // 該結點結尾的字符串是否存在
int num[N];
int ans = 0;
void insert(string s, int l) // 插入字符串,l是字符串長度
{ int p = 0;for (int i = 0; i < l; i++){int c = s[i] - 'a';if (!nxt[p][c]) nxt[p][c] = ++ cnt; // 如果沒有,就添加結點if (!mp[s[i]]) num[nxt[p][c]] = num[p] + 1;else num[nxt[p][c]] = num[p];p = nxt[p][c];if (num[p] <= k) st[p] = true;}
}void dfs(int u)
{if (st[u]) ans ++ ;for (int i = 0; i < 26; i ++ ){if (!nxt[u][i]) continue;dfs(nxt[u][i]);}
}void solve()
{string s;cin >> s;for (int i = 0; i < 26; i ++ ){char c;cin >> c;if (c == '1') mp[(char)(i + 'a')] = true;else mp[(char)(i + 'a')] = false;}cin >> k;for (int i = 0; i < s.size(); i ++ ){string ns = s.substr(i, s.size() - i);insert(ns, s.size() - i);}dfs(0);cout << ans << '\n';
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;// cin >> t;while (t -- ){solve();}
}

CF 1475D Cleaning the Phone

題目鏈接

因為看到b只可能為1/2,所以肯定是有啥特殊的地方

于是想到把b為1和2的分開算,每次枚舉在b為1的集合中取了幾個(肯定是從大到小取),二分查找b為2的集合中需要取幾個,更新答案就好啦

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 2e6 + 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;void solve()
{int n, m;cin >> n >> m;vector<int> a(n + 1), b(n + 1);for (int i = 1; i <= n; i ++ ) cin >> a[i];for (int i = 1; i <= n; i ++ ) cin >> b[i];vector<int> c1, c2;c1.push_back(0), c2.push_back(0);for (int i = 1; i <= n; i ++ ){if (b[i] == 1) c1.push_back(a[i]);else c2.push_back(a[i]);}sort(c1.begin() + 1, c1.end(), greater<int>());sort(c2.begin() + 1, c2.end(), greater<int>());vector<int> pre1(c1.size()), pre2(c2.size());for (int i = 1; i < c1.size(); i ++ ) pre1[i] = pre1[i - 1] + c1[i];for (int i = 1; i < c2.size(); i ++ ) pre2[i] = pre2[i - 1] + c2[i];int ans = INF;for (int i = 0; i < c1.size(); i ++ ){int save = m - pre1[i];int pos = lower_bound(pre2.begin(), pre2.end(), save) - pre2.begin();if (pos == c2.size()) continue;ans = min(ans, pos * 2 + i);}if (ans == INF) ans = -1;cout << ans << '\n';
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;cin >> t;while (t -- ){solve();}
}

CF 1362D2 Prefix-Suffix Palindrome (Hard version)

題目鏈接

今天學到的新算法:Manacher馬拉車算法

這一題只需要先判斷原字符串的前綴和后綴有多少對稱的,如果完全對稱直接輸出原字符串,如果還有剩下的不對稱,就求剩下的部分中最長前綴/后綴回文子串(哪個長要哪個),套個板子就可以

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 2e6 + 10;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;int flag;string Manacher(string s)
{int sl = s.size(); // 原字符串長度if (sl == 0 || sl == 1) return s;// 構建新串string ns = "$#";for (int i = 0; i < sl; i ++ ){ns += s[i];ns += '#';}int len = ns.size();int c = 0; // 最靠右的回文子串的中心點下標int m = 0; // 最靠右的回文子串的右端點下標int pos = 0; // 最長回文子串的中心點int maxlen = 0; // 最長回文子串的半徑(不包括中心點)(新字符串中)vector<int> p(len); // p[i]表示以i為中心點的回文子串的半徑(包括i)for (int i = 1; i < len; i ++ ){if (i < m) p[i] = min(p[c - (i - c)], m - i + 1); // c-(i-c)是i關于c的對稱點 當前情況表示i在目前最靠右側的回文子串中else p[i] = 1 + (ns[i] != '#'); // 當前不是#的話 其兩側就是# 所以半徑可以加1if (i - p[i] >= 0 && i + p[i] < ns.size())while (ns[i - p[i]] == ns[i + p[i]]) p[i] ++ ; // 對半成品的i位置進行中心擴散if (i + p[i] - 1 > m) // 產生了比以c為中心時更靠右的回文子串{c = i;m = i + p[i] - 1;}if (p[i] == i && maxlen < p[i]){maxlen = p[i] - 1;pos = i;// flag = 1;}if (p[i] + i == len && maxlen < p[i]){maxlen = p[i] - 1;pos = i;// flag = 2;}}string ans = "";char tmp;for (int i = 0; i < 2 * maxlen * 1; i ++ ) // 遍歷最長字串的每個位置 得出原字符串中的最長字串{tmp = ns[pos - (maxlen - 1) + i];if (tmp != '#') ans += tmp;}return ans;
}void solve()
{string s;cin >> s;int idx1 = 0, idx2 = s.size() - 1;while (idx1 < idx2){if (s[idx1] != s[idx2]) break;idx1 ++ , idx2 -- ;}if (s[idx1] != s[idx2]){string ss = s.substr(idx1, idx2 - idx1 + 1);string ans = Manacher(ss);string tmp1 = s.substr(0, idx1), tmp2 = s.substr(idx2 + 1, s.size() - idx2 - 1);ans = tmp1 + ans + tmp2;cout << ans << '\n';}else cout << s << '\n';
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;cin >> t;while (t -- ){solve();}
}

CF 722C Destroying Array

題目鏈接

沒腦子了,用線段樹寫的,寫完一搜題解原來是并查集

#include <bits/stdc++.h>using namespace std;#define int long long
using i64 = long long;typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, PII> PIII;const int N = 100010;
const int mod = 998244353;
const int maxn = 1e6 + 10;
const int mod1 = 954169327;
const int mod2 = 906097321;
const int INF = 0x3f3f3f3f3f3f3f3f;int a[N];struct Node
{int l, r;int maxx, maxl, maxr, sum;
} tr[N * 4];void pushup(Node& u, Node& l, Node& r)
{u.l = l.l, u.r = r.r;u.maxl = l.maxl;if (l.maxl == l.sum && r.maxl > 0) u.maxl += r.maxl;u.maxl = max(-INF, u.maxl);u.maxr = r.maxr;if (r.sum == r.maxr && l.maxr > 0) u.maxr += l.maxr;u.maxr = max(-INF, u.maxr);u.maxx = max({l.maxx, r.maxx, l.maxr + r.maxl, -INF});u.sum = l.sum + r.sum;
}void pushup(int u)
{pushup(tr[u], tr[u << 1], tr[u << 1 | 1]);
}void build(int u, int l, int r)
{tr[u] = {l, r};if (l == r){tr[u].maxx = tr[u].maxl = tr[u].maxr = tr[u].sum = a[l];return;}int mid = l + r >> 1;build(u << 1, l, mid);build(u << 1 | 1, mid + 1, r);pushup(u);
}void modify(int u, int pos, int x)
{if (tr[u].l == pos && tr[u].r == pos){tr[u].maxx = tr[u].maxl = tr[u].maxr = x;return;}int mid = tr[u].l + tr[u].r >> 1;if (pos <= mid) modify(u << 1, pos, x);else modify(u << 1 | 1, pos, x);pushup(u);
}void solve()
{int n;cin >> n;for (int i = 1; i <= n; i ++ ) cin >> a[i];build(1, 1, n);for (int i = 0; i < n; i ++ ){int pos;cin >> pos;modify(1, pos, -INF);cout << max((i64)0, tr[1].maxx) << '\n';}
}signed main()
{ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t = 1;// cin >> t;while (t -- ){solve();}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/719817.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/719817.shtml
英文地址,請注明出處:http://en.pswp.cn/news/719817.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

“羊駝“入侵CV,美團浙大沈春華團隊將LLaMA向CV擴展,構建全新基礎模型VisionLLaMA

本文首發:AIWalker https://arxiv.org/abs/2403.00522 https://github.com/Meituan-AutoML/VisionLLaMA 本文概述 大型語言模型構建在基于Transformer的架構之上來處理文本輸入, LLaMA 系列模型在眾多開源實現中脫穎而出。類似LLaMa的Transformer可以用來處理2D圖像嗎&#xf…

Python繪制不同形狀詞云圖

目錄 1.基本詞云圖1.1 導入所需庫1.2 準備詞匯1.3 配置參數并生成詞云圖1.4 在Python窗口中顯示圖片1.5 效果展示1.6 完整代碼 2. 不同形狀詞云圖2.1 找到自己所需形狀圖片2.2 利用PS將圖片設置為黑白色2.3 在代碼中設置背景2.4 效果展示 1.基本詞云圖 1.1 導入所需庫 import…

遠程調用--webClient

遠程調用webClient 前言1、創建webClient2、準備數據3、執行請求4、接收返回響應到的數據整體代碼 前言 非阻塞、響應式HTTP客戶端 1、創建webClient WebClient client WebClient.create();2、準備數據 Map<String,String> params new HashMap<>();params.pu…

貪心算法(區間問題)

452. 用最少數量的箭引爆氣球 題目(求無重復區間) 有一些球形氣球貼在一堵用 XY 平面表示的墻面上。墻面上的氣球記錄在整數數組 points &#xff0c;其中points[i] [xstart, xend] 表示水平直徑在 xstart 和 xend之間的氣球。你不知道氣球的確切 y 坐標。 一支弓箭可以沿著…

利用Python爬取8684公交路線查詢網站中全國公交站點信息

利用python語言結合requests、BeautifulSoup等類庫爬取https://api.8684.cn/v3/api.php?docitys&actprovince對應接口中所有城市公交路線信息以及公交站點信息。 import time import requests import json, re from bs4 import BeautifulSoup# 定義一個函數&#xff0c;傳…

“祖傳代碼“的是是非非

程序員眼中的“祖傳代碼”&#xff0c;就像一本古老而神秘的魔法書&#xff0c;藏著無窮的智慧和技巧&#xff0c;有些代碼像家傳寶貝&#xff0c;有些像祖傳秘方。快來分享一下你遇到的“祖傳代碼”吧~ 祖傳代碼的歷史與文化價值 祖傳代碼通常指的是經過長時間使用和傳承的代…

【DUSt3R】2張圖2秒鐘3D重建

【DUSt3R】2張圖2秒鐘3D重建 1. DUSt3R是一種用于稠密和無約束立體三維重建的方法,其實現步驟如下:2. 實際運行效果3. 運行結果4. 自問自答4.1 為社么這里要是使用transform模型呢?4.2 CroCo(通過跨視圖完成3D視覺任務的自我監督預訓練的一個研究)在DUSt3R的作用是什么,為…

打家劫舍(java版)

&#x1f4d1;前言 本文主要是【動態規劃】——打家劫舍(java版)的文章&#xff0c;如果有什么需要改進的地方還請大佬指出?? &#x1f3ac;作者簡介&#xff1a;大家好&#xff0c;我是聽風與他&#x1f947; ??博客首頁&#xff1a;CSDN主頁聽風與他 &#x1f304;每日一…

17 easy 290. 單詞規律

//給定一種規律 pattern 和一個字符串 s &#xff0c;判斷 s 是否遵循相同的規律。 // // 這里的 遵循 指完全匹配&#xff0c;例如&#xff0c; pattern 里的每個字母和字符串 s 中的每個非空單詞之間存在著雙向連接的對應規律。 // // // // 示例1: // // //輸入: patte…

24計算機考研調劑 | 西安工大

西安工大 考研調劑招生信息 學校:西安工大 專業:- 年級:2024 招生人數:4 招生狀態:正在招生中 聯系方式:********* (為保護個人隱私,聯系方式僅限APP查看) 補充內容 歡迎化工、材料、環工等專業[或有計算機相關專業&#xff08;智能科學和軟件工程方向&#xff09;、機…

一款不錯的多端SSH工具:Xterminal

1、不僅是強大的SSH工具&#xff0c;更提供本地控制臺&#xff0c;以及更多即將推出的開發相關功能&#xff0c;讓您專注于創造卓越的代碼 2、AI賦能&#xff0c;智能命令提示&#xff0c;為大腦解壓 AI解答&#xff0c;讓你的疑問得到即時解答 AI智能提示&#xff0c;讓每一…

CodeFlying 和 aixcoder兩大免費軟開平臺,孰強孰弱?

今天為大家帶來碼上飛CodeFlying和aixcoder兩款免費的軟件開發平臺效果的測評 一、產品介紹 首先簡單介紹一下這兩個平臺 碼上飛CodeFlying&#xff1a;碼上飛 CodeFlying | AI 智能軟件開發平臺&#xff01; 是一款革命性的軟件開發平臺&#xff0c;它通過將軟件工程和大模…

Redis是AP的還是CP的?

redis是一個開源的內存數據庫&#xff0c;那么他到底是AP的還是CP的呢&#xff1f; 有人說&#xff1a;單機的是redis是cp的&#xff0c;而集群的redis是ap的&#xff1f; 但是我不這么認為&#xff0c;我覺得redis就是ap的&#xff0c;雖然在單機redis中&#xff0c;因為只有…

Git 基本操作 ?作區、暫存區、版本庫

創建本地倉庫&#xff1a; 創建 Git 本地倉庫 要提前說的是&#xff0c;倉庫是進行版本控制的?個文件目錄。我們要想對文件進行版本控制&#xff0c;就必須先創建?個倉庫出來。 首先touch 一個文件&#xff1a; 初始化倉庫&#xff1a; 創建完成后&#xff0c;我們會發現當前…

行列式錯題本

《1800》 1 階數和轉置 A是三階,B是4階,還有2這個系數 2 怎么啥也不會呀,委屈 行列式的拆分+提取系數 3

uniapp 安裝安卓、IOS模擬器并調試

一、安裝Android模擬器并調試 1.下載并安裝Android Studio。 2.創建簡單project。 3.安裝模擬器。 完成安卓模擬器的安裝。 4.啟動模擬器。 5.hbuilderx選擇模擬器、運行。 點擊刷新按鈕后出現模擬器&#xff0c;勾選并運行。 6.調試。 在 HBuilderX 中&#xff0c;項目啟…

每天一道leetcode:20.有效的括號(簡單;棧的經典題目)

?今日份題目 給定一個只包括 (&#xff0c;)&#xff0c;{&#xff0c;}&#xff0c;[&#xff0c;] 的字符串 s &#xff0c;判斷字符串是否有效。 有效字符串需滿足&#xff1a; 左括號必須用相同類型的右括號閉合。 左括號必須以正確的順序閉合。 每個右括號都有一個對…

Nano 33 BLE Sense Rev2學習第一節——環境配置

參考文檔見Access Barometric Pressure Sensor Data on Nano 33 BLE Sense | Arduino Documentation 打開Arduino ide安裝開發板 選擇開發板 連接開發板到電腦&#xff0c;自動識別開發板端口&#xff0c;選擇端口

Python-類型檢查:typing模塊和mypy工具

Python-類型檢查&#xff1a;typing模塊和mypy工具 >>返回Python系列文章目錄<< 文章鏈接: Python中typing模塊 文章鏈接: PyCharm集成類型檢查mypy

ssh 一次執行多條命令(后臺運行)

文章目錄 1. 背景2. 命令2.1 命令分隔符2.2 多行腳本2.3 單行腳本 3. SSH 任務后臺運行 1. 背景 有時我們只需要遠程執行一次任務然后就關閉&#xff0c;而不需要長時間 ssh 登錄到遠程服務器。同時一次任務可能需要執行多條命令&#xff0c;那么我們該如何做呢&#xff1f; …