10 2024 档案

摘要:对顶堆动态维护第k大的值。 #include<bits/stdc++.h> using namespace std; using i64=long long; void Showball(){ int n,w; cin>>n>>w; priority_queue<int,vector<int>,gr 阅读全文
posted @ 2024-10-22 14:47 Showball 阅读(10) 评论(0) 推荐(0) 编辑
摘要:AtCoder Beginner Contest 375 (A-G) 比赛链接 A - Seats #include<bits/stdc++.h> using namespace std; using i64=long long; void Showball(){ int n; string s; 阅读全文
posted @ 2024-10-21 15:32 Showball 阅读(15) 评论(0) 推荐(0) 编辑
摘要:AtCoder Beginner Contest 374 (A-E) 比赛链接 A - Takahashi san 2 #include<bits/stdc++.h> using namespace std; using i64=long long; void Showball(){ string 阅读全文
posted @ 2024-10-16 11:34 Showball 阅读(14) 评论(0) 推荐(0) 编辑
摘要:AtCoder Beginner Contest 373 (A-F) 比赛链接 A - September #include<bits/stdc++.h> using namespace std; using i64=long long; void Showball(){ int ans=0; fo 阅读全文
posted @ 2024-10-11 15:13 Showball 阅读(13) 评论(0) 推荐(0) 编辑
摘要:CF 577 B. Modulo Sum 鸽巢原理/01背包 题目链接 思路: 每个数可选可不选,经典的01背包问题,但是数据范围过大,因为要找可行解即可,考虑去找满足题意的子数组(子数组是特殊的子序列)。就变成一个经典的前缀和问题。只需要找到前缀和数组中存在两个相等的值,那么满足条件。由于需要取模 阅读全文
posted @ 2024-10-09 02:36 Showball 阅读(10) 评论(0) 推荐(0) 编辑
摘要:CF 1805 D. A Wide, Wide Graph (*1800) 思维 + 树的直径 题目链接 题意: 思路: 若当前点到最远的点的距离 <k , 说明 x 自己成为一个联通块。 并且我们知道距离任意一点最远的点一定是树直径的一个端点。 反之,则与直径端点在同一个联通块。 阅读全文
posted @ 2024-10-05 17:59 Showball 阅读(5) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示