求圆的面积 摘要:解题思路: 注意事项:注意要写#include<iomanip>头文件参考代码:#include<iostream>#include<iomanip>using namespace std;int m…… 题解列表 2022年10月23日 0 点赞 0 评论 501 浏览 评分:0.0
[编程入门]矩阵对角线求和,最容易理解的解法,非常暴力 解题思路:注意事项:没有丝毫含金量参考代码:x=list(map(int,input().split()))y=list(map(int,input().split()))z=list(map(int,input().split()))zhu=x[0]+y[1]+z[2]fu=x[2]+y[1]+z[ 题解列表 2022年10月23日 2 点赞 0 评论 1262 浏览 评分:10.0
编写题解 2837: 年龄与疾病 摘要:解题思路:1)定义4个count计数器2)输出%:'%.2f%%'%n注意事项:参考代码:n=int(input()) #病人数目 ages=list(map(int,input()…… 题解列表 2022年10月23日 0 点赞 0 评论 1289 浏览 评分:9.9
逆向思维考虑,五行代码解决!!! 解题思路:首先审题发现要求猴子第一天摘的桃子数,每天吃前一天的(一半+1)个,第N天还剩1个。最后一天是没有吃的,所以往回推第N-1天的桃子为1*2个,第N-2天就是(1*2+1)*2个..............利用循环就可求出第一天的桃子数了注意事项:注意天数N要大于1, 题解列表 2022年10月23日 0 点赞 0 评论 501 浏览 评分:9.9
用while进行解题,易理解的解题思路 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int x; scanf("%d",&x); int a=0; int b=0; …… 题解列表 2022年10月23日 0 点赞 0 评论 556 浏览 评分:9.9
编写题解 1148: C语言训练-计算1977! ```c#include#defineNUM10000#defineN100intmain(){inta[NUM];intdigit=1;for(inti=0;i 题解列表 2022年10月23日 0 点赞 0 评论 494 浏览 评分:0.0 LCA的思想,也就是倍增法,时间复杂度O(Q*logN) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;#define maxn 100010#define maxq 100010int …… 题解列表 2022年10月23日 0 点赞 0 评论 570 浏览 评分:9.9 编写题解 1147: C语言训练-角谷猜想 ```c#includeintGuess(inta){if(a==1)return1;elseif(a%2==0){printf("%d/2=%d\n",a,a/2);a=a/2;returnGuess(a);}//偶数else{printf("%d*3+1=%d\n", 题解列表 2022年10月23日 0 点赞 0 评论 525 浏览 评分:0.0 编写题解 2926: 查找最接近的元素 摘要:解题思路:输入,二分法注意事项:low+1参考代码:#include<stdio.h>int main(){ int n,a[100000],b[100000],i,k,high,low,mid…… 题解列表 2022年10月23日 0 点赞 1 评论 828 浏览 评分:5.5 弱智版自定义函数之字符串反转 摘要:解题思路:第一种解法:先遍历得出字符数组中的字符个数,在用for循环将c[i]元素进行互换 ,比如c[3],c[0]与c[2]互换,c[1]位置不变 第二种解法:将字符串存入…… 题解列表 2022年10月23日 0 点赞 0 评论 456 浏览 评分:0.0 « 12...1844184518461847184818491850...59095910 »
LCA的思想,也就是倍增法,时间复杂度O(Q*logN) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;#define maxn 100010#define maxq 100010int …… 题解列表 2022年10月23日 0 点赞 0 评论 570 浏览 评分:9.9
编写题解 1147: C语言训练-角谷猜想 ```c#includeintGuess(inta){if(a==1)return1;elseif(a%2==0){printf("%d/2=%d\n",a,a/2);a=a/2;returnGuess(a);}//偶数else{printf("%d*3+1=%d\n", 题解列表 2022年10月23日 0 点赞 0 评论 525 浏览 评分:0.0
编写题解 2926: 查找最接近的元素 摘要:解题思路:输入,二分法注意事项:low+1参考代码:#include<stdio.h>int main(){ int n,a[100000],b[100000],i,k,high,low,mid…… 题解列表 2022年10月23日 0 点赞 1 评论 828 浏览 评分:5.5
弱智版自定义函数之字符串反转 摘要:解题思路:第一种解法:先遍历得出字符数组中的字符个数,在用for循环将c[i]元素进行互换 ,比如c[3],c[0]与c[2]互换,c[1]位置不变 第二种解法:将字符串存入…… 题解列表 2022年10月23日 0 点赞 0 评论 456 浏览 评分:0.0