手机主页推荐/网站怎样优化文章关键词

手机主页推荐,网站怎样优化文章关键词,wordpress博客位置,中国中信建设有限责任公司个人主页:Guiat 归属专栏:每日一题 文章目录 1. 【2.24】P10424 [蓝桥杯 2024 省 B] 好数2. 【2.25】P8665 [蓝桥杯 2018 省 A] 航班时间3. 【2.26】P10905 [蓝桥杯 2024 省 C] 回文字符串4. 【2.27】P10425 [蓝桥杯 2024 省 B] R 格式5. 【2.28】P10426…

在这里插入图片描述

个人主页:Guiat
归属专栏:每日一题

在这里插入图片描述

文章目录

  • 1. 【2.24】P10424 [蓝桥杯 2024 省 B] 好数
  • 2. 【2.25】P8665 [蓝桥杯 2018 省 A] 航班时间
  • 3. 【2.26】P10905 [蓝桥杯 2024 省 C] 回文字符串
  • 4. 【2.27】P10425 [蓝桥杯 2024 省 B] R 格式
  • 5. 【2.28】P10426 [蓝桥杯 2024 省 B] 宝石组合
  • 6. 【3.1】P10912 [蓝桥杯 2024 国 B] 数星星
  • 7. 【3.2】P10914 [蓝桥杯 2024 国 B] 跳石头

正文

1. 【2.24】P10424 [蓝桥杯 2024 省 B] 好数

题目链接:https://www.luogu.com.cn/problem/P10424

【AC_Code】

#include <iostream>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;int N, cnt;bool check(int n)
{int number = 1;while (n > 0){if (number % 2 == 1) { if ((n % 10) % 2 == 0) return false; }else if ((n % 10) % 2 != 0) return false;n /= 10; number ++;}return true;
}int main()
{IOS; cin >> N;for (int i = 1; i <= N; i ++) if (check(i)) cnt ++;cout << cnt << '\n';return 0;
}

2. 【2.25】P8665 [蓝桥杯 2018 省 A] 航班时间

题目链接:https://www.luogu.com.cn/problem/P8665

【AC_Code】

#include <iostream>
#include <iomanip>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;int solve()
{int h1, m1, s1, h2, m2, s2, d = 0; char c1, c2, c3, c4, c5, c6;cin >> h1 >> c1 >> m1 >> c2 >> s1 >> h2 >> c3 >> m2 >> c4 >> s2;if (cin.peek() == ' ') cin >> c5 >> d >> c6;return (86400 * d + 3600 * h2 + 60 * m2 + s2) - (3600 * h1 + 60 * m1 + s1);
}int main()
{IOS; int T; cin >> T;while (T --){int ans = (solve() + solve()) >> 1;cout << setw(2) << setfill('0') << ans / 3600 << ':'<< setw(2) << setfill('0') << (ans % 3600) / 60 << ':'<< setw(2) << setfill('0') << ans % 60 << '\n';}return 0;
}

3. 【2.26】P10905 [蓝桥杯 2024 省 C] 回文字符串

题目链接:https://www.luogu.com.cn/problem/P10905

【AC_Code】

#include <iostream>
#include <string>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;void solve()
{string s; cin >> s; int l = 0, r = s.length() - 1;while (s[l] == 'l' || s[l] == 'q' || s[l] == 'b') l ++;while (s[r] == 'l' || s[r] == 'q' || s[r] == 'b') r --;bool flag = true;for (int i = l, j = 0; i <= (l + r) / 2; i ++, j ++) if (s[i] != s[r - j]) flag = false;if ( ! flag ) cout << "No\n";else if (l == 0) cout << "Yes\n";else if (r == s.length() - 1) cout << "No\n";else if (s.length() - r < l) cout << "No\n";else{l --; r ++;while (s[l] == s[r] && l >= 0 && r <= s.length()) l --, r ++;if (r == s.length() || l == -1) cout << "Yes\n";else cout << "No\n";}
}int main()
{IOS; int T; cin >> T; while (T--) solve();return 0;
}

4. 【2.27】P10425 [蓝桥杯 2024 省 B] R 格式

题目链接:https://www.luogu.com.cn/problem/P10425

【AC_Code】

