题解列表

筛选

蓝桥杯2023年第十四届省赛真题-岛屿个数(搜索)

摘要:# ***解题思路*** 从$$(0,0)$$开始染色,把遇到的0全部染成2,这样没染色的部分,一定为环,接着再搜索环的个数即可。 注意:开始染色的时候,可能有斜角,得使用八向搜索;搜索环的时……

题目 2879: 错误探测

摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() {     int n,num0,num1,sum,x,y;     scanf("%d",&n); ……

T1247-河中跳房子

摘要: ```c++ #include #include using namespace std; const int MAXN = 1e5 + 5; int l,n,m,dis……

蓝桥杯C组-填充

摘要:解题思路:大劣,考试的时候没想到╥﹏╥参考代码:#include <iostream>  // 引入输入输出流库 #include <cstring> // 引入字符串库 using namesp……

字符统计(c语言代码)

摘要:解题思路:利用整形数组记录字符串中字符出现的次数,然后将每个字母出现的次数进行对比,大的留下小的置0,最后输出 ```c #include #include char str[100000];……

1314: 乘积最大

摘要:```cpp #include using namespace std; int _max(int *a,int n,int k) { if(k==0) { ……

二分时间+区间合并

摘要:解题思路:注意事项:参考代码:def sort1(m):    a,b=m    return b,adef sort2(m):    a,b=m    return a,-bdef check(mi……

线性dp(时间复杂度N)

摘要:解题思路:dp[i]=max(dp[i-1],v[i]+dp[i-2]) # v[i] 表示值&&i-2至少要隔开一个距离注意事项:参考代码:list1=list(input())temp=list(……