题解列表
c++,整数比较的三种办法
摘要:方法1 (最简单)if-else语句#include <iostream>using namespace std;int main() { int a, b; cin >……
综合求和练习简单解法
摘要:解题思路:注意事项:注意小数运算的精度问题参考代码:#include<stdio.h>int main(){ int a,b,c,i,t,r,q,w; double p,e; scanf(……
1046:使用万能头文件+指针,简单易懂
摘要:```cpp#include //使用万能头文件,竞赛用着快,写平常的程序不要用using namesapce std;void RemoveArray(int a[],int* b,in……
题解 3031: 分解因数
摘要:解#include<stdio.h>int count=1;int fun(int n,int fenjieyinzi){ for(int i=fenjieyin……
c++利用函数封装来判断的两种方法
摘要:方法1函数带参数#include <iostream>using namespace std;string reply(int n) { if (n > 0) { return&n……
蓝桥杯2023年第十四届省赛真题-砍树 LCA+树上差分
摘要:解题思路:我们先把ai和bi之间的路进行差分处理,然后遍历还原,最后对几条边进行遍历,如果它被m条路径覆盖了,则统计,没有任何满……
蓝桥杯2023年第十四届省赛真题-景区导游 LCA+前缀和
摘要:解题思路:定义 tp[i]代表点i距离根节点的边权之和题目要求输出的是跳过点i后乘车的时间,所以可以提前求出乘车的总时间,在便利……
编写题解 2002: 计算数字个数(python)
摘要:解题思路:非数字转换成整型会报错,就用except跳过参考代码:str1 = input()j = 0for i in range(len(str1)): try: ……
简单c++,计算多项式的值
摘要:#include <iostream>#include <cmath>#include <iomanip>using namespace std;int main(……