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