自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 Java生成token

Java生成token

2022-11-09 20:25:06 175 1

原创 解决idea新建project没有JavaEE问题

可能的原因:未在pom.xml 导入应有的坐标

2022-07-09 17:19:25 674

原创 L2-020 功夫传人

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805059118809088第一次用堆栈处理的(好麻烦,还是菜)#include<iostream>#include<queue>#include<vector>using namespace std;int main(){ int n,k; double z,r,sum = 0.0; scanf("%d %lf %.

2022-04-09 12:58:35 211

原创 L2-019 悄悄关注

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805059731177472题目简单但想用STL (但不熟练查半天资料)#include<iostream>#include<map>using namespace std;map<string,int> cnt;//用map存所有用户,已关注的设-1,如果点赞列表有关注的用户则不变。 int main(){ int n,

2022-04-08 10:59:48 202

原创 L2-012 关于堆的判断

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805064676261888堆的应用:(注意处理4个条件)#include<iostream>#include<vector>using namespace std;int n;vector<int> v; //记录堆 void updata(int i){ // 更新堆,生成小堆顶 if(i == 1) return

2022-04-01 11:32:04 54

原创 L2-011 玩转二叉树

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805065406070784思路:已知前序中序,与求后序一致,新增形参index,记录位置,题目要求反转,(开始的节点从1开始)左子树 为index*2+1,右子树为index*2.(如果开始的节点为0)左子树为index*2+2,右子树为index*2+1. (注意记录层状的空间要大,最后的测试点可能为一侧子树(一边倾)导致数字过大)#include<iost

2022-03-31 11:03:09 1231

原创 string 和 int 及 stringstream

调用stringstream头文件#include <sstream>int 转 string:1.to_string int a = 18; string s = to_string(a); cout << s;2.streamstringstream stream; string s; int n = 1; stream << n; stream >> s;string 转 intstreamst

2022-03-28 11:52:55 307

原创 L2-007 家庭房产

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805068539215872并查集的复习:int father[10000];//一个大的集合//开始前初始化//设1每个节点的父节点都是自己//2或者都设为-1 //查找,返回节点的祖宗 int find(int x){ whlie(x != father[x]){ x = fatehr[x]; } return x;}//把a,b的祖宗

2022-03-27 15:49:35 252

原创 L2-006 树的遍历

首先回顾一下已知后续和中序求前序:#include <iostream>using namespace std;int post[] = {3, 4, 2, 6, 5, 1};int in[] = {3, 2, 4, 1, 6, 5};void pre(int root, int start, int end) { if(start > end) return ; int i = start; while(i < end && i

2022-03-26 11:17:37 1273

原创 L2-005

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805070149828608该代码最后测试点超时(应该是数据较多频繁调用set导致)#include<iostream>#include<vector>#include<set>using namespace std;int main(){ int n,k,m,temp,a,b; scanf("%d",&n);

2022-03-25 15:33:40 61

原创 L2-004 这是二叉搜索树吗?

题目:https://pintia.cn/problem-sets/994805046380707840/problems/994805070971912192首先是建树做法(没有去添加镜像,导致有两个点没过)#include<iostream>#include<vector>using namespace std;vector<int> v,pre;int n;bool f = false;//建树 typedef struct TNode

2022-03-24 14:33:18 149

原创 L2 - 001

Dijkstra算法适用于边权为正的情况,用于计算正权图的单源最短路,即从单个源点出发,到所有节点的最短路。同时适用于有向图和无向图。模板://处理图....begin为起点 int n,begin; int chart[][],path[];//chart为图 path[i]为起点到i的距离 bool visit[]; //是否被访问 //初始化 起点为path为0 memset(visit,0,sizeof(visit)); for(int i = 0;i <

2022-03-23 09:05:26 88

原创 L2-002 链表去重

先浅浅记录一下:#include<iostream>#include <cmath>using namespace std;int Key[100005],Next[100005],Out[100005],Next2[100005];bool Judge[100005];int main() { int begin,n; cin >> begin >> n; int a,b,c; for(int i = 0;i < n;i+

2022-03-22 18:30:36 1544

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除