1731: 二叉树 解题思路:利用递归思路,和满二叉树的性质,一个结点的左孩子会等于该节点i*2右孩子会等于i*2+1,而左孩子又会有左右孩子,右孩子也会有左右孩子则可以利用递归,递归的出口就是左孩子都右孩子大于n利用count变量来记录注意事项:参考代码:#include#include 题解列表 2024年05月23日 0 点赞 0 评论 540 浏览 评分:0.0 蓝桥杯2022年第十三届决赛真题-最大数字 解题思路:位数相同的数字大小关系取决于不同最高位的大小有关,所以我们可以先找从最高位到低位最多有多少位可以变成9观察数据发现数字n最多是1E17,也就是17位用dfs不会超时对于剩余的A和B操作次数B:可以遍历剩余的位数看看是否能将某一位变成9(高位优先)A:直接在剩余位数的最高位加上剩余的A操作次数 题解列表 2024年05月23日 0 点赞 0 评论 901 浏览 评分:10.0 1951:求平方和 摘要:参考代码:#include<stdio.h>#include<math.h>int main(){int a=3;int b=4; scanf("%d%d",&a,&b); printf(…… 题解列表 2024年05月23日 0 点赞 0 评论 947 浏览 评分:9.9 1048字符串拷贝(strncpy函数的使用) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int n; scanf("%d ",&…… 题解列表 2024年05月23日 0 点赞 0 评论 709 浏览 评分:0.0 1049时间设计(结构体实现) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct shijian{ int nian; int yue; int ru;}shijian;int main(…… 题解列表 2024年05月23日 0 点赞 0 评论 450 浏览 评分:0.0 1050成绩记录 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct student{ char xuehao[20]; char xinming[20]; int a; in…… 题解列表 2024年05月23日 0 点赞 0 评论 409 浏览 评分:0.0 1051成绩统计2 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct student{ char xuehao[20]; char xinming[20]; int a; in…… 题解列表 2024年05月23日 0 点赞 0 评论 427 浏览 评分:0.0 编写题解 2814: 正常血压 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int n,a,b,s=0,max=0; cin>>n; fo…… 题解列表 2024年05月23日 0 点赞 0 评论 605 浏览 评分:0.0 求长方形面积 摘要:参考代码:#include<stdio.h>int main(){ int a,b; int C=0,S=0; scanf("%d%d",&a,&b); C=2*(a+b); S=a*b; print…… 题解列表 2024年05月24日 0 点赞 1 评论 1287 浏览 评分:6.0 1075: 台球碰撞 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cmath> using namespace std; double l,w,x,y,r,a,v,s; i…… 题解列表 2024年05月24日 1 点赞 0 评论 586 浏览 评分:9.9 « 12...5377537853795380538153825383...59105911 »
蓝桥杯2022年第十三届决赛真题-最大数字 解题思路:位数相同的数字大小关系取决于不同最高位的大小有关,所以我们可以先找从最高位到低位最多有多少位可以变成9观察数据发现数字n最多是1E17,也就是17位用dfs不会超时对于剩余的A和B操作次数B:可以遍历剩余的位数看看是否能将某一位变成9(高位优先)A:直接在剩余位数的最高位加上剩余的A操作次数 题解列表 2024年05月23日 0 点赞 0 评论 901 浏览 评分:10.0
1951:求平方和 摘要:参考代码:#include<stdio.h>#include<math.h>int main(){int a=3;int b=4; scanf("%d%d",&a,&b); printf(…… 题解列表 2024年05月23日 0 点赞 0 评论 947 浏览 评分:9.9
1048字符串拷贝(strncpy函数的使用) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int n; scanf("%d ",&…… 题解列表 2024年05月23日 0 点赞 0 评论 709 浏览 评分:0.0
1049时间设计(结构体实现) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct shijian{ int nian; int yue; int ru;}shijian;int main(…… 题解列表 2024年05月23日 0 点赞 0 评论 450 浏览 评分:0.0
1050成绩记录 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct student{ char xuehao[20]; char xinming[20]; int a; in…… 题解列表 2024年05月23日 0 点赞 0 评论 409 浏览 评分:0.0
1051成绩统计2 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct student{ char xuehao[20]; char xinming[20]; int a; in…… 题解列表 2024年05月23日 0 点赞 0 评论 427 浏览 评分:0.0
编写题解 2814: 正常血压 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int n,a,b,s=0,max=0; cin>>n; fo…… 题解列表 2024年05月23日 0 点赞 0 评论 605 浏览 评分:0.0
求长方形面积 摘要:参考代码:#include<stdio.h>int main(){ int a,b; int C=0,S=0; scanf("%d%d",&a,&b); C=2*(a+b); S=a*b; print…… 题解列表 2024年05月24日 0 点赞 1 评论 1287 浏览 评分:6.0
1075: 台球碰撞 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cmath> using namespace std; double l,w,x,y,r,a,v,s; i…… 题解列表 2024年05月24日 1 点赞 0 评论 586 浏览 评分:9.9