- 博客(22)
- 收藏
- 关注
原创 算法-Mooc-浙江大学
1.算法的概念 一个有限指令集 接受一些输入(有时不需要输入) 产生输出 在有限步骤之后终止 每一条指令必须: <1>.有充分目标,不可以有歧义 <2>.计算机能处理的范围内 <3>.描述不依赖任何一种计算机语言以及具体实现手段 2.评判好算法指标 空间复杂度S(n):程序执行时占用存储单元的长度 时间复杂度T(n):程序执行时耗费时间的长度 3.分析算法好坏所关注的复杂度 最坏情况复杂度(一般分析这个) 平均复杂度 4.复杂度排序 tips: logn不写
2021-11-14 11:51:19
274
原创 1.什么是数据结构-mooc-浙江大学
1.什么是数据结构 数据对象在计算机中的组织方式 数据对象必定与一系列加在其上的操作相关联 完成这些操作的方法及算法 2.抽象数据类型(Abstract Data Type) 数据类型 数据对象集 数据集合相关联的操作集 抽象 描述数据类型的方法不依赖于具体实现 tips:ElementType:通用数据类型 3.clock函数 clock():捕捉从程序开始被调用到所耗费的时间 时间单位:clock tick,即时钟打点 常数CLK_TCK:机器时钟每秒所走的时钟打点数 c++调用clock函数
2021-11-13 21:13:30
598
原创 命令方式:window向linux传文件
备注:查看命令直接看2.2 1.获取linux的ip ifconfig 如下图蓝色处为ip,例格式为:192.168.163.122 2. 打开window下cmd 1.在cmd下切换到上传文件的目录: 例:上传文件为d盘的mm.jar 2.cmd下输入命令 scp mm.jar [email protected]:/up/ mm.jar -----------------------...
2020-01-09 19:26:55
3523
原创 csp_分蛋糕_c++
题目: ## 测试数据: 6 9 2 6 5 6 3 5 代码: #include<iostream> using namespace std; int cake[1001]; int main(){ int n,k,fnum=0,sum=0; cin>>n>>k; for(int i=0;i<n;i++){ cin>>cake...
2019-10-30 18:49:08
405
原创 csp_打酱油_c++
题目: ## 测试数据: 40 80 代码: #include<iostream> using namespace std; int main(){ int inpu,sum=0,fnum,tnum; cin>>inpu; fnum = inpu/50;//买5瓶的个数 inpu %= 50; tnum = inpu/30;//买3瓶的个数 inp...
2019-10-30 18:16:06
281
原创 csp_最小差值_c++
题目: ## 测试数据: 5 9 3 6 1 3 5 1 5 4 8 20 代码: #include<iostream> #include<algorithm> using namespace std; int arr[1001]; int main(){ int num,min = 10000,temp; cin>>num; for(int i=...
2019-10-30 18:02:14
276
原创 csp_跳一跳_c++
题目: ## 测试数据: 1 1 2 2 2 1 1 2 2 0 代码: #include<iostream> using namespace std; int arr[30]; int main(){ int addnum = 0; int sum =0;//sum赋0,否则最后sum值错误 for(int i=0;i<30;i++){ cin>>...
2019-10-30 17:31:00
257
原创 csp_小明上学_c++
题目 ## 测试数据 30 3 30 8 0 10 1 5 0 11 2 2 0 6 0 3 3 10 0 3 代码: #include<iostream> using namespace std; int main(){ int r,y,g,n,sum; cin>>r;cin>>y;cin>>g; cin>>n; int i...
2019-10-30 16:55:07
272
原创 csp_小中大_c++
题: ## 测试数据 3 -1 2 4 4 -2 -1 3 4 代码: #include<iostream> #include<cmath> using namespace std; int arr[10000001];//失分点1------子任务定义10^7,若没有会扣20分 int main(){ int inNum,max,midi,min;//中间值输...
2019-10-29 22:27:28
294
原创 csp_小明种苹果1_c++
## 测试数据 ```cpp 3 3 73 -8 -6 -4 76 -5 -10 -8 80 -6 -15 0 输出:167 2 23 2 2 10 -3 -1 15 -4 0 输出:17 1 4 ## 代码 ```cpp #include<iostream> using namespace std; int inpu[1001][1001]; int rowsum[1001...
2019-10-28 11:52:02
240
原创 姓名+成绩-排序-C++
姓名+成绩-排序-C++ #include<iostream> using namespace std; //学生结构体 struct student{ char name[20]; int score; }; int main(){ struct student stu[100],temp; int num; //输入信息 cout<<"人数为:"; c...
2018-11-26 19:39:45
3938
1
原创 冒泡算法-排序-C++
冒泡-排序-c++ #include&amp;amp;lt;iostream&amp;amp;gt; using namespace std; int main(){ int num,str[100],input,temp; //输入一串数 cout&amp;amp;lt;&amp;amp;lt;&amp;quot;数个数:&amp;quot;; cin&amp;amp;gt
2018-11-26 18:53:55
118
原创 桶算法-排序-C++
桶算法-排序-C++ #include<iostream> using namespace std; int main(){ int book[10],num,input; //0初始化 for(int i=0;i<10;i++){ book[i]=0; } //提示输入个数 cout<<"输入个数: "; cin>>num; cou...
2018-11-26 12:59:20
280
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人