蓝桥杯2024年第十五届省赛真题-训练士兵 摘要:解题思路:按照训练次数从小到大排序, 从训练次数少的开始枚举,贪心找单独训练还是组团训练注意事项:参考代码:#include <bits/stdc++.h> #define int long lon…… 题解列表 2024年04月18日 16 点赞 0 评论 3450 浏览 评分:8.4
: 三角形最佳路径问题 摘要:解题思路:三角形最佳路径经典DP, f[i][j]表示到达i行j列的最佳路径注意事项:参考代码:#include<iostream> #include<algorithm> using names…… 题解列表 2024年04月18日 0 点赞 0 评论 330 浏览 评分:9.9
回文数组(贪心) 摘要:解题思路:贪心,优先操作相邻的两个数注意事项:数据需要开long long,否则只能只能过部分数据参考代码:#include#include#includeusing namespace std;ty…… 题解列表 2024年04月18日 1 点赞 0 评论 647 浏览 评分:9.9
信息学奥赛一本通T1267-01背包问题 摘要:解题思路:f[j] j背包重量得到的最大价值注意事项:当j 大于等于第i物品的重量时,更新f[j]参考代码:#include<iostream> #include<algorithm> using…… 题解列表 2024年04月18日 0 点赞 0 评论 209 浏览 评分:9.9
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码:def function(a, b): c = min(a, b) max_GCD = 0 for i in range(1, c + 1)…… 题解列表 2024年04月18日 0 点赞 0 评论 442 浏览 评分:0.0
自定义函数处理素数 摘要:解题思路:注意事项:参考代码:def function(x): for i in range(2, x): if x % i == 0: &nbs 题解列表 2024年04月18日 0 点赞 0 评论 782 浏览 评分:0.0
二维数组的转置 摘要:解题思路:注意事项:参考代码:def function(arr): list = [] for j in range(3): str = "" 题解列表 2024年04月18日 0 点赞 0 评论 382 浏览 评分:0.0
自定义函数之字符提取 摘要:解题思路:注意事项:参考代码:def function(x): aeiou = "aeiou" str = [] for i in x: if i 题解列表 2024年04月18日 0 点赞 0 评论 205 浏览 评分:0.0
自定义函数之数字分离 摘要:解题思路:注意事项:参考代码:def function(x): return print(' '.join(x)) if __name__ == '__main…… 题解列表 2024年04月18日 0 点赞 0 评论 226 浏览 评分:0.0
自定义函数之字符类型统计 摘要:解题思路:注意事项:参考代码:def function(x): a, b, c, d = 0, 0, 0, 0 for i in x: if i.isalpha(…… 题解列表 2024年04月18日 0 点赞 0 评论 388 浏览 评分:0.0