本文涉及知识点

C++图论

P11327 [NOISG 2022 Finals] Voting Cities

题目描述

你所在的国家的国家主席 L o r d P o o t y \bf{Lord\ Pooty} Lord Pooty 将要退休了!他希望选择他的一个儿子作为他的继承人,出于各方面因素的考虑,他决定进行一次投票!他所在的国家中共有 N N N 个国家,编号从 0 0 0 N − 1 N-1 N1,其中 K K K 个城市是可以投票的,第 i i i 个可以投票的城市编号为 T i T_i Ti

你认为,投票是你作为公民应该做的义务。于是你决定去某一个能投票的城市参与投票!所有城市之间有 E E E 条公路,第 j j j 条公路单向从城市 U j U_j Uj 通往城市 V j V_j Vj,通过这条公路需要交过路税 C j C_j Cj。幸运的是,为了更好的完成投票,国家颁布了一系列过路税优惠政策。

具体的来说,你有 5 5 5 种优惠券可以购买,使用第 x x x 种优惠券通过一条过路税为 y y y 的公路时,只需要付 y × ( 10 x ) % y \times (10x)\% y×(10x)%。但是,由于很多人都想投票,需要使用优惠券,所以每一种优惠券你最多只能买 1 1 1 张。

你是个大忙人,你既不知道从哪个城市出发,也不知道每种优惠券的价格。你现在设想了 Q Q Q 种情况,包括出发城市 S S S 和优惠券价格 P 1 , P 2 , P 3 , P 4 P_1,P_2,P_3,P_4 P1,P2,P3,P4 P 5 P_5 P5在有些情况下某些优惠券甚至已经被抢光了,你不能购买它们,此时这些无法购买的优惠券的价格将被表示为 − 1 -1 1

现在你需要分别对这 Q Q Q 种情况,输出到达某一个投票城市的最小花费。请注意,你不一定总是能通过公路到达某一个投票城市,如果不能到达,你应该输出 − 1 -1 1

输入格式

第一行,三个整数 N , E , K N,E,K N,E,K

第二行, K K K 个整数,表示 T i T_i Ti

接下来 E E E 行,每行三个整数 U j , V j , C j U_j,V_j,C_j Uj,Vj,Cj保证 C j C_j Cj 10 10 10 的倍数。

接下来一行一个整数 Q Q Q

接下来 Q Q Q 行,每行 6 6 6 个整数 S , P 1 , P 2 , P 3 , P 4 , P 5 S,P_1,P_2,P_3,P_4,P_5 S,P1,P2,P3,P4,P5

输出格式

Q Q Q 行,每行一个整数表示答案。

输入输出样例 #1

输入 #1

3 2 1
2
0 1 100
1 2 200
1
0 10 20 1000 2000 -1

输出 #1

280

输入输出样例 #2

输入 #2

2 0 1
1
1
0 -1 -1 -1 -1 -1

输出 #2

-1

输入输出样例 #3

输入 #3

6 3 2
4 5
0 4 100
1 4 200
2 5 300
4
0 -1 -1 -1 -1 -1
1 20 40 10 100 4
2 1 2 3 4 0
3 0 -1 0 0 0

输出 #3

100
104
150
-1

说明/提示

【样例 #1 解释】

该样例满足 S u b t a s k 4 , 5 , 7 , 8 \tt{Subtask\ 4,5,7,8} Subtask 4,5,7,8 的限制。

对于这种情况,最佳方案是在 1 → 2 1 \to 2 12 的道路上使用一张 2 2 2 类优惠券,在 0 → 1 0 \to 1 01 的道路上使用一张 1 1 1 类优惠券,花费为 200 × ( 1 − 2 10 ) + 100 × ( 1 − 1 10 ) % + 10 + 20 = 160 + 90 + 10 + 20 = 280 200 \times (1 - \frac{2}{10})+100 \times (1 - \frac{1}{10})\%+10+20=160+90+10+20=280 200×(1102)+100×(1101)%+10+20=160+90+10+20=280

