蓝桥杯基础练习VIP-FJ的字符串-题解(C++代码) 用递归的方法```cpp#include#include#include#include#includeusingnamespacestd;conststringletter="ABCDEFGHIJKLMNOPQRSTUVWXYZ";stringans="";stringgetString(intn) 题解列表 2020年04月26日 0 点赞 0 评论 1204 浏览 评分:0.0
蓝桥杯算法提高VIP-盾神与积木游戏-题解(C++代码) ```cpp思想:贪心,每个孩子需要的积木一定是他需要的总数减去已经拥有的,我们就假设孩子们完成任务后把积木放在一个箱子中,箱子中积木的数量cnt在一开始的时候等于0,用sort给结构体排序按需要的积木数量从小到大排序,如果箱子里的积木数量不足以让第一个孩子(需要的最少)完成他的任务,则不可能完成。 题解列表 2020年04月26日 0 点赞 0 评论 1062 浏览 评分:0.0
肺炎大作战-题解(C++代码)(离散化+并查集) ####题意转化给定无数个点n条边的无向连通图,求这个图的最大的连通分量的大小是多少。####Solution这个题的图里点会有无数个,但是关于所在连通分量大小大于等于2的只与给出的n条边有关。那么我们先对给出的点进行离散化即可。离散化之后,这个图的点最多只有2n个,然后开一个合适大小的并查集。 题解列表 2020年04月26日 0 点赞 1 评论 869 浏览 评分:9.9
[编程入门]打印图案 (C++描述) **每周五更新自编小程序!**```cpp#includeusingnamespacestd;intmain(){cout 题解列表 2020年04月26日 0 点赞 4 评论 2386 浏览 评分:9.9
大鱼吃小鱼-题解(C++代码)优先队列 解题思路:使用c++优先队列,一开始全部数据都加入优先队列,升序加入队列。最后进行m个(取第一个和第二个和重新加入队列)最后输出队列顶部。#include#include#include#include#include#include#include#include#include#definelll 题解列表 2020年04月25日 0 点赞 3 评论 2933 浏览 评分:7.4
数据结构-图的遍历——DFS深度优先搜索-题解(C++代码) ```cpp#include#include#include#include#include#include#includeusingnamespacestd;constintMAXN=100+5;constintINF=0x3f3f3f3f;intn;intmap[MAXN][MAXN];vecto 题解列表 2020年04月25日 0 点赞 0 评论 1030 浏览 评分:0.0
字符串的修改-题解(C++代码) 贪心:需要修改的最少次数=元素的个数-不需要修改的个数```cpp#include#include#include#include#includeusingnamespacestd;intmain(){stringA,B;intc=0;cin>>A>>B;if(A.size() 题解列表 2020年04月25日 0 点赞 0 评论 1880 浏览 评分:0.0
三位数反转-题解(C++代码) #题解**以后每周五都会更新一个小程序源代码,敬请期待!****这个是一个可以翻转所有数字的程序**```cpp#includeusingnamespacestd;intmain(){intn,sum=0;cin>>n;for(;n>0;){sum=sum*10+n%10;n/=10;}coutn){ 题解列表 2020年04月25日 0 点赞 1 评论 1815 浏览 评分:9.9
通过数组连接 自定义函数之字符串连接-题解(C语言代码) #使用数组连接字符串**如果需要,可以连string.h函数库都不调用(转为单个字符输入或用循环检查)##请注意最后的空字符插入```c#include#includeintmain(void){charch1[100],ch2[100],name[200];inti, 题解列表 2020年04月25日 0 点赞 0 评论 1637 浏览 评分:8.7
蓝桥杯2015年第六届真题-赢球票-题解(C++代码)-------------队列的出队入队,很简单的 #include#include#includeusingnamespacestd;#defineN1000intmain(){inti,j,k;intn,m;intmax0=-1e9;cin>>n;inta[N]={0};for(i=1;i>a[i];max0=max(max0, 题解列表 2020年04月25日 0 点赞 0 评论 1531 浏览 评分:0.0