开心的金明 (C++代码) 摘要:解题思路:注意事项: 直接递归会超时,用上状态转移参考代码:#include<bits/stdc++.h>using namespace std;const int N = 25;int v…… 题解列表 2019年04月18日 0 点赞 0 评论 674 浏览 评分:0.0
蓝桥杯2013年第四届真题-买不到的数目 (C语言代码) 摘要:解题思路:两数之积减两数之和同时两数最大公因数不能大于1注意事项:参考代码:#include<stdio.h>int glc(int a,int b){ if(b==0){ return a; } …… 题解列表 2019年04月18日 0 点赞 1 评论 1307 浏览 评分:7.3
[编程入门]自定义函数处理素数 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int fun(int n){ int i; for(i=2;i*i<=n;i++) if(n%i==0) return 0;…… 题解列表 2019年04月18日 0 点赞 0 评论 620 浏览 评分:0.0
最多约数问题 (C++代码) 摘要:解题思路:类似素数筛的思路一个数是n的约数 那么这个数乘x必定等于n 这样就可以一次求出所有数的因数时间复杂度 O(n*lg(n))注意事项:注意数组大小,1不要去筛 本身不要去筛,浪费时间,反正大家…… 题解列表 2019年04月18日 19 点赞 1 评论 5329 浏览 评分:5.8
The 3n + 1 problem (C语言代码) 摘要:解题思路:注意事项:相信很多人踩雷在了 当输入的n>m的情况上了参考代码:#include <stdio.h>#include <string.h>int main(){ int n,m,i,…… 题解列表 2019年04月18日 0 点赞 0 评论 434 浏览 评分:0.0
[编程入门]自定义函数之字符提取 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int fun(char s[100]){ int i; for(i=0;s[i]!=&…… 题解列表 2019年04月18日 2 点赞 0 评论 938 浏览 评分:0.0
玉龙学长买雪糕 (C语言代码) 摘要:解题思路:水过注意事项:参考代码:#include <stdio.h>#include <string.h>int main(){ int a=1,b,sum=1,n; scanf("%d",&…… 题解列表 2019年04月18日 0 点赞 0 评论 834 浏览 评分:0.0
[编程入门]筛选N以内的素数 (C语言代码)sqrt版 摘要:解题思路:发现题解里竟然少有用sqrt函数的,在此做个补充。用sqrt可以极大地减少复杂度,大大降低内存的占用率参考代码:#include<stdio.h>#include<math.h>int ma…… 题解列表 2019年04月18日 0 点赞 0 评论 765 浏览 评分:0.0
字符串问题 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>int main(){ using namespace std; char a[255]; int …… 题解列表 2019年04月18日 0 点赞 0 评论 1078 浏览 评分:0.0
You are my brother (C语言代码) 摘要:解题思路:贴个代码 不想写注释了注意事项:参考代码:#include<stdio.h>typedef struct node{ int a; int b;} L;L A[1005];int main(…… 题解列表 2019年04月18日 0 点赞 0 评论 1538 浏览 评分:9.9