江南程序设计竞赛联盟暑期多校训练·第二场(个人补题B,H,L)
📅 2026/7/29 22:24:47
👁️ 次浏览
题目B. k -- GCD 可分数列知识点二分贪心gcd关键根据每加入一个数字的gcd值不会大于元素为单调性质想到可以用二分做如果想到这点的话下面就是对段数进行贪心思路在[1,min(a)]上二分答案思路就是贪心的将数字加入如果把当前位置的数字加入后不满足条件则在当前位置的左边划分段数大于k则取左区间否则取右区间注意分段时最后的边界还需要特别处理由于题目所给的a都是大于等于一的二分左端点可以从零开始代码#include bits/stdc.h using namespace std; #define int long long #define endl \n int n, k; const int N 1e410; int arr[N]; int check(int x) { if (x 0) return 0; int sum 0; int p 1; int gd arr[p]; while (p n) { if (gcd(gd, arr[p]) x) { gd gcd(gd, arr[p]); p; } else { sum; gd arr[p]; p; } } if (gd x) sum; return sum; } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin n k; int mi 1e910; for (int i 1; i n; i) { cin arr[i]; mi min(mi, arr[i]); } int l 0, r mi ; while (l 1 ! r) { int mid (l r) / 2; if (check(mid) k) l mid; else r mid; //cout l r mid check(mid) endl; } if (check(r) k) cout r; else cout l; //cout check(10) check(11) check(12); return 0; } /* 7 5 66 77 44 11 85 18 56 */题目H. 接力赛知识点区间合并关键左右可以任意走只需要关注y值即可思路将所有的y值都记录下来y值就可以看成区间进行合并只需将每个区间的左端点从小到大排序然后遍历如果下一个区间和当前区间重叠则合并更新右端点否则记录不连续的区间长并更新新的左右端点注意由于是坐标系AB的y值需要判定一下若A的y值小于等于B的y值则直接输出零否则再进行操作并且最好剔除掉AB两点之外的区间代码#include bits/stdc.h using namespace std; #define int long long #define endl \n const int N 1e510; int n; double a1, b1, a2, b2; vectorpairdouble, double v; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin n a1 b1 a2 b2; for (int i 1; i n; i) { int X1, X2, Y1, Y2; cin X1 Y1 X2 Y2; if (Y1 b1 Y2 b2) v.push_back({Y1, Y2}); } if (b1 b2) { cout 0; return 0; } v.push_back({b1, b1 10}); v.push_back({b2 - 10, b2}); sort(v.begin(), v.end()); if (v.size() 0) { cout b1 - b2; return 0; } double l v[0].first, r v[0].second; double ans 0; for (int i 1; i v.size() - 1; i) { if (v[i].first r) { ans (v[i].first - r); l v[i].first; r v[i].second; } else { r max(r, v[i].second); } } cout ans; return 0; }题目L. 小组合作知识点贪心或 dp关键这题用贪心来写考虑的情况很多容易卡思路我是用的贪心的思路也是一知半解建议还是去看别人的我是用一个大顶堆存社牛值然后依次往下贪心当人数满足条件的时候分段但是存在多种情况导致这个贪心错误所以贪的时候还需要对当前段进行判断如果后面的值对于当前段的贡献不如对其他段的贡献则需要再进行处理这里直接附上原本的题解吧我说的可能还是有很多错误的地方代码#include bits/stdc.h using namespace std; #define int long long #define endl \n priority_queueint q; int ans 0; int now 0; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin n; for (int i 1; i n; i) { int x; cin x; q.push(x); } if (q.top() n) { cout -1; return 0; } while (!q.empty()) { now q.top(); if (now q.size()) break; vectorint v; while (now--) { v.push_back(q.top()); q.pop(); } if (!ans) { ans; continue; } if (v.size() ! 1) { if (v[1] v.size() - 1) { for (int i 1; i v.size() - 1; i) { q.push(v[i]); } } else ans; } else ans; } if (ans) cout ans; else cout -1; return 0; }
Speech-Denoising-Wavenet源码解析:关键函数与数据流程详解 【免费下载链接】speech-denoising-wavenet A neural network for end-to-end speech denoising 项目地址: https://gitcode.com/gh_mirrors/sp/speech-denoising-wavenet
Speech-Denoising-Wavene…
📅 2026/7/29 22:23:47
如何高效解决ComfyUI-VideoHelperSuite VHS_VideoCombine节点缺失问题:完整技术指南 【免费下载链接】ComfyUI-VideoHelperSuite Nodes related to video workflows 项目地址: https://gitcode.com/gh_mirrors/co/ComfyUI-VideoHelperSuite
ComfyUI-VideoHel…
📅 2026/7/29 22:23:47
3步掌握Crow框架:打造高性能C Web服务的完整指南 【免费下载链接】crow Crow is very fast and easy to use C micro web framework (inspired by Python Flask) 项目地址: https://gitcode.com/gh_mirrors/cr/crow
Crow是一个专为C开发者设计的轻量级微框架…
📅 2026/7/29 22:23:47
远程构建内核从未如此简单:virtme-ng跨主机编译教程 【免费下载链接】virtme-ng Quickly build and run kernels inside a virtualized snapshot of your live system 项目地址: https://gitcode.com/gh_mirrors/vi/virtme-ng
在Linux内核开发过程中…
📅 2026/7/29 23:13:11
ArkTS 进阶之道(15):BuilderParam 组件参数化边界——为啥 Builder 能当参数传本文是「ArkTS 进阶之道」系列第 15 篇,续「ArkUI 组件设计」阶段。上一篇讲 Builder 绑渲染树节点复用(篇 63)——Builder 绑…
📅 2026/7/29 23:13:11
如何个性化gh_mirrors/do/dotfiles.zsh?打造专属你的开发环境配置 【免费下载链接】dotfiles.zsh Config files for ZSH, Java, Ruby, Go, Editors, Terminals and more. 项目地址: https://gitcode.com/gh_mirrors/do/dotfiles.zsh
gh_mirrors/do/dotfiles.…
📅 2026/7/29 23:13:11
Docker一键部署Instaclone:生产环境配置与优化指南 【免费下载链接】instaclone An instagram clone created with the MERN stack 项目地址: https://gitcode.com/gh_mirrors/inst/instaclone
Instaclone是一个基于MERN技术栈开发的Instagram克隆项目&#…
📅 2026/7/29 23:13:11
iOS日历应用性能优化:基于Calendar框架的最佳实践 【免费下载链接】Calendar A set of views and controllers for displaying and scheduling events on iOS 项目地址: https://gitcode.com/gh_mirrors/calenda/Calendar
Calendar框架是iOS平台上一套用于显…
📅 2026/7/29 23:13:11
1.系统磁盘清理2.wps中C盘清理3.系统管家清理磁盘4.space检测-清理软件5.命令行清理winR、输入%temp%
📅 2026/7/29 23:12:11
解密Seq的核心功能:如何利用Pipeline实现高效基因组数据处理 【免费下载链接】seq A high-performance, Pythonic language for bioinformatics 项目地址: https://gitcode.com/gh_mirrors/se/seq
Seq作为一款高性能的生物信息学专用语言,其Pipel…
📅 2026/7/29 0:00:00
Flask-Blogging插件开发指南:打造属于你的个性化博客功能 【免费下载链接】Flask-Blogging A Markdown Based Python Blog Engine as a Flask Extension. 项目地址: https://gitcode.com/gh_mirrors/fl/Flask-Blogging
Flask-Blogging是一个基于Markdown的Py…
📅 2026/7/29 0:00:00
近日,国际专注开放式技术研发的声学品牌Nank南卡,正式官宣实力艺人曾舜晞担任品牌代言人。消息一经发出便轰动全网。为什么耳机品牌不选择流量明星、老牌歌手?而且是选择曾舜晞?让我们一起来探索一下!比起短期的流量&a…
📅 2026/7/29 0:01:00
更多请点击:
https://codechina.net
第一章:AI帮助理解数学概念 人工智能正以前所未有的方式重塑数学学习的路径。通过自然语言处理与符号计算的深度融合,AI不仅能解析抽象定义,还能将定理、证明和几何直觉转化为可交互、可验证的…
📅 2026/7/29 1:14:44
1. 项目背景与核心价值去年参与的一个短剧项目让我深刻体会到传统创作流程的痛点:编剧团队花了三周打磨剧本,角色设计反复修改了七版,最后成片时又因为演员档期问题不得不临时调整分镜。这种低效的创作模式在快节奏的内容行业越来越难以为继。…
📅 2026/7/29 1:14:44
remix-i18next TypeScript类型安全实践:确保翻译键与类型定义同步 【免费下载链接】remix-i18next The easiest way to translate your React Router framework mode apps 项目地址: https://gitcode.com/gh_mirrors/re/remix-i18next
在开发多语言应用时&am…
📅 2026/7/29 1:14:46
目录
第一步:选对模板,省心一半
第二步:打开扫码点餐功能
开启功能按钮
桌台管理与桌码生成
第三步:个性化设计,打造品牌感
调整点餐页面
设置点餐规则 你还在让顾客站着排队点餐吗?2025年ÿ…
📅 2026/7/29 7:15:11
在业务中快速构建一个能理解私有文档、准确回答专业问题的智能助手,是很多开发团队面临的共同挑战。传统方案往往需要从零开始搭建复杂的 RAG(检索增强生成)系统,涉及文档解析、向量化、检索、大模型调用等多个环节,整…
📅 2026/7/29 17:15:46
FAE放射组学分析工具:医学影像特征探索的完整解决方案 【免费下载链接】FAE FeAture Explorer 项目地址: https://gitcode.com/gh_mirrors/fae/FAE
你是否曾经面对海量医学影像数据感到无从下手?想要从CT、MRI等影像中提取有价值的定量特征&#…
📅 2026/7/29 5:15:05