用stl的multimap来贪心思想 摘要:解题思路:排序后从x或y最小开始遍历,若相邻x相等则y大的保存,若与下一个x不等则若y2>=y1说明被包裹注意事项:参考代码:#include <bits/stdc++.h> using names…… 题解列表 2024年11月28日 0 点赞 0 评论 81 浏览 评分:0.0
用栈来处理,栈顶元素大于当前元素,则出栈,反之入栈,最后栈中元素就是字典序最小的 摘要:解题思路: - 用到了单调栈的思路 - 题目给的整数很大,需要用string类型来存,为字符串s,这是一个很典型的问题(移除 K 个字符以获得最小字典序),我这可以做一个模板 - 遍历一个字符串…… 题解列表 2024年11月28日 0 点赞 0 评论 252 浏览 评分:0.0
编写题解 1116: IP判断 摘要:```cpp #include #include #include using namespace std; bool judge(string str) { string st…… 题解列表 2024年11月28日 3 点赞 1 评论 322 浏览 评分:8.0
完数的判断(C++) 摘要:解题思路:双重for循环注意事项:sum每循环一轮重新归零注意变量的适用范围以上为本人敲代码时发生的错误,共勉!参考代码:#include<iostream>using namespace std;i…… 题解列表 2024年11月28日 4 点赞 0 评论 491 浏览 评分:0.0
最小新整数贪心c++ 摘要://贪心:每次遍历使高位的数越小越划算 ```cpp #include using namespace std; int main(){ int a,n,c; str…… 题解列表 2024年11月28日 1 点赞 0 评论 152 浏览 评分:0.0
a+b so easy [竞赛入门]简单的a+b 摘要:```cpp #include using namespace std; int main(){ int a,b; while(cin>>a>>b)cout…… 题解列表 2024年11月28日 6 点赞 0 评论 972 浏览 评分:6.0
信息学奥赛一本通T1178-成绩排序 结构体 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义结构体s,包含一个字符串k和一个整数j struct s{ …… 题解列表 2024年11月28日 0 点赞 0 评论 225 浏览 评分:0.0
蓝桥杯2024年第十五届省赛真题-数字诗意,纯暴力!!! 摘要:解题思路: 排除2的n次幂就行了注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义一个长整型数组,用于存储…… 题解列表 2024年11月27日 8 点赞 0 评论 2313 浏览 评分:0.0
车厢调度(train) 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义一个栈,用于存储整数 stack<int> s; int ma…… 题解列表 2024年11月27日 0 点赞 0 评论 191 浏览 评分:0.0
蓝桥杯2024年第十五届省赛真题-好数 暴力 摘要:解题思路:注意事项:参考代码:#include"iostream"using namespace std;int main(){ int n; int s=0; int x=1; cin>>n; fo…… 题解列表 2024年11月27日 1 点赞 0 评论 937 浏览 评分:0.0