3156: 蓝桥杯2023年第十四届省赛真题-景区导游 摘要:解题思路:利用公式dis[a]-dis[b]-2*dis[lca(a,b)]求出a与b之间的距离,dis为此节点到根节点的距离注意事项:参考代码:#include<bits/stdc++.h> us…… 题解列表 2024年04月18日 0 点赞 0 评论 397 浏览 评分:0.0
信息学奥赛一本通T1268-完全背包问题 摘要:解题思路:完全背包注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const int N = 2e2 …… 题解列表 2024年04月18日 0 点赞 0 评论 150 浏览 评分:9.9
可能好理解的 摘要:解题思路:注意事项:参考代码:import java.util.Scanner; public class Main { public static void main(String[…… 题解列表 2024年04月18日 0 点赞 0 评论 298 浏览 评分:9.9
自定义函数之数字后移 摘要:解题思路:注意事项:参考代码:n = int(input()) arr = list(map(str, input().split())) m = int(input()) print('…… 题解列表 2024年04月18日 0 点赞 0 评论 430 浏览 评分:0.0
大盗阿福(记忆化搜索) 摘要:解题思路:注意事项:运用递归时注意运行时间,采用记忆化搜索可有效避免运行时间超限(即用一串数组来记录递归出来的数据)参考代码:#include<stdio.h>#include<stdlib.h>in…… 题解列表 2024年04月18日 0 点赞 0 评论 256 浏览 评分:9.9
自定义函数之整数处理 摘要:解题思路:注意事项:先交换大的,再交换小的。参考代码:arr = list(map(int, input().split())) max_number = max(arr) min_number …… 题解列表 2024年04月18日 0 点赞 0 评论 641 浏览 评分: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 评论 357 浏览 评分:0.0
自定义函数之数字分离 摘要:解题思路:注意事项:参考代码:def function(x): return print(' '.join(x)) if __name__ == '__main…… 题解列表 2024年04月18日 0 点赞 0 评论 194 浏览 评分:0.0
自定义函数之字符提取 摘要:解题思路:注意事项:参考代码:def function(x): aeiou = "aeiou" str = [] for i in x: if i 题解列表 2024年04月18日 0 点赞 0 评论 175 浏览 评分:0.0
二维数组的转置 摘要:解题思路:注意事项:参考代码:def function(arr): list = [] for j in range(3): str = "" 题解列表 2024年04月18日 0 点赞 0 评论 346 浏览 评分:0.0