蓝桥杯历届试题-翻硬币(贪心) 摘要:#include <iostream> #include <cstring> using namespace std; const int N = 110; int n; char …… 题解列表 2024年04月12日 0 点赞 0 评论 221 浏览 评分:0.0
吃桃子问题 摘要:解题思路:原本有若干桃子,猴子每天吃掉剩下的桃子的一半多一个,注意,是先吃一半,再吃一个。到了第N天时,还剩下1个桃子。这一题可以用循环倒推的方式来解题。从第一天到第N-1天每天都是先吃一半,再吃一个…… 题解列表 2024年04月12日 0 点赞 0 评论 235 浏览 评分:0.0
DFS,最优解 摘要:解题思路:本题可以用dij算法,但是我感觉dfs更好想,要求最短路径,用递归的话,如果去第2个城市,之前已经去过了,再去一边结果是相同的,所以最优解就是每个城市只去一次,用bool f[N]来判断,然…… 题解列表 2024年04月12日 0 点赞 1 评论 324 浏览 评分:6.0
巧解大数问题 摘要:#include <iostream> #include <cmath> using namespace std; /* 直接使用 unsigned long long 仍然无法满足我们…… 题解列表 2024年04月12日 0 点赞 0 评论 173 浏览 评分:0.0
C语言 最大数问题 快速排序求最大值 摘要:练练快排罢了不用参考参考代码:#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> in…… 题解列表 2024年04月12日 0 点赞 0 评论 265 浏览 评分:0.0
矩形总面积(附详细解释) 摘要:解题思路:* 思路算法* 使用一个八个位置的数组来容纳坐标点* (x1,y1)(x2,y2)(x3,y3)(x4,y4)* 对于不相交的矩形,其面积为* (x2-x1)*(y2-y1)+(x4-x3)…… 题解列表 2024年04月12日 2 点赞 0 评论 511 浏览 评分:0.0
数位排序(python) 摘要:``` hash_list=[[] for i in range(55)]#hash_list[n]为各位和为n的数值 hash_list_n=[0 for i in range(55)]#has…… 题解列表 2024年04月12日 0 点赞 0 评论 492 浏览 评分:9.9
纸张尺寸,递归解决(python) 摘要: lw函数矫正当前长宽 cal函数递归解决,An就是重复折叠n次,n=0时结束 ``` def lw(l,w): return max(l,w),min(l,w) de…… 题解列表 2024年04月12日 2 点赞 0 评论 455 浏览 评分:9.9
T1457Power Strings--KMP 摘要:```cpp #include #include #include using namespace std; const int N=1e6+100; char str[N]; i…… 题解列表 2024年04月12日 0 点赞 0 评论 290 浏览 评分:0.0
信息学奥赛一本通T1437-扩散 摘要:解题思路: 二分+并查集注意事项:参考代码:#include <iostream>#include <algorithm>using namespace std;#define int long lo…… 题解列表 2024年04月12日 0 点赞 0 评论 371 浏览 评分:0.0