#include <iostream>
#include <algorithm>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int N = 1e6;
int n, a[N], pos, len; string q;void solve()
{reverse(q.begin(), q.end());pos = q.find('.'); q.erase(pos, 1); len = q.size();for (int i = 0; i < len; i ++) a[i + 1] = q[i] - '0';for (int i = 1; i <= n; i ++){for (int i = 1; i <= len; i ++) a[i] *= 2;for (int i = 1; i <= len; i ++) a[i + 1] += a[i] / 10, a[i] %= 10;if (a[len + 1]) len ++;}if (a[pos] >= 5) a[pos + 1] ++;for (int i = pos + 1; i <= len; i ++) a[i + 1] += a[i] / 10, a[i] %= 10;if (a[len + 1]) len ++;for (int i = len; i > pos; i --) cout << a[i]; cout << '\n';
}int main()
{IOS; cin >> n >> q; solve();return 0;
}

5. 【2.28】P10426 [蓝桥杯 2024 省 B] 宝石组合

题目链接:https://www.luogu.com.cn/problem/P10426

【AC_Code】

#include <iostream>
#include <vector>
#include <algorithm>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int MAXN = 1e5 + 10; int n, h[MAXN]; vector<int> fac[MAXN];int gcd(int a, int b) { return __gcd(a, b); }void solve()
{cin >> n; for (int i = 1; i <= n; ++ i) cin >> h[i];sort(h + 1, h + 1 + n);for (int i = 1; i <= n; ++ i) for (int j = 1; j * j <= h[i]; ++j){if (h[i] % j == 0){fac[j].push_back(h[i]);if (h[i] / j != j) fac[h[i] / j].push_back(h[i]);}}for (int i = MAXN; i >= 1; -- i){if (fac[i].size() >= 3){int a = fac[i][0], b = fac[i][1], c = fac[i][2];if (gcd(gcd(a, b), c) == i) { cout << a << " " << b << " " << c << "\n"; return; }}}
}int main()
{IOS; solve();return 0;
}

6. 【3.1】P10912 [蓝桥杯 2024 国 B] 数星星

题目链接:https://www.luogu.com.cn/problem/P10912

【AC_Code】

#include <iostream>
#include <vector>
#include <algorithm>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int N = 1e5 + 10, mod = 1e9 + 7;
int n, a[N], b[N], c[N], f[N], l, r, ans;
vector<int> vec[N];int fun(int x, int y) { return 1ll * b[x] * f[y] % mod * f[x - y] % mod; }void DFS(int x, int y)
{for (auto n : vec[x]) if (n != y) DFS(n, x);if (static_cast<int> (vec[x].size()) + 1 >= 1){int p = min(r - 1, static_cast<int> (vec[x].size()));for (int i = l - 1; i <= p; i ++) ans = (ans + fun(vec[x].size(), i)) % mod;}
}void solve()
{cin >> n; b[0] = c[0] = 1; b[1] = 1; c[1] = 1; f[0] = 1; f[1] = 1;for (int i = 2; i <= n; i ++){b[i] = 1ll * b[i - 1] * i % mod;c[i] = 1ll * c[mod % i] * (mod - mod / i) % mod;f[i] = 1ll * f[i - 1] * c[i] % mod;}for (int i = 1; i < n; i ++){int x, y; cin >> x >> y;vec[x].push_back(y); vec[y].push_back(x);}cin >> l >> r;DFS(1, 0);cout << ans << '\n';
}int main()
{IOS; solve();return 0;
}

7. 【3.2】P10914 [蓝桥杯 2024 国 B] 跳石头

题目链接:https://www.luogu.com.cn/problem/P10914

【AC_Code】

#include <iostream>
#include <bitset>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std;const int N = 4e4 + 10; int c[N], n, ans;
bitset<N> f[N];void solve()
{cin >> n;for (int i = 1; i <= n; i ++){cin >> c[i]; f[i][c[i]] = 1;}for (int i = n; i >= 1; i --){if (i + c[i] <= n) f[i] |= f[i + c[i]];if (2 * i <= n) f[i] |= f[2 * i];ans = max(ans, (int)f[i].count());}cout << ans << '\n';
}int main()
{IOS; solve();return 0;
}

结语
感谢您的阅读!期待您的一键三连!欢迎指正!

