- 博客(30)
- 收藏
- 关注
原创 leetcode周赛
leetcode周赛70周双周赛(2/4)第三题 5973. K Highest Ranked Items Within a Price Range70周双周赛(2/4)第三题 5973. K Highest Ranked Items Within a Price Rangehttps://leetcode-cn.com/problems/k-highest-ranked-items-within-a-price-range///learn//tuple//auto [steps, i, j.
2022-01-23 00:43:56
1741
原创 Leetcode之路(2)
文章目录图论BFS课程表 ⅡDFS课程表 Ⅱ记忆化搜索329 矩阵中的最长递增路径DP数字序列最长上升子序列最长上升子串图论BFS建图:a->b代表a为b的先决条件/*用一个数组来记录每个节点的入度首先将入度为0的节点入队把队头的节点取出压栈(res),将他的邻接点入度全部--,如果--后入度为0,将该邻接点入队若队列空后,仍有节点入度>0,即为环*//*邻接表建图:只留存在边的点也是一个二维的vector第一维为起始点,每一维对应的一个vector<edge.
2021-03-17 18:49:16
388
原创 笔试题(不在leetcode中的)
文章目录排序输出全部排序情况素数暴力判断是否为素数排序输出全部排序情况 vector<int> x; sort(x.begin(),x.end()); do { //每一次排序的情况 }while(next_permutation(x.begin(),x.end()));素数暴力判断是否为素数bool iz(int x){ for(int k=2;k*k<=x;k++) { if(x%k==0).
2021-03-15 20:25:46
235
原创 面向牛客的输入输出总结
面向牛客的输入输出总结int类1(典型)2(典型)3(典型)4567string12(重点)3(重点)输入输出典型题链接int类1(典型)#include<bits/stdc++.h>using namespace std;int main(){ int a,b; while(cin>>a>>b) { cout<<a+b<<endl; }}2(典型)#include<
2021-02-15 22:48:04
164
原创 手动实现vector
实现vector的思想和方法实现思想:通过realloc(malloc)动态申请内存(malloc主要用作初始化)申请的空间命名为cap,实际vector存储内容的大小为size初始cap=1,size=0push_back()后,size++,若size==cap时,将cap realloc 成2*cappop()后,size–,若size<cap/4,将cap realloc 成cap/2这样的话可以减少申请的次数#include <iostream>#inclu
2021-02-15 12:30:31
336
原创 springboot之路
springboot之路前言初识核心知识前言记录自己学习springboot的过程springboot简介初识如上是一个基本的springboot的框架model包:数据访问层连接后端的数据库controller包:表示层负责朴素版的前端service包:业务逻辑层介于表示层和数据访问层之间,业务逻辑主干的部分test包测试使用,因为开发过程中类很多,直接运行完整程序测试不方便,所以在test里调用想测试的部分即可启动java类与model/controller/servi
2021-01-07 20:11:45
175
1
原创 LeetCode之路
LeetCode之路热题HOT1001 两数之和20 有效的括号热题HOT1001 两数之和leetcode #1 两数之和 应用hash O(1)查找特性 查找target-xclass Solution {public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int,int>hashtable; for
2021-01-06 23:02:12
725
原创 Java之路
一级目录二级目录三级目录提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档文章目录一级目录二级目录三级目录前言一、pandas是什么?二、使用步骤1.引入库2.读入数据总结JavaJava基础教程记录三级标题三级标题四级标题五级标题六级标题前言提示:这里可以添加本文要记录的大概内容:例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。提示:以下是本篇文章正文内容,下面案例可供参考一、pandas是什么?
2021-01-05 20:55:44
174
1
原创 数据结构&算法 (C++) 个人总结
文章目录前言数组stackqueuepriority_queuestringlistvectorsetmapmultimaphashunordered_set关于vector,map,hash中的排序、查找关于vector,map,hash中的赋值fill & memsetcin & getline最小生成树进制转化结构体的建立(一般用不到)数学操作幂细节操作前言STL总结数组strlen(a)//数组长度memset(a,0,sizeof(a));//初始化数组,只能初始化为
2021-01-05 20:55:18
1070
1
原创 pytorch之路
pytorch基础知识自动求导搭建神经网络三级目录基础知识自动求导链接: link搭建神经网络链接: 极简神经网络实现链接: nn.Module链接: nn.Sequential三级目录...
2020-10-30 13:22:59
75
原创 关于STL中的迭代器iter
迭代器//此时iter为迭代器 是一个指针#include<iterator> //必须写 万能库也不包含for(auto iter=mp.begin();iter!=mp.end();++iter){ cout<<iter->first; cout<<(*iter).first}//auto可变换为 map<,...
2020-04-11 23:11:40
219
原创 手写快排 C++
手写快排链接: link.#include <iostream>using namespace std;void quick_sort(int l,int r,int a[]){ if(l>=r) //一定要写 防止l>=r的情况执行最下面的sort return; int cur_x=l; //左端下标 in...
2020-04-11 11:29:10
190
原创 git使用手册
git使用手册样例example1三级目录样例example1git clone git@github.com:XXX/yyy.git 把文件clone到本地cd yyygit checkout dev 切到dev在本地中找到clone下来的文件 把写好的放入git status 查看是否填入git add . add后有空格 将文件填入...
2020-04-04 22:48:42
199
原创 python之路
python之路python基础python模块list tupleif else循环函数python模块二级目录三级目录python面向对象类和实例 继承type() isinstance()实例属性和类属性python基础python模块#输入 输出print(100+200)a=input()print("a:",a)#%print("my number is %d\nm...
2020-04-04 22:27:28
243
1
原创 Enlarge GCD
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<string>#include<cmath>using namespace std;const int maxn = 1.5e7 + 10;int vis...
2019-02-16 12:49:42
180
原创 素数打表判断
void biao(){ memset(f, 0, sizeof(f)); int i, j; f[0]=1; f[1]=1; for(i=2; i<=N; i++) { if(f[i]==0) { for(j=i*2; j<=N; j+=i) { ...
2019-01-27 15:54:02
179
原创 Mysterious Bacteria
质因数分解#include<iostream>#include<cstring>#include<algorithm>#include<cmath>#include<cstdio>using namespace std;int a[1005]; //质因子int b[1005]; //质因子的个数const int ...
2019-01-26 20:39:44
140
原创 poj 1601
扩展欧几里得#include<iostream>#include<cstring>#include<cmath>#include<algorithm>#include<cmath>using namespace std;long long gcd(long long a,long long b){ if(b==0)...
2019-01-26 00:09:42
131
原创 poj 1456
优先队列 贪心优先队列:每次加入队列 都将最大的放在队首(默认)#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<queue>#include<cmath>using namespace std;str...
2019-01-20 16:31:51
266
原创 hdu1301
克鲁斯卡尔#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;struct node{ int val; int s; int e;} nn[10050];int n, m;int...
2019-01-20 14:19:52
184
原创 hdu2181
dfs#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#include<cmath>using namespace std;int Map[25][25];int point;int book[20];int ans[20];...
2019-01-19 15:28:43
291
2
原创 hduoj 2102 a计划
bfs#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>#include<queue>#include<cmath>using namespace std;typedef struct{ int x; i...
2019-01-19 15:23:38
157
原创 链表的值划分
链表的值划分#include<stdio.h>#include<stdlib.h>typedef int ElemType;typedef struct LNode{ ElemType data; struct LNode *next;} LNode,*Linklist;Linklist Createlist_L(Linklist first,...
2018-09-28 19:07:03
171
原创 多项式加法
多项式加法注释写的我觉得等以后我一定能看懂hhh~~·需要以后注意的是一个结点,只能引出一条指针,但是可以以有很多条指针指过去。#include<stdio.h>#include<stdlib.h>typedef int ElemType;typedef struct LNode{ ElemType coef; //系数 ElemTyp...
2018-09-27 23:24:19
748
原创 单调链表删值
#include<stdio.h>#include<stdlib.h>typedef int ElemType;typedef struct LNode{ ElemType data; struct LNode *next;} LNode,*Linklist;Linklist Createlist_L(Linklist first,int n) ...
2018-09-27 20:35:58
161
原创 链表翻转
链表翻转这是我的第一篇csdn博客,自己在编程方面很菜很菜,写博客第一个目的是为了以后复习的时候可以好好看看自己以前的思路,第二个目的是能让自己对于编程这件事情更有更有仪式感。。。人生要有仪式感,编程也是 。。。对巴。。。。虽然自己目前还很菜,但是希望这个事情自己能一直坚持下去,每一次作业或是自己的想法通过编程实现后,写好注释发上来,也算是对于自己一点点成长的见证。哈哈哈。这个链表翻转主要就...
2018-09-26 23:24:33
673
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人