【样例 #2 解释】

该样例满足所有 S u b t a s k \tt{Subtask} Subtask 的限制。

没有道路可以从出发城市到达一个投票城市,所以输出 − 1 -1 1

【样例 #3 解释】

该样例满足 S u b t a s k 7 , 8 \tt{Subtask\ 7,8} Subtask 7,8 的限制。


【数据范围】

S u b t a s k \tt{Subtask} Subtask分值特殊性质
1 1 1 5 5 5对于所有 i i i P i = − 1 P_i=-1 Pi=1。换句话说,没有可用的优惠券。 Q = 1 , K = 1 Q=1,K=1 Q=1,K=1
2 2 2 5 5 5对于所有 i i i P i = − 1 P_i=-1 Pi=1。换句话说,没有可用的优惠券。 K = 1 K=1 K=1
3 3 3 5 5 5对于所有 i i i P i = − 1 P_i=-1 Pi=1。换句话说,没有可用的优惠券。
4 4 4 5 5 5 Q = 1 , K = 1 Q=1,K=1 Q=1,K=1
5 5 5 5 5 5 K = 1 K=1 K=1
6 6 6 10 10 10对于每种情况,最多有 1 1 1 张优惠券可用。
7 7 7 15 15 15 1 ≤ N ≤ 100 , 1 ≤ E ≤ 1000 1 \le N \le 100,1 \le E \le 1000 1N100,1E1000
8 8 8 50 50 50

对于 100 % 100\% 100% 的数据, 1 ≤ N ≤ 5000 , 0 ≤ E ≤ 10000 , 1 ≤ Q ≤ 100 , 0 ≤ K ≤ N , 0 ≤ T i < N , 1 ≤ C i ≤ 1 0 9 , − 1 ≤ P i ≤ 1 0 9 1 \le N \le 5000,0 \le E \le 10000,1 \le Q \le 100,0 \le K \le N,0 \le T_i < N,1 \le C_i \le 10^9,-1 \le P_i \le 10^9 1N5000,0E10000,1Q100,0KN,0Ti<N,1Ci109,1Pi109,且对于所有 1 ≤ i < j ≤ K 1 \le i < j \le K 1i<jK,有 T i ≠ T j T_i \not = T_j Ti=Tj;对于所有 1 ≤ i ≤ E 1 \le i \le E 1iE,保证 C i C_i Ci 10 10 10 的倍数, 0 ≤ U i , V i < N , U i ≠ V i 0 \le U_i,V_i < N,U_i\not=V_i 0Ui,Vi<N,Ui=Vi

分层图

32层的分层图。
层内都是没有优惠的边。
第0层到第 2 i 2^i 2i层的边,边权都是按 P i + 1 P_{i+1} Pi+1优惠;
第m层,如果 m 位与 ( 1 < < i ) 不成立 m 位与(1<<i)不成立 m位与(1<<i)不成立,则有边连向 m ∣ ( 1 < < i ) m|(1<<i) m(1<<i)边权,边权都是按 P i + 1 P_{i+1} Pi+1优惠。否则无边。
性质一:任意0层到m层的路径,都包括且仅包括一条按P_{i+1}优化的边,(1<<i)&m成立$

时间复杂度

32层边数大约M= 1 0 6 10^6 106
如果每个查询都用迪氏堆优化跑最短路,则时间复杂度:O(QMlogM) 超时。

超级终点

增加一个虚拟终点 E = 32 N E=32N E=32N。所有边反向,E只向0层的T,边权为0。以E为起点求最短路。
各查询的优惠券价格不一样,如何处理?
建图时,假定价格是0。
第m层的真实价格:建图价格+ ∑ ( 1 < < i ) 位与 m ) P i + 1 的购买价格 \sum_{(1<<i)位与m)} P_{i+1}的购买价格 (1<<i)位与m)Pi+1的购买价格
时间复杂度降到 M l o g M MlogM MlogM