在这里插入图片描述

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

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

相关文章

跟着官方文档学习UE C++ TArray容器系列 迭代 和 排序

一.首先测试下&#xff0c;官方案例 迭代器的方法&#xff0c;有点不常见。有点像个指针&#xff0c;迭代完还自带break. oid AWXTArrayActor::WXLoopArray() {FString JoinedStr1;FString JoinedStr2;TArray<FString> StrArr { "Hello","Baby",&q…

Qt 对象树详解:从原理到运用

1. 什么是对象树&#xff1f; 对象树是一种基于父子关系的对象管理机制。在 Qt 中&#xff0c;所有继承自 QObject 的类都可以参与到对象树中。 当一个对象被设置为另一个对象的父对象时&#xff0c;子对象会被添加到父对象的内部列表中&#xff0c;形成一种树状结构。 Qt 提…

JavaAPI(网络编程)

网络通信协议 通信协议 ‌所谓通信协议&#xff0c;是指通信双方在进行数据交换时必须遵守的规则和约定。‌这些规则确保了双方能够有效地进行通信&#xff0c;实现信息的交换和资源共享。通信协议定义了传输时的数据格式、控制信息以及传输顺序和速度等&#xff0c;确保双方…

Java---入门基础篇(下)---方法与数组

前言 本篇文章主要讲解有关方法与数组的知识点 ,是基础篇的一部分 , 而在下一篇文章我会讲解类和对象的知识点 入门基础篇上的链接给大家放在下面啦 ! Java---入门基础篇(上)-CSDN博客 感谢大家点赞&#x1f44d;&#x1f3fb;收藏⭐评论✍&#x1f3fb; 欢迎各位大佬指点…

Python 爬虫 – BeautifulSoup

Python 爬虫&#xff08;Web Scraping&#xff09;是指通过编写 Python 程序从互联网上自动提取信息的过程。 爬虫的基本流程通常包括发送 HTTP 请求获取网页内容、解析网页并提取数据&#xff0c;然后存储数据。 Python 的丰富生态使其成为开发爬虫的热门语言&#xff0c;特…

图像分类项目1:基于卷积神经网络的动物图像分类

一、选题背景及动机 在现代社会中&#xff0c;图像分类是计算机视觉领域的一个重要任务。动物图像分类具有广泛的应用&#xff0c;例如生态学研究、动物保护、农业监测等。通过对动物图像进行自动分类&#xff0c;可以帮助人们更好地了解动物种类、数量和分布情况&#xff0c;…

PHP:IDEA开发工具配置XDebug,断点调试

文章目录 一、php.ini配置二、IDEA配置 一、php.ini配置 [xdebug] zend_extension"F:\wamp64\bin\php\php7.4.0\ext\php_xdebug-2.8.0-7.4-vc15-x86_64.dll" xdebug.remote_enable on xdebug.remote_host 127.0.0.1 xdebug.remote_port 9001 xdebug.idekey"…

【Java】使用jdk自带的zip压缩实现任意文件压缩打包下载功能(复制即用)

前言 在实际项目中&#xff0c;我们可能会接到将文件或者资料打包压缩导出的需求&#xff0c;例如将系统中某些生成的文件一起打包压缩下载提供给客户使用&#xff0c;今天提供一个jdk自带的工具类快速实现打包压缩的功能&#xff0c;方法我已经封装好&#xff0c;大家如果在项…

腾讯云扩容记录

腾讯云扩容&#xff1a; sudo yum install -y cloud-utils-growpart 安装扩容工具 sudo file -s /dev/vda1 有数据 sudo LC_ALLen_US.UTF-8 growpart /dev/vda 1 sudo resize2fs /dev/vda1 df -Th 完毕 以下是对执行的命令的详细解释以及背后的原理&#xff1a; 1. 安装 cloud…

服务流程设计和服务或端口重定向及其websocket等应用示例

服务流程设计和服务或端口重定向及其websocket等应用示例 目录 服务或端口重定向的服务设计和websocket等应用示例 一、通用请求控制流程 1.1、入口 1.2、所有GET请求首先预检控制单元 1.3、http请求会分别自动307重定向 1.4、所有请求首先执行跨源控制单元 1.5、然后…

