当前位置: 首页 > news >正文

今日codeforces刷题(1)

一、前言

新栏目,每隔几天就保质保量地刷个10道codeforces题左右的样子

筛选1200-1500难度的题,然后按通过题目的人数降序排列的前10题

二、题目总览

三、具体题目

3.1 25A. IQ test

我的代码

看奇数出现的次数为1还是偶数出现的次数为1,然后输出与其他数奇偶性不同的数的下标

// Problem: A. IQ test
// Contest: Codeforces - Codeforces Beta Round 25 (Div. 2 Only)
// URL: https://codeforces.com/problemset/problem/25/A
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){int n;std::cin >> n;std::vector<int> v;int cnt0 = 0,cnt1 = 0;for(int i = 0;i<n;++i){int num;std::cin >> num;v.emplace_back(num);if(num&1) ++cnt1;else ++cnt0;}if(cnt1==1){for(int i = 0;i<n;++i){if(v[i]&1){std::cout << i+1 << '\n';break;}}}if(cnt0==1){for(int i = 0;i<n;++i){if((v[i]&1)==0){std::cout << i+1 << '\n';break;}}}
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.2 4C. Registration system

我的代码

注意不能无脑用std::unordered_set<std::string>来做,会超时;没有出现过的字符串,给cnt数组初始化为0,出现过的字符串根据它出现过的次数来设置cnt

// Problem: C. Registration system
// Contest: Codeforces - Codeforces Beta Round 4 (Div. 2 Only)
// URL: https://codeforces.com/problemset/problem/4/C
// Memory Limit: 64 MB
// Time Limit: 5000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){int n;std::cin >> n;std::set<std::string> set;std::unordered_map<std::string,int> map;int idx = 1;std::vector<int> cnt(N,0);for(int i = 0;i<n;++i){std::string s;std::cin >> s;if(set.find(s)==set.end()){set.insert(s);map[s] = idx++;cnt[map[s]];std::cout << "OK\n";}else{int cur = cnt[map[s]];std::string tmp = s+std::to_string(++cnt[map[s]]);std::cout << tmp << '\n';}}
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.3 230B. T-primes

我的代码

预处理出所有满足条件的数放进数组ans中,对于每组数据,如果可以使用二分查找到ans中相同的值,那么就输出YES否则输出NO。判断T-prime的方法:先使用欧拉筛 筛出所有1~1e6的所有素数,那么这些素数的平方都是T-prime。因为我们发现只有素数的平方才会是一个T-prime,因为xi最大为1e12,因此我们需要筛出1e6的所有素数。欧拉筛当然用了jiangly鸽鸽的模板。不用二分极有可能超时,不过我没试过

// Problem: B. T-primes
// Contest: Codeforces - Codeforces Round 142 (Div. 2)
// URL: https://codeforces.com/problemset/problem/230/B
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;std::vector<int> minp, primes;void sieve(int n) {minp.assign(n + 1, 0);primes.clear();for (int i = 2; i <= n; i++) {if (minp[i] == 0) {minp[i] = i;primes.push_back(i);}for (auto p : primes) {if (i * p > n) {break;}minp[i * p] = p;if (p == minp[i]) {break;}}}
}bool isprime(int n) {return minp[n] == n;
}std::vector<i64> ans;
void pre(){for(i64 i = 1;i<=1000000;++i){if(isprime(i)){ans.emplace_back(i*i);}}
}void solve(){int n;i64 num;std::cin >> n;for(int i = 0;i<n;++i){std::cin >> num;if(*std::lower_bound(ans.begin(),ans.end(),num)==num){std::cout << "YES" << '\n';}else{std::cout << "NO" << '\n';}}
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);sieve(1000010);pre();int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.4 492B. Vanya and Lanterns

我的代码

先对a数组排序,然后我们发现只需要找到a[0]-0、(a[1]-a[0])/2、(a[2]-a[1])/2、...、(a[n-1]-a[n-2])/2、l-a[n-1]中的最大值即可,注意中间除以2的时候记得强转成double

// Problem: B. Vanya and Lanterns
// Contest: Codeforces - Codeforces Round 280 (Div. 2)
// URL: https://codeforces.com/problemset/problem/492/B
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;
int n,l;
void solve(){std::cin >> n >> l;std::vector<int> v;for(int i = 0;i<n;++i){int num;std::cin >> num;v.emplace_back(num);}std::sort(v.begin(),v.end());double max_diff = 0;int max_idx = -1;if(1.0*v[0]>max_diff){max_diff = v[0];max_idx = 0;}for(int i = 0;i<n-1;++i){if(1.0*(v[i+1]-v[i])/2>max_diff){max_diff = 1.0*(v[i+1]-v[i])/2;max_idx = i+1;}}if(1.0*(l-v[n-1])>max_diff){max_diff = 1.0*(l-v[n-1]);max_idx = n;}std::cout << std::fixed << std::setprecision(12) << max_diff << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.5 189A. Cut Ribbon

我的代码1

暴力枚举剪了i个a和j个b的情况,最后剪了多少个c可以用O(1)的时间复杂度间接算出来,那么最终的时间复杂度是O(n^2),不会超时

// Problem: A. Cut Ribbon
// Contest: Codeforces - Codeforces Round 119 (Div. 2)
// URL: https://codeforces.com/problemset/problem/189/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){i64 n,a,b,c;std::cin >> n >> a >> b >> c;i64 ans = 0;for(i64 i = 0;i<=4000;++i){//剪出i个aif(i*a>n) break;for(i64 j = 0;j<=4000;++j){//剪出j个b那么剩余(n-i*a-j*b)/c个cif(i*a+j*b>n) break;i64 rest = n-i*a-j*b;if(rest%c==0){ans = std::max(ans,i+j+(rest/c));} }}std::cout << ans << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

我的代码2

完全背包实现,我写这题的时候,第一想法居然还是暴力枚举

// Problem: A. Cut Ribbon
// Contest: Codeforces - Codeforces Round 119 (Div. 2)
// URL: https://codeforces.com/problemset/problem/189/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){i64 n;std::array<i64,5> a;std::cin >> n >> a[1] >> a[2] >> a[3];std::vector<i64> dp(4e3+5,-INF);dp[0] = 0;for(int i = 1;i<=3;++i){for(int j = a[i];j<=n;++j){dp[j] = std::max(dp[j],dp[j-a[i]]+1);}}std::cout << dp[n] << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.6 466A. Cheap Travel

我的代码

没啥好说的,模拟题,我直接暴力枚举了

// Problem: A. Cheap Travel
// Contest: Codeforces - Codeforces Round 266 (Div. 2)
// URL: https://codeforces.com/problemset/problem/466/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){i64 n,m,a,b;std::cin >> n >> m >> a >> b;i64 ans = INF;// ans = std::min(ans,a*n);for(int i = 0;i<=n;++i){ans = std::min(ans,i*b+(n-std::min(n,m*i))*a);}std::cout << ans << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.7 455A. Boredom

我的代码

应该是这10道题里最难的题了

线性dp,dp[i]存的是考虑了前i个数字,可以获得的最高分数。dp[i]可以从dp[i-1]和dp[i-2]转移,具体要看选不选i-1这个数字(注意不是下标),如果不选,则dp[i] = dp[i-2]+i*cnt(i);如果选,那么dp[i] = dp[i-1]。注意数据范围,需要开long long

// Problem: A. Boredom
// Contest: Codeforces - Codeforces Round 260 (Div. 1)
// URL: https://codeforces.com/problemset/problem/455/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){int n;std::cin >> n;std::map<i64,i64> mp;std::vector<i64> a(N,0);i64 max = 0;for(i64 i = 1;i<=n;++i){std::cin >> a[i];++mp[a[i]];max = std::max(max,a[i]);}std::vector<i64> dp(max+5,0);dp[1]=mp[1];for(i64 i = 2;i<=max;++i){dp[i] = std::max(dp[i-1],dp[i-2]+mp[i]*i);}std::cout << dp[max] << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.8 1352C. K-th Not Divisible by n

我的代码

简单的思维题,见代码

// Problem: C. K-th Not Divisible by n
// Contest: Codeforces - Codeforces Round 640 (Div. 4)
// URL: https://codeforces.com/problemset/problem/1352/C
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){i64 n,k;std::cin >> n >> k;if(k%(n-1)!=0){i64 cnt = k/(n-1);i64 ans = cnt*n+(k-cnt*(n-1));std::cout << ans << '\n';}else{i64 ans = k/(n-1)*n-1;std::cout << ans << '\n';}}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.9 279B. Books

我的代码

双指针的题,我用双端队列实现的(普通队列就可以了),是同样的道理,因为是连续的,所以,能看几本书就先看几本书,如果第一次出现t时间内看不完某一本书,那么也先把它加进队尾,然后一直弹出队头,直到当前所用的时间小于等于t,然后比较队列大小

// Problem: B. Books
// Contest: Codeforces - Codeforces Round 171 (Div. 2)
// URL: https://codeforces.com/problemset/problem/279/B
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){i64 n,t;std::cin >> n >> t;std::vector<i64> a(n+5,0);for(int i = 1;i<=n;++i) std::cin >> a[i];std::deque<i64> deq;i64 sum=0,ans=0;for(int i = 1;i<=n;++i){sum+=a[i];deq.emplace_back(a[i]);while(sum>t&&!deq.empty()){sum-=deq.front();deq.pop_front();}ans = std::max(ans,i64(deq.size()));}std::cout << ans << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

3.10 514A. Chewbaсca and Number

我的代码1

dfs暴搜,每一位都有换和不换两种状态。注意特殊情况,一个要求答案为正数(0不是正数),一个答案要跟原数位数一致(WA好多次后去看了后台测试点才发现的)。至于时间复杂度,dfs递归的时间复杂度是O(2^len(n))即最坏是2^18的数量级,dfs每次结束前还需要O(len(n))的时间复杂度处理字符串,因此最终的时间复杂度为O(len(n)*2^len(n))约等于18*(2^18)约等于5e7的数量级,不会超时

// Problem: A. Chewbaсca and Number
// Contest: Codeforces - Codeforces Round 291 (Div. 2)
// URL: https://codeforces.com/problemset/problem/514/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;
i64 ans = 1e18+7;
i64 len;
std::string num;
std::vector<int> a(25,0);
void dfs(int u){if(u==len+1){std::string s;for(int i = 0;i<len;++i){if(a[i+1]){s+=char('9'-num[i]+'0');}else{s+=num[i];}}if(s[0]=='0') return;if(std::stoll(s)==0LL) return;ans = std::min(ans,std::stoll(s));return;}a[u] = 0;dfs(u+1);a[u] = 1;dfs(u+1);
}void solve(){std::cin >> num;len = num.size();ans = std::stoll(num);dfs(1);std::cout << ans << '\n';
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

我的代码2

贪心模拟,如果第一位反转后是'0',那么就不反转,对于后面的数字,如果反转变得更小那么就反转,否则不反转。再特判这个数反转后是0的情况,直接输出9,因为只有9反转后是0,且0不是正数

// Problem: A. Chewbaсca and Number
// Contest: Codeforces - Codeforces Round 291 (Div. 2)
// URL: https://codeforces.com/problemset/problem/514/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int,int>;
constexpr int N = 1e5+5,M = 1e6+5,INF = 0x3f3f3f3f;void solve(){std::string s;std::cin >> s;for(int i = 0;i<s.size();++i){if(i==0&&s[i]=='9') continue;if(s[i]>='5'){s[i] = '0'+('9'-s[i]);}}i64 ans = std::stoll(s);if(ans==0LL){char c = s[s.size()-1];c = '9';std::cout << c << '\n';}else{std::cout << std::stoll(s) << '\n';}
}
int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t = 1;// std::cin >> t;for(int ti = 0;ti<t;++ti) {solve();}return 0;
}

相关文章:

今日codeforces刷题(1)

一、前言 新栏目&#xff0c;每隔几天就保质保量地刷个10道codeforces题左右的样子 筛选1200-1500难度的题&#xff0c;然后按通过题目的人数降序排列的前10题 二、题目总览 三、具体题目 3.1 25A. IQ test 我的代码 看奇数出现的次数为1还是偶数出现的次数为1&#xff0c…...

【C++算法】20.二分查找算法_x 的平方根

文章目录 题目链接&#xff1a;题目描述&#xff1a;解法C 算法代码&#xff1a;图解 题目链接&#xff1a; 69. x 的平方根 题目描述&#xff1a; 解法 暴力解法&#xff1a; 如果x17 从1&#xff0c;2&#xff0c;3&#xff0c;4&#xff0c;5......这些数里面找他们的平方…...

图像显示的是矩阵的行和列,修改为坐标范围。

x 3; y 3; f1x x^2 y^2; guance1 f1x; F (x, y) sqrt((x.^2 y.^2 - guance1).^2); % 使用点乘 [x, y] meshgrid(0:1:5, 0:1:5); Z F(x, y); figure; imagesc(Z); % 由于 imagesc 使用矩阵索引作为坐标&#xff0c;我们需要手动添加刻度 % 这里我们假设 x 和 y 的范围…...

通义灵码走进北京大学创新课堂丨阿里云云原生 10 月产品月报

云原生月度动态 云原生是企业数字创新的最短路径。 《阿里云云原生每月动态》&#xff0c;从趋势热点、产品新功能、服务客户、开源与开发者动态等方面&#xff0c;为企业提供数字化的路径与指南。 趋势热点 &#x1f947; 通义灵码走进北京大学创新课堂&#xff0c;与 400…...

LeetCode Hot100 1~10

目录 哈希1. 两数之和2. 字母异位词分组3. 最长连续子序列 双指针4. 移动零5. 盛最多水的容器6. 三数之和7. 接雨水 子串8. 无重复字符的最长子串9. 找到字符中所有字母的异位词10. 和为K的子数组 哈希 1. 两数之和 利用哈希表找出当前数字还差多少 看看差值时候在哈希表中即…...

npm 最新国内淘宝镜像地址源 (旧版已不能用)

注意&#xff1a;原域名https://registry.npm.taobao.org/ 在 2022.06.30 号正式下线和停止 DNS 解析 最新地址&#xff1a; #最新地址 淘宝 NPM 镜像站喊你切换新域名啦! npm config set registry https://registry.npmmirror.com 查看镜像使用状态 npm config get registr…...

DepthAI 2.29版本 发布

2024年11月29日 增加在设备运行时使用新的 dai::Device.setCalibration() 更改设备校准能力的方法&#xff0c;并使用 dai::Device.getCalibration() 进行检索校准 1&#x1f343; 新的立体深度预设属性&#xff1a; 预设 面部 高细节 机器人 2&#x1f343; 多项摄像…...

C#反序列化XML时提示XML 文档(1, 1)中有错误

最近在反序列化一个XML时&#xff0c;遇到了如下报错&#xff1a; XML 文档(1, 1)中有错误。 内部异常 XmlException: 根级别上的数据无效。 第 1 行&#xff0c;位置 1。 看描述应该是XML格式的问题&#xff0c;我把XML复制到新建的控制台程序&#xff0c;反序列化又是可以的…...

C# 中的接口:定义行为契约与实现多态性

C#中的接口&#xff08;Interfaces&#xff09;。接口是C#中一个非常重要的特性&#xff0c;它允许定义类型的行为契约&#xff0c;而不指定具体实现。通过接口&#xff0c;可以实现多态性、代码的灵活性和可扩展性。以下是一篇关于C#中接口的文章。 引言 接口&#xff08;Int…...

Redis的基础知识·

Redis是一个基于内存的key-value的结构数据库 基于内存存储 读写性能高适合存储热点数据&#xff08;热点商品 咨询 新闻&#xff09; 开启Redis 首先输入命令 redis-server.exe redis.windows.conf 然后重新打开命令行窗口 输入命令 redis-cli.exe 输入密码 …...

qt QProxyStyle详解

1、概述 QProxyStyle是Qt框架中QStyle类的一个子类&#xff0c;它提供了一种代理机制&#xff0c;允许开发者在不直接修改现有样式&#xff08;QStyle&#xff09;实现的情况下&#xff0c;对样式行为进行定制或扩展。通过继承QProxyStyle&#xff0c;开发者可以重写其虚方法&…...

AWS CLI 操作指南

AWS CLI 操作指南 世间本来就存在许多乐境&#xff0c;只是现代人为世间所累而未能予以关注&#xff0c;也就失去了许多体验乐境的机会。比如&#xff0c;忙里偷闲看云&#xff0c;以悠闲的心看悠闲的云&#xff0c;便是一种极妙的乐境。 本文将介绍如何配置 AWS CLI&#xff0…...

海盗王用golang重写的AccountServer功能

自从用golang重写了海盗王的网关gateserver以来&#xff0c;一直想把accountserver也重写了&#xff0c;但是一直没有进行。 趁上次刚写好那个golang版的更新器&#xff0c;还有些熟悉&#xff0c;于是把原来AccountServer的C代码重写读了个大概。它原版的写得太过于复杂&#…...

如何保证spring boot应用程序的安全性?

保证Spring Boot应用程序的安全性是至关重要的&#xff0c;以下是小编为大家列举的一些关键措施和最佳实践&#xff1a; 文章目录 1. 使用Spring Security2. 安全配置3. 数据加密4. 凭证管理5. 输入验证6. 异常处理7. 定期更新依赖8. 日志监控9. 审计日志10. 安全培训 1. 使用S…...

力扣 岛屿数量-200

岛屿数量-200 class Solution {//深度优先搜索 dfs public:int vis[300][300] {0};//用于标记的数组&#xff0c;标记是否遍历过int cnt 0;//岛屿计数//上下左右的移动方向数组int dx[4]{-1,1,0,0};int dy[4]{0,0,-1,1};//深度优先搜索void dfs(vector<vector<char>…...

极狐GitLab 17.6 正式发布几十项与 DevSecOps 相关的功能【三】

GitLab 是一个全球知名的一体化 DevOps 平台&#xff0c;很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab 是 GitLab 在中国的发行版&#xff0c;专门为中国程序员服务。可以一键式部署极狐GitLab。 学习极狐GitLab 的相关资料&#xff1a; 极狐GitLab 官网极狐…...

十二、正则表达式、元字符、替换修饰符、手势和对话框插件、字符串截取

1. 正则表达式 1.1 基本使用 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>Document</title&g…...

【信息系统项目管理师】第3章:信息系统治理 考点梳理

文章目录 3.1 IT 治理3.1.1 IT治理基础3.1.2 IT治理体系3.1.3 IT治理任务3.1.4 IT治理方法与标准 3.2 IT 审计3.2.1 IT审计基础3.2.2 审计方法与技术3.2.3 审计流程3.2.4 审计内容 3.1 IT 治理 IT治理起到重要的统筹、评估、指导和监督作用。 信息技术审计(IT审计)作为与IT治…...

实现对图片或者视频增加隐藏水印和提取水印

好久好久没有写博客了&#xff0c;最近看见一个很有意思的文章&#xff1a;小心你的电脑被窃听&#xff0c;就是说在一些公司&#xff0c;截图都会存在水印&#xff0c;方便溯源&#xff0c;然后出于技术的好奇&#xff0c;我在github上搜了一下&#xff0c;还真有相关的github…...

uniapp配置全局消息提醒

1.H5使用根标签插入dom的方式实现。 2.app端使用plus.nativeObj.View的方式绘制实现 H5端app端 H5端 创建组件orderAlert.vue <template><div class"view"><div class"content" v-if"visible"><div class"message&q…...

云原生核心技术 (7/12): K8s 核心概念白话解读(上):Pod 和 Deployment 究竟是什么?

大家好&#xff0c;欢迎来到《云原生核心技术》系列的第七篇&#xff01; 在上一篇&#xff0c;我们成功地使用 Minikube 或 kind 在自己的电脑上搭建起了一个迷你但功能完备的 Kubernetes 集群。现在&#xff0c;我们就像一个拥有了一块崭新数字土地的农场主&#xff0c;是时…...

利用ngx_stream_return_module构建简易 TCP/UDP 响应网关

一、模块概述 ngx_stream_return_module 提供了一个极简的指令&#xff1a; return <value>;在收到客户端连接后&#xff0c;立即将 <value> 写回并关闭连接。<value> 支持内嵌文本和内置变量&#xff08;如 $time_iso8601、$remote_addr 等&#xff09;&a…...

Redis相关知识总结(缓存雪崩,缓存穿透,缓存击穿,Redis实现分布式锁,如何保持数据库和缓存一致)

文章目录 1.什么是Redis&#xff1f;2.为什么要使用redis作为mysql的缓存&#xff1f;3.什么是缓存雪崩、缓存穿透、缓存击穿&#xff1f;3.1缓存雪崩3.1.1 大量缓存同时过期3.1.2 Redis宕机 3.2 缓存击穿3.3 缓存穿透3.4 总结 4. 数据库和缓存如何保持一致性5. Redis实现分布式…...

视频字幕质量评估的大规模细粒度基准

大家读完觉得有帮助记得关注和点赞&#xff01;&#xff01;&#xff01; 摘要 视频字幕在文本到视频生成任务中起着至关重要的作用&#xff0c;因为它们的质量直接影响所生成视频的语义连贯性和视觉保真度。尽管大型视觉-语言模型&#xff08;VLMs&#xff09;在字幕生成方面…...

逻辑回归暴力训练预测金融欺诈

简述 「使用逻辑回归暴力预测金融欺诈&#xff0c;并不断增加特征维度持续测试」的做法&#xff0c;体现了一种逐步建模与迭代验证的实验思路&#xff0c;在金融欺诈检测中非常有价值&#xff0c;本文作为一篇回顾性记录了早年间公司给某行做反欺诈预测用到的技术和思路。百度…...

MySQL:分区的基本使用

目录 一、什么是分区二、有什么作用三、分类四、创建分区五、删除分区 一、什么是分区 MySQL 分区&#xff08;Partitioning&#xff09;是一种将单张表的数据逻辑上拆分成多个物理部分的技术。这些物理部分&#xff08;分区&#xff09;可以独立存储、管理和优化&#xff0c;…...

DeepSeek源码深度解析 × 华为仓颉语言编程精粹——从MoE架构到全场景开发生态

前言 在人工智能技术飞速发展的今天&#xff0c;深度学习与大模型技术已成为推动行业变革的核心驱动力&#xff0c;而高效、灵活的开发工具与编程语言则为技术创新提供了重要支撑。本书以两大前沿技术领域为核心&#xff0c;系统性地呈现了两部深度技术著作的精华&#xff1a;…...

保姆级【快数学会Android端“动画“】+ 实现补间动画和逐帧动画!!!

目录 补间动画 1.创建资源文件夹 2.设置文件夹类型 3.创建.xml文件 4.样式设计 5.动画设置 6.动画的实现 内容拓展 7.在原基础上继续添加.xml文件 8.xml代码编写 (1)rotate_anim (2)scale_anim (3)translate_anim 9.MainActivity.java代码汇总 10.效果展示 逐帧…...

macOS 终端智能代理检测

&#x1f9e0; 终端智能代理检测&#xff1a;自动判断是否需要设置代理访问 GitHub 在开发中&#xff0c;使用 GitHub 是非常常见的需求。但有时候我们会发现某些命令失败、插件无法更新&#xff0c;例如&#xff1a; fatal: unable to access https://github.com/ohmyzsh/oh…...

Centos 7 服务器部署多网站

一、准备工作 安装 Apache bash sudo yum install httpd -y sudo systemctl start httpd sudo systemctl enable httpd创建网站目录 假设部署 2 个网站&#xff0c;目录结构如下&#xff1a; bash sudo mkdir -p /var/www/site1/html sudo mkdir -p /var/www/site2/html添加测试…...