代码

核心代码

#include <iostream>
#include <sstream>
#include <vector>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<string>
#include<algorithm>
#include<functional>
#include<queue>
#include <stack>
#include<iomanip>
#include<numeric>
#include <math.h>
#include <climits>
#include<assert.h>
#include<cstring>
#include<list>
#include<array>#include <bitset>
#include <chrono>
using namespace std::chrono;
using namespace std;template<class T1, class T2>
std::istream& operator >> (std::istream& in, pair<T1, T2>& pr) {in >> pr.first >> pr.second;return in;
}template<class T1, class T2, class T3 >
std::istream& operator >> (std::istream& in, tuple<T1, T2, T3>& t) {in >> get<0>(t) >> get<1>(t) >> get<2>(t);return in;
}template<class T1, class T2, class T3, class T4 >
std::istream& operator >> (std::istream& in, tuple<T1, T2, T3, T4>& t) {in >> get<0>(t) >> get<1>(t) >> get<2>(t) >> get<3>(t);return in;
}template<class T1, class T2, class T3, class T4, class T5 >
std::istream& operator >> (std::istream& in, tuple<T1, T2, T3, T4, T5>& t) {in >> get<0>(t) >> get<1>(t) >> get<2>(t) >> get<3>(t) >> get<4>(t) ;return in;
}template<class T1, class T2, class T3, class T4, class T5, class T6 >
std::istream& operator >> (std::istream& in, tuple<T1, T2, T3, T4, T5, T6>& t) {in >> get<0>(t) >> get<1>(t) >> get<2>(t) >> get<3>(t) >> get<4>(t) >> get<5>(t) ;return in;
}template<class T1, class T2, class T3, class T4, class T5, class T6, class T7 >
std::istream& operator >> (std::istream& in, tuple<T1, T2, T3, T4, T5, T6, T7>& t) {in >> get<0>(t) >> get<1>(t) >> get<2>(t) >> get<3>(t) >> get<4>(t) >> get<5>(t) >> get<6>(t);return in;
}template<class T = int>
vector<T> Read() {int n;cin >> n;vector<T> ret(n);for (int i = 0; i < n; i++) {cin >> ret[i];}return ret;
}
template<class T = int>
vector<T> ReadNotNum() {vector<T> ret;T tmp;while (cin >> tmp) {ret.emplace_back(tmp);if ('\n' == cin.get()) { break; }}return ret;
}template<class T = int>
vector<T> Read(int n) {vector<T> ret(n);for (int i = 0; i < n; i++) {cin >> ret[i];}return ret;
}template<int N = 1'000'000>
class COutBuff
{
public:COutBuff() {m_p = puffer;}template<class T>void write(T x) {int num[28], sp = 0;if (x < 0)*m_p++ = '-', x = -x;if (!x)*m_p++ = 48;while (x)num[++sp] = x % 10, x /= 10;while (sp)*m_p++ = num[sp--] + 48;AuotToFile();}void writestr(const char* sz) {strcpy(m_p, sz);m_p += strlen(sz);AuotToFile();}inline void write(char ch){*m_p++ = ch;AuotToFile();}inline void ToFile() {fwrite(puffer, 1, m_p - puffer, stdout);m_p = puffer;}~COutBuff() {ToFile();}
private:inline void AuotToFile() {if (m_p - puffer > N - 100) {ToFile();}}char  puffer[N], * m_p;
};template<int N = 1'000'000>
class CInBuff
{
public:inline CInBuff() {}inline CInBuff<N>& operator>>(char& ch) {FileToBuf();while (('\r' == *S) || ('\n' == *S) || (' ' == *S)) { S++; }//忽略空格和回车ch = *S++;return *this;}inline CInBuff<N>& operator>>(int& val) {FileToBuf();int x(0), f(0);while (!isdigit(*S))f |= (*S++ == '-');while (isdigit(*S))x = (x << 1) + (x << 3) + (*S++ ^ 48);val = f ? -x : x; S++;//忽略空格换行		return *this;}inline CInBuff& operator>>(long long& val) {FileToBuf();long long x(0); int f(0);while (!isdigit(*S))f |= (*S++ == '-');while (isdigit(*S))x = (x << 1) + (x << 3) + (*S++ ^ 48);val = f ? -x : x; S++;//忽略空格换行return *this;}template<class T1, class T2>inline CInBuff& operator>>(pair<T1, T2>& val) {*this >> val.first >> val.second;return *this;}template<class T1, class T2, class T3>inline CInBuff& operator>>(tuple<T1, T2, T3>& val) {*this >> get<0>(val) >> get<1>(val) >> get<2>(val);return *this;}template<class T1, class T2, class T3, class T4>inline CInBuff& operator>>(tuple<T1, T2, T3, T4>& val) {*this >> get<0>(val) >> get<1>(val) >> get<2>(val) >> get<3>(val);return *this;}template<class T = int>inline CInBuff& operator>>(vector<T>& val) {int n;*this >> n;val.resize(n);for (int i = 0; i < n; i++) {*this >> val[i];}return *this;}template<class T = int>vector<T> Read(int n) {vector<T> ret(n);for (int i = 0; i < n; i++) {*this >> ret[i];}return ret;}template<class T = int>vector<T> Read() {vector<T> ret;*this >> ret;return ret;}
private:inline void FileToBuf() {const int canRead = m_iWritePos - (S - buffer);if (canRead >= 100) { return; }if (m_bFinish) { return; }for (int i = 0; i < canRead; i++){buffer[i] = S[i];//memcpy出错			}m_iWritePos = canRead;buffer[m_iWritePos] = 0;S = buffer;int readCnt = fread(buffer + m_iWritePos, 1, N - m_iWritePos, stdin);if (readCnt <= 0) { m_bFinish = true; return; }m_iWritePos += readCnt;buffer[m_iWritePos] = 0;S = buffer;}int m_iWritePos = 0; bool m_bFinish = false;char buffer[N + 10], * S = buffer;
};typedef pair<long long, int> PAIRLLI;
class  CHeapDis
{
public:CHeapDis(int n, long long llEmpty = LLONG_MAX / 10) :m_llEmpty(llEmpty){m_vDis.assign(n, m_llEmpty);}void Cal(int start, const vector<vector<pair<int, int>>>& vNeiB){std::priority_queue<PAIRLLI, vector<PAIRLLI>, greater<PAIRLLI>> minHeap;minHeap.emplace(0, start);while (minHeap.size()){const long long llDist = minHeap.top().first;const int iCur = minHeap.top().second;minHeap.pop();if (m_llEmpty != m_vDis[iCur]){continue;}m_vDis[iCur] = llDist;for (const auto& it : vNeiB[iCur]){minHeap.emplace(llDist + it.second, it.first);}}}vector<long long> m_vDis;const long long m_llEmpty;
};class Solution {
public:vector<long long> Ans(int N, vector<int>& T, vector<tuple<int, int, int>>& edge, vector<tuple<int, int, int, int, int, int>>& que) {//本题节点编号从0开始	const int NN = N * 32 + 1;CHeapDis dis(NN);vector <vector<pair<int, int>>> neiBo(NN);auto AddEdge = [&](int m, int m1, int p) {for (const auto& [u, v, c] : edge) {neiBo[N * m + v].emplace_back(N * m1 + u, c / 10 * (10 - p));}};for (int i = 0; i < 32; i++) {//层内边AddEdge(i, i, 0);}for (int m = 0; m < 32; m++) {//层间边for (int i = 0; i < 5; i++) {const int m1 = m | (1 << i);if (m1 == m) { continue; }AddEdge(m, m1, i + 1);}}for (const auto& i : T) {neiBo.back().emplace_back(i, 0);}dis.Cal(NN - 1, neiBo);vector<long long> ans;for (const auto& [s, p0, p1, p2, p3, p4] : que){if (dis.m_llEmpty == dis.m_vDis[s]) {ans.emplace_back(-1);continue;}vector<int> P = { p0,p1,p2,p3,p4 };long long cur = dis.m_llEmpty;for (int m = 0; m < 32; m++) {long long buy = 0;for (int j = 0; j < 5; j++) {if (m & (1 << j)) {buy += (-1 == P[j]) ? dis.m_llEmpty : P[j];}}cur = min(cur, dis.m_vDis[N * m + s] + buy);}ans.emplace_back((cur >= dis.m_llEmpty) ? -1 : cur);}return ans;}
};int main() {
#ifdef _DEBUGfreopen("a.in", "r", stdin);
#endif // DEBUG	ios::sync_with_stdio(0); cin.tie(nullptr);//CInBuff<> in; COutBuff<10'000'000> ob;int N,E,K;cin >> N >> E >> K ;vector<int> T = Read<int>(K);auto edge = Read<tuple<int, int, int>>(E);auto que = Read<tuple<int, int, int, int, int,int>>();#ifdef _DEBUG	printf("N=%d", N);Out(T, ",T=");Out(edge, ",edge=");Out(que, ",que=");
#endif // DEBUG		auto res = Solution().Ans(N,T,edge,que);for(const auto& i : res ){cout << i << "\n";}return 0;
}

单元测试

	int N;vector<int> T;vector<tuple<int, int,int>> edge;vector<tuple<int, int, int, int, int,int>> que;TEST_METHOD(TestMethod11){N = 3, T = { 2 }, edge = { {0,1,100},{1,2,200} }, que = { {0,10,20,1000,2000,-1} };auto res = Solution().Ans(N, T, edge, que);AssertV({ 280 }, res);}TEST_METHOD(TestMethod12){N = 2, T = { 1 }, edge = {}, que = { {0,-1,-1,-1,-1,-1} };auto res = Solution().Ans(N, T, edge, que);AssertV({ -1 }, res);}TEST_METHOD(TestMethod13){N = 6, T = { 4,5 }, edge = { {0,4,100},{1,4,200},{2,5,300} }, que = { {0,-1,-1,-1,-1,-1},{1,20,40,10,100,4},{2,1,2,3,4,0},{3,0,-1,0,0,0} };auto res = Solution().Ans(N, T, edge, que);AssertV({100,104,150,-1 }, res);}

扩展阅读

我想对大家说的话
工作中遇到的问题,可以按类别查阅鄙人的算法文章,请点击《算法与数据汇总》。
学习算法:按章节学习《喜缺全书算法册》,大量的题目和测试用例,打包下载。重视操作
有效学习:明确的目标 及时的反馈 拉伸区(难度合适) 专注
闻缺陷则喜(喜缺)是一个美好的愿望,早发现问题,早修改问题,给老板节约钱。
子墨子言之:事无终始,无务多业。也就是我们常说的专业的人做专业的事。
如果程序是一条龙,那算法就是他的是睛
失败+反思=成功 成功+反思=成功

视频课程

先学简单的课程,请移步CSDN学院,听白银讲师(也就是鄙人)的讲解。
https://edu.csdn.net/course/detail/38771
如何你想快速形成战斗了,为老板分忧,请学习C#入职培训、C++入职培训等课程
https://edu.csdn.net/lecturer/6176

测试环境

操作系统:win7 开发环境: VS2019 C++17
或者 操作系统:win10 开发环境: VS2022 C++17
如无特殊说明,本算法用**C++**实现。

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

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Web3云服务商安全性怎么选

Web3安全之锚&#xff1a;为何阿里云是企业级应用的首选​ 随着Web3、去中心化金融&#xff08;DeFi&#xff09;和数字资产的浪潮席卷全球&#xff0c;无数开发者和企业涌入这个充满机遇的新赛道。然而&#xff0c;机遇背后是同样巨大的安全挑战。从智能合约漏洞到大规模DDoS…

uniapp加上全局水印

文章目录 一、效果图二、创建watermark.js文件三、在main.js中引入四、运行 前言&#xff1a;uniapp页面加水印你还在傻乎乎的一个个页面加吗&#xff0c;今天教你一招&#xff0c;一步到位 一、效果图 未登录效果 登录后效果 二、创建watermark.js文件 这里的水印因为我…

thinkphp8.0七牛云直传图片

环境&#xff1a;tp8\php8.3; 服务器&#xff1a;centOS Stream 9; 场景&#xff1a;通过html页面直传七牛云服务器&#xff0c;速度更快&#xff1b; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta na…

Godot x openKylin 全国开发大赛正式启动

从2023年开始&#xff0c;Godot Hub 每年举办一次 Godot Hub Festival 开发大赛&#xff0c;现已成为国内 Godot 社区规模最大的开发比赛。本届 Godot Hub Festival 2025将与 OpenAtom openKylin 开源社区合作举办&#xff0c;定名为 Godot x openKylin 全国开发大赛&#xff0…

工控机Linux修改网口

修改Ip:sudo nmcli connection modify net1-static ipv4.addresses 192.168.200.225/24 修改dns:sudo nmcli connection modify net1-static ipv4.dns 114.114.114.114 修改网关:sudo nmcli connection modify net1-static ipv4.gateway 192.168.200.1 IP生效&#xff1a;nm…

CRMEB Pro版v3.3源码全开源+PC端+Uniapp前端+搭建教程

一.介绍 crmeb Pro版 v3.3版本正式发布&#xff0c;全新UI重磅上线&#xff0c;焕然一新&#xff0c;不负期待&#xff01;页面DIY设计功能全面升级&#xff0c;组件更丰富&#xff0c;样式设计更全面&#xff1b;移动端商家管理&#xff0c;让商城管理更便捷&#xff0c;还从…

【python】OOP:Object-Oriented Programming

文章目录 1. 面向对象编程的核心概念1.1 类与对象的关系1.2 封装&#xff08;Encapsulation&#xff09; 2. 继承与多态2.1 继承机制2.2 多重继承2.3 多态性 3. 特殊方法与运算符重载4. 抽象类与接口4.1 抽象基类 5. 组合与聚合6. 属性管理6.1 使用property装饰器6.2 描述符协议…

蒙特卡洛方法:随机抽样的艺术与科学

本文由「大千AI助手」原创发布&#xff0c;专注用真话讲AI&#xff0c;回归技术本质。拒绝神话或妖魔化。搜索「大千AI助手」关注我&#xff0c;一起撕掉过度包装&#xff0c;学习真实的AI技术&#xff01; 蒙特卡洛算法&#xff08;Monte Carlo Method&#xff09;是一类基于随…

Linux基础 -- UBI(**Unsorted Block Images**)

UBI&#xff08;Unsorted Block Images&#xff09;是 Linux 中为原始 NAND Flash 设计的一种 逻辑卷管理层&#xff0c;其核心作用是&#xff1a;在 NAND 闪存设备上提供 坏块管理、擦写均衡&#xff08;wear leveling&#xff09;和逻辑到物理地址映射等机制&#xff0c;为上…

线程相关函数

思维导图 1. 创建一个分支线程&#xff0c;在主线程中拷贝文件的前一部分&#xff0c;主线程拷贝后一部分。 2.解读代码 info1 from child process_1 info1 from parent process3.解读代码&#xff0c;-打印多少次 14次

SeaTunnel 社区月报(5-6 月):全新功能上线、Bug 大扫除、Merge 之星是谁?

在 5 月和 6 月&#xff0c;SeaTunnel 社区迎来了一轮密集更新&#xff1a;2.3.11 正式发布&#xff0c;新增对 Databend、Elasticsearch 向量、HTTP 批量写入、ClickHouse 多表写入等多个连接器能力&#xff0c;全面提升了数据同步灵活性。同时&#xff0c;近 100 个修复与优化…

数学建模_非线性规划

matlab求解调用示例 第二道例题建模 matlab求解 1.matlab只能处理min问题&#xff1a; max两边取负号变成min 2. > > >号变成 < < <&#xff1a;两边取负号 调用示例 第二道例题建模 目标函数取平方而不取绝对值 后面省略

【BurpSuite 2025最新版插件开发】基础篇7:数据的持久化存储

1 前言 历史章节&#xff1a; 【BurpSuite 2025最新版插件开发】基础篇1&#xff1a;环境搭建 【BurpSuite 2025最新版插件开发】基础篇2&#xff1a;插件生命周期与核心接口 【BurpSuite 2025最新版插件开发】基础篇3&#xff1a;请求拦截和修改简单示例 【BurpSuite 202…

GPT-4 Turbo集成智能工作流,开启自动化研究与知识管理新篇章!

目录 一、系统架构设计二、核心模块实现1. 智能数据采集引擎2. 自动化研究引擎3. 知识管理系统 三、智能工作流引擎四、关键技术实现1. 动态工作流引擎2. 知识图谱构建 五、企业级部署方案1. 云原生架构2. Docker部署脚本 六、应用案例&#xff1a;药物研发项目七、性能优化策略…

告别SQL卡顿与混乱!AI如何赋能实时计算?

在当今数据驱动的商业环境中&#xff0c;SQL作为与数据库交互的核心语言&#xff0c;其编写效率和质量直接影响着企业的数据决策速度和系统性能。然而&#xff0c;我们在长期的企业服务实践中发现&#xff0c;数据库开发人员普遍面临以下痛点&#xff1a; SQL性能问题频发&…

LeetCode算法(和中等打的有来有回)——盛最多水的容器

文章目录 leetcode第11题&#xff1a;盛最多水的容器二次循环代码 双指针优化解析代码 leetcode第11题&#xff1a;盛最多水的容器 二次循环 这道题比较容易想到的就是通过二次循环遍历所有能盛的水的体积。 代码 class Solution {public int maxArea(int[] height) {// 记录…

Karmada 多集群服务发现

一、背景介绍 多集群架构下&#xff0c;不同 Kubernetes 集群间的服务如何互通是核心挑战。Karmada 支持 Kubernetes Multi‑cluster Service APIs&#xff08;MCS&#xff09;&#xff0c;通过 ServiceExport 和 ServiceImport 实现跨集群服务发现与调用&#xff0c;帮助多集…

macOS 26正式发布,全新Liquid Glass设计语言亮相

在全球科技爱好者翘首以盼的WWDC 2025开发者大会上&#xff0c;苹果公司正式揭开了macOS 26系统的神秘面纱。此次系统更新最令人瞩目的&#xff0c;当属其采用的全新Liquid Glass设计语言&#xff0c;该设计不仅重塑了Mac的视觉风格&#xff0c;更为用户带来了一场前所未有的操…

网络基础(3)

网络基础&#xff08;3&#xff09; 有关进程 1&#xff09;进程是人在系统中的代表&#xff0c;只要把数据给进程&#xff0c;人就相当于拿到了数据 2&#xff09;数据传输到主机不是目的&#xff0c;而是手段。到达主机内部&#xff0c;再交给主机内的进程才是目的 上网的…

C语言专题:17.逻辑运算与三目运算符(按位逻辑运算、条件运算符)

​ C语言中的逻辑运算符和三目运算符&#xff08;条件运算符&#xff09;是非常常见且基础的操作符&#xff0c;它们分别用于布尔逻辑运算和简化条件判断的表达式。通过合理使用这些运算符&#xff0c;可以使代码更加简洁、清晰。本文将重点介绍逻辑运算符、三目运算符和按位逻…