使用DeepSeek+KIMI生成高质量PPT

一、使用DeepSeek DeepSeek官网&#xff1a;DeepSeek 点击“开始对话”&#xff0c;进入交互页面。 在上图中&#xff0c;输入问题&#xff0c;即可获取AI生成的结果。 基础模型&#xff08;V3&#xff09;&#xff1a;通用模型&#xff08;2024.12&#xff09;&#xff0c;高…

MySQL—使用binlog日志恢复数据

一、binlog日志恢复数据简介 在 MySQL 中&#xff0c;使用二进制日志&#xff08;binlog&#xff09;恢复数据是一种常见的用于故障恢复或数据找回的方法。以下是详细的使用步骤&#xff1a; 确认 binlog 已启用&#xff1a;首先需要确认 MySQL 服务器已经启用了二进制日志功…

VADv2: 基于矢量表征和概率规划的E2E架构

1. 写在前面 今天分享一篇自动驾驶领域的论文VADv2(End-to-End Vectorized Autonomous Driving via Probabilistic Planning), 基于矢量表征和概率规划的E2E架构,2024年2月份华中科技大和地平线合作的一篇文章, 在经典的端到端模型架构上作出了基于概率规划去输出规划轨迹的…

NLP11-命名实体识别(NER)概述

目录 一、序列标注任务 常见子任务 二、 命名实体识别&#xff08;NER&#xff09; &#xff08;一&#xff09;简介 &#xff08;二&#xff09;目标 &#xff08;三&#xff09;应用场景 &#xff08;四&#xff09;基本方法 &#xff08;五&#xff09;工具与资源 一…

虚拟仿真无线路由器5G和2.4G发射信号辐射对比(虚拟仿真得出最小安全距离,与国际标准要求一致)

1、前言 有人说&#xff0c;只要有电磁波的地方就有辐射。5G和2.4G信号辐射强度是多少&#xff1f;是否会对人体构成危害&#xff1f;无线路由器的2.4GHz频段&#xff0c;频率范围&#xff1a;2.4 GHz 至 2.4835 GHz&#xff0c;信道宽度&#xff1a;通常为20 MHz&#xff0c;…

【数据挖掘】Matplotlib

Matplotlib 是 Python 最常用的 数据可视化 库之一&#xff0c;在数据挖掘过程中&#xff0c;主要用于 数据探索 (EDA)、趋势分析、模式识别 和 结果展示。 &#x1f4cc; 1. Matplotlib 基础 1.1 安装 & 导入 # 如果未安装 Matplotlib&#xff0c;请先安装 # pip instal…

DHCP配置实验

实验拓扑图 首先配置server的IP地址和网关 接下来配置R1 undo info-center enable dhcp enable //开启DHCP服务 ip pool dhcp-pool1 //开始配置dhcp地址池 gateway-list 192.168.1.254 //配置网关 network 192.168.1.0 mask 255.255.255.0 //配置网段和子网掩码 dns-list …

Linux:ELF文件-静动态库原理

✨✨所属专栏&#xff1a;Linux✨✨ ✨✨作者主页&#xff1a;嶔某✨✨ ELF文件 什么是编译&#xff1f;编译就是将程序源代码编译成能让CPU直接执行的机器代码 如果我们要编译一个 .c文件&#xff0c;使用gcc -c将.c文件编译为二进制文件.o &#xff0c;如果一个项目有多个.…

Towards Graph Foundation Models: A Survey and Beyond

Towards Graph Foundation Models: A Survey and Beyond WWW24 ​#paper/⭐⭐⭐#​ #paper/&#x1f4a1;#​ 背景和动机 背景与意义 随着基础模型&#xff08;如大语言模型&#xff09;在NLP等领域的突破&#xff0c;图机器学习正经历从浅层方法向深度学习的范式转变。GFM…

基于 Python 深度学习的电影评论情感分析可视化系统(2.0 全新升级)

基于 Python 深度学习的电影评论情感分析可视化系统&#xff0c;基于 Flask 深度学习&#xff0c;构建了一个 影评情感分析系统&#xff0c;能够 自动分析影评、计算情感趋势 并 可视化展示&#xff0c;对于电影行业具有重要参考价值&#xff01; 基于 Python 深度学习的电影评…