简单易懂方法,回文子串 摘要:解题思路:注意事项:参考代码:s = input().strip() num,num1 = [],[] n = 2 for i in range(len(s)): for j in r…… 题解列表 2024年04月07日 0 点赞 0 评论 258 浏览 评分:6.0
递归解法~~~~~~~~ 摘要:参考代码:def charge(n, summ): a = n // 3 b = n % 3 summ += a if (a + b) < 题解列表 2024年04月08日 0 点赞 0 评论 475 浏览 评分:6.0
编写题解 2600: 蓝桥杯2020年第十一届国赛真题-重复字符串,简单求解 摘要:# 从标准输入读取一个整数n,并存储在变量n中 n = int(input()) # 从标准输入读取一个字符串s,并存储在变量s中 s = input() # …… 题解列表 2024年04月10日 0 点赞 1 评论 342 浏览 评分:6.0
DFS,最优解 摘要:解题思路:本题可以用dij算法,但是我感觉dfs更好想,要求最短路径,用递归的话,如果去第2个城市,之前已经去过了,再去一边结果是相同的,所以最优解就是每个城市只去一次,用bool f[N]来判断,然…… 题解列表 2024年04月12日 0 点赞 1 评论 333 浏览 评分:6.0
信息学奥赛一本通TT1262-挖地雷 摘要:解题思路:DP 逆推, 邻接矩阵注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const int N…… 题解列表 2024年04月16日 0 点赞 0 评论 223 浏览 评分:6.0
究极空间换时间之无脑枚举 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=1e5+10;int a0[N],a1[N],a2[N],a…… 题解列表 2024年04月16日 0 点赞 0 评论 347 浏览 评分:6.0
python--study||O.o 摘要:参考代码:# 重点就是判断条件的顺序 n = int(input()) square = [[0] * (2 * n - 1) for _ in range(2 * n - 1)] x, y…… 题解列表 2024年04月19日 0 点赞 0 评论 285 浏览 评分:6.0
3044: 电池的寿命 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<algorithm> #include<utility> #include<limits> #inclu…… 题解列表 2024年04月20日 0 点赞 0 评论 254 浏览 评分:6.0
2804: 与指定数字相同的数的个数 摘要:解题思路:注意事项:千万别抄,会遭报应的参考代码:#include <iostream>using namespace std;typedef long long ll;const int N=1e7…… 题解列表 2024年04月21日 1 点赞 0 评论 273 浏览 评分:6.0
[递归]母牛的故事(动态规划,递归) 摘要:解题思路:写出数学表达式 F(x){ x<=3 f(x)=x;// 前三年只有一头母牛生孩子 &nbs 题解列表 2024年04月27日 0 点赞 0 评论 300 浏览 评分:6.0