题解列表
机房 LCA 和 前缀和
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"usingnamespacestd;#definell&nb……
a,b,c=map(int,input().strip().split()) print(int((a+b)/c))
摘要:a,b,c=map(int,input().strip().split())a,b,c=map(int,input().strip().split())print(int((a+b)/c))……
2765计算分数浮点值 c++
摘要:#include <iostream>#include <iomanip>using namespace std;int main( ) { int a, b; double ……
简单c++,计算多项式的值
摘要:#include <iostream>#include <cmath>#include <iomanip>using namespace std;int main(……
编写题解 2002: 计算数字个数(python)
摘要:解题思路:非数字转换成整型会报错,就用except跳过参考代码:str1 = input()j = 0for i in range(len(str1)): try: ……
蓝桥杯2023年第十四届省赛真题-景区导游 LCA+前缀和
摘要:解题思路:定义 tp[i]代表点i距离根节点的边权之和题目要求输出的是跳过点i后乘车的时间,所以可以提前求出乘车的总时间,在便利……
蓝桥杯2023年第十四届省赛真题-砍树 LCA+树上差分
摘要:解题思路:我们先把ai和bi之间的路进行差分处理,然后遍历还原,最后对几条边进行遍历,如果它被m条路径覆盖了,则统计,没有任何满……
c++利用函数封装来判断的两种方法
摘要:方法1函数带参数#include <iostream>using namespace std;string reply(int n) { if (n > 0) { return&n……