智慧君
智慧君
全部文章
分类
归档
标签
去牛客网
登录
/
注册
智慧君的博客
全部文章
(共11篇)
第七章题解 | #魔咒词典# MAP,字符串!!!
//算法思路:先构建库,然而切分,再次构建Map,最后读取。 //substr(0,2) 取出子串 而且是双闭区间!! //fgets(line,200,stdin) 读入了 \n 换行符 //fgets后面用 line1.pop_back() 去掉最后的\n /* 1.输入 int n,...
2023-04-08
0
341
7.3题解 | MAP #查找学生信息#
//结构体的student,记住字符串是string! 然而string 有别于char! 不用[] //Mymap[键]=实例化 #include<cstdio> #include<string> #include<map> using namespace s...
2023-04-08
0
251
题解 | #哈夫曼树#
//踩坑:1.leaf1,2 pop读取,应该先top再pop //踩坑:2.迭代中,忘了将1,2放入priority中! #include <cstdio> #include<queue> using namespace std; int main() { int ...
2023-04-08
0
236
题解 | #复数集合#
//踩坑 //1. 比较函数,多输入一个*,看来检查代码需要模块化检查 //2. 读懂题目,只要输入一次 n ! 后面都是指令 //3. #include<cstdio> #include <queue> #include<string> using nam...
2023-04-07
0
261
题解 | #二叉搜索树#
//踩坑:1.递归Preorder写错了! //2.idx的++,写成n++ #include <cstring> #include <string> using namespace std; struct Tree { //树的数据结构 注意下面的指针 cha...
2023-04-07
0
341
题解 | #二叉搜索树#
//注意循环for(idx++.不是N++) //注意root2,尽管root2替换为空指针了,但是还是要free掉 #include <cstdio> #include <vector> #include <string> using namespace std...
2023-04-07
0
274
题解 | #第五章:递归n的阶乘#
#大问题-->刚好的子问题-->寻求出口--->保存数据用return #用Long作为返回值,int溢出了 #include <iostream> #include<cstdio> using namespace std; long fun(int n )...
2023-03-23
0
233
题解 | #第四章:vector 的使用---完数VS盈数#
//设置两个动态vector存放数字 //数字的性质判断:sum函数,用sum来判断A是否满足条件 //创建vector的固定格式: vector<int> arr1; 类名 <数据类型> 对象名 //加入: arr1.push_back(数符) //输出: a...
2023-03-18
0
243
题解 | #查找 初级#
#include <iostream> #include<cstdio> #include<algorithm> using namespace std; int main() { int n; int x; int arr[100000...
2023-03-16
0
348
题解 | #成绩排序#
#include <iostream> #include<algorithm> #include<cstdio> using namespace std; struct Student { char name[100]; int grade; ...
2023-03-16
0
327
首页
上一页
1
2
下一页
末页