1217: 换位置(c语言)(提供思路) 摘要:解题思路:如果人数为偶数i个,可以化归为两个i/2的人只能单向换顺序,我们已知将a个人排成长队逆序需要(a-1)*a/2次,所以共需要(i/2-1)*(i/2)次;如果人数为奇数i个,化归为i-1个人…… 题解列表 2022年08月14日 0 点赞 0 评论 782 浏览 评分:9.9
[编程入门]二进制移位练习 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>#include<cmath>using namespace std;vector<int> arr;…… 题解列表 2022年08月14日 0 点赞 0 评论 515 浏览 评分:9.9
函数解决选择排序 摘要:解题思路:快速排序的思想类似与打擂台(反着的打擂台),通过对数组遍历找到最小的一个元素,用一个变量来保存最小元素的下标,之后在和第一个元素交换,然后对第二个元素进行同样的操作。注意事项:参考代码:#i…… 题解列表 2022年08月14日 0 点赞 0 评论 500 浏览 评分:9.9
题目 1022: [编程入门]筛选N以内的素数 摘要:解法:线性筛 时间复杂度:$$O(n)$$ ```cpp #include using namespace std; int n, prime[1005], st[1005], k = 0;…… 题解列表 2022年08月14日 0 点赞 0 评论 557 浏览 评分:9.9
动态数组指针C语言题解 摘要:解题思路:注意事项:参考代码:#include<malloc.h>typedef struct student{ char num[100]; char name[100]; int…… 题解列表 2022年08月14日 0 点赞 0 评论 421 浏览 评分:9.9
未知定理的情况下,通过简单列出2个数依照题意拆分寻找出规律 摘要:解题思路:在未知定理的情况下依照题目,可以先行求出该连续奇数中的中间值即pow(m,2),通过比较第一个奇数与中间值,最后一个奇数与中间值的大小发现规律如当m=13时,pow(m,2)=169,pow…… 题解列表 2022年08月14日 0 点赞 0 评论 401 浏览 评分:9.9
数组的距离-Python 摘要:解题思路: 没有技巧,直接全部算出来取最小哈哈,说下代码思路 以a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 为例(ai, bi, i=1,2,3,4,5) …… 题解列表 2022年08月14日 0 点赞 1 评论 419 浏览 评分:9.9
编写题解 1098: 陶陶摘苹果(c语言 看题解都比较麻烦,写一个基础简单的) 摘要:解题思路:正常的数组的输入与输出注意事项:不要被题目中的30厘米迷惑了,直接加上去就行参考代码:#include<stdio.h> int main(){ int a[10],i,n,c…… 题解列表 2022年08月15日 0 点赞 0 评论 868 浏览 评分:9.9
二级C语言-分段函数 摘要:参考代码:#include<iostream>#include<iomanip>using namespace std;int main(){ double x; cin>>x; i…… 题解列表 2022年08月15日 0 点赞 0 评论 730 浏览 评分:9.9
二级C语言-计负均正 摘要:```cpp #include #include using namespace std; int main() { int a[21],as=0,bs=0,bss=0; …… 题解列表 2022年08月15日 0 点赞 0 评论 761 浏览 评分:9.9