
c语言
Fooooooo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
第十三届蓝桥杯大赛软件赛省赛C/C++类B组
Python写个循环遍历判断 除法 每个点两边最大距离 随便写的,做错了 #include<iostream> #include<algorithm> #include<cmath> using namespace std; #define int long long #define p 1000000007 int n; int lena,lenb; int a[100010], b[100010]; signed main() { cin>&..原创 2022-04-10 11:53:59 · 1800 阅读 · 0 评论 -
是否二叉搜索树 (25 分) 函数题
bool IsBST ( BinTree T ) { if(!T) return true; if(!T->Left&&!T->Right) return true; if(T->Left){ if(T->Left->Data>=T->Data) ...原创 2019-12-02 22:55:20 · 376 阅读 · 0 评论 -
标记版冒泡排序
此代码有得有失,他的时间复杂度根据数据内容变化,最高会比普通bubble sort多循环一次,但是他只会循环到排完序后多一次。 void bubbleSort(int arr[], int n) { int i,temp,flag=1; while(flag==1){ flag=0; for(i=0;i<n-1;i++){ if(arr[i]>arr[i+1]){ ...原创 2019-11-16 20:14:36 · 291 阅读 · 0 评论 -
邻接表存储图的广度优先遍历
邻接表存储图的广度优先遍历 试实现邻接表存储图的广度优先遍历。 函数接口定义: void BFS ( LGraph Graph, Vertex S, void (*Visit)(Vertex) ); 其中LGraph是邻接表存储的图,定义如下: /* 邻接点的定义 */ typedef struct AdjVNode *PtrToAdjVNode; struct AdjVNode{ ...原创 2019-11-16 14:23:01 · 3623 阅读 · 1 评论 -
Aggressive cows
Aggressive cows Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,00...原创 2019-11-15 16:21:49 · 220 阅读 · 0 评论 -
7-19 韩信点兵 (10 分)
7-19 韩信点兵 (10 分) 在中国数学史上,广泛流传着一个“韩信点兵”的故事:韩信是汉高祖刘邦手下的大将,他英勇善战,智谋超群,为汉朝建立了卓越的功劳。据说韩信的数学水平也非常高超,他在点兵的时候,为了知道有多少兵,同时又能保住军事机密,便让士兵排队报数: 按从1至5报数,记下最末一个士兵报的数为1; 再按从1至6报数,记下最末一个士兵报的数为5; 再按从1至7报数,记下最末一个士兵报的数...原创 2019-10-11 18:32:10 · 1015 阅读 · 0 评论 -
7-8 输出整数各位数字 (15 分)
123456原创 2019-10-11 18:37:08 · 4134 阅读 · 0 评论