递归倒置字符组xxxxx 摘要:解题思路:定义递归函数,以首尾字符交换的方式逐步调整字符串,通过不断缩小处理范围实现倒置。在递归过程中,每次交换字符后打印当前字符状态,当范围缩小到只剩一个字符或更少时停止递归。注意事项:1.注意递归…… 题解列表 2024年10月16日 0 点赞 0 评论 316 浏览 评分:9.9
日期排序(c++代码使用stl库) 摘要:解题思路:用sstream类分割字符串,再用vector容器存储起来,依次比较。注意事项:参考代码:#include<iostream> #include<string> #include<vec…… 题解列表 2024年10月15日 0 点赞 0 评论 269 浏览 评分:0.0
我AC的第一个难题 摘要:参考代码:#include<bits/stdc++.h>//100以内数的加减 using namespace std; bool jiancha(string s) { string…… 题解列表 2024年10月15日 1 点赞 0 评论 532 浏览 评分:9.9
[信息学奥赛一本通T1551-维护序列] 线段树 摘要:# 巧妙的把懒标记传给子节点 ```cpp #include #define ULL unsigned long long #define LL long long #define endl…… 题解列表 2024年10月15日 0 点赞 0 评论 202 浏览 评分:9.9
并查集加一次扫描 摘要:解题思路:并查集求最大联通快、然后扫描的时候 相邻不在同一个并查集就直接把两个集合加起来取最大注意事项:参考代码:#include <iostream>#include<vector> #includ…… 题解列表 2024年10月14日 9 点赞 0 评论 2161 浏览 评分:10.0
[信息学奥赛一本通T1240-查找最接近的元素] 依旧是STL 摘要:## 注意`upper_bound()`返回的是第一个大于查找元素的下标,那么该下标减一就是第一个小于等于元素的下标咯 ------------ @[user](dotcpp0787179…… 题解列表 2024年10月13日 0 点赞 0 评论 253 浏览 评分:9.9
一道题帮你解决二分最痛苦的边界问题 摘要:## 当然你也可以直接使用库函数lower_bound/upper_bound, ### 但是对于某些特殊问题,还是需要手写以完成特殊要求,而且对于我这种小菜鸡还是练练吧(呜呜呜),还有我都没…… 题解列表 2024年10月13日 0 点赞 0 评论 263 浏览 评分:9.9
1882 前缀和,模K数组,组合数 摘要:```cpp #include using namespace std; using ll = long long; const int N = 1e5 + 8; ll a[N],pre…… 题解列表 2024年10月13日 0 点赞 0 评论 177 浏览 评分:0.0
[信息学奥赛一本通T1247-河中跳房子] 二分答案 摘要:```cpp #include #define ULL unsigned long long #define LL long long #define endl '\n' #define d…… 题解列表 2024年10月13日 0 点赞 0 评论 330 浏览 评分:9.9
二分直接用现成的STL:lower_bound/upper_bound(新增手写二分) 摘要:(# 现成的STL直接逮住用 要想了解更多关于**lower_bound/upper_bound** -> [【C++函数速查】lower_bound和upper_bound使用方法详细解读](ht…… 题解列表 2024年10月12日 0 点赞 1 评论 260 浏览 评分:9.9