自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【编译原理】【词法分析】【正则表达式】【NFA】【DFA】【C++】正则表达式转DFA&NFA,判断字符串是否符合正则表达式的匹配算法

显然,正则表达式、NFA、DFA的概念都很简单,所以直接上代码,注释应该解释地比较清楚,,如果有疑问的可以留言。

2022-10-08 22:55:10 2708 3

原创 阿里云ECS使用Ubuntu配置Springboot

环境安装步骤安装完成之后就可以比较直观的进行操作了查看java版本将文件转移至/usr/tomcat使用管理员权限进入bin目录看到终端中Tomcat started.就安装成功了安装mysql切换到主界面安装数据库检验是否安装成功启动项目nohup means no hang up终止项目执行 命令终止该程序nohup means no hang up终止项目执行 命令终止该程序重新执行......

2022-06-04 17:21:38 199

原创 【算法设计与分析】【C++】斯特拉森Strassen矩阵乘法加速

【算法设计与分析】Strassen矩阵乘法加速矩阵乘法加速原理 ![在这里插入图片描述](https://img-blog.csdnimg.cn/602eb867bcd74ac093fe5481db6694c2.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAVGhlU3VuSW5UaGVNb3JuaW5n,size_16,color_FFFFFF,t_70,g_se,x_16#pic_center

2022-03-14 00:47:04 753 1

原创 线段树例题

1.G - Xenia and Bit Operations#include <bits/stdc++.h>using namespace std;typedef long long ll;#define lson root << 1#define rson root <<1|1const ll MAXN = 1<<17;ll input[MAXN];struct Node{ ll l, r ; ll val,

2021-05-17 20:23:32 79

原创 基础数据结构之线段树

定义root 为根节点lson 为左子节点 (#define lson root <<1 )rson为右子节点 (#definr rson root <<1 | 1)线段树中的重要内容1、定义结构体struct Node{ ll l, r ; ll val, lazy;} tr[10*MAXN];定义 l r 代表 tr[x] 包含了从tr[ x ].l ~ tr[ x ].r的信息val是该节点的值lazy是为了进行区间操作的优化

2021-04-20 19:57:23 132

原创 动态规划

0/1背包#include<bits/stdc++.h>using namespace std;int dp[30000] ,w[30000] , k[1000] ;int main(){ int N , n , a, b; cin>>N>>n; for(int i=1 ; i<=n ; ++i){ cin>>a>>b; k[i]=a; w[i]=a*b; } for(int i=1 ; i<=n ;

2020-12-26 15:37:01 54

原创 dp

dp[i][j] = dp[i][j] + dp[i-1][j-i]

2020-12-18 10:27:08 67

原创 7-7 PAT排名汇总 (25分)

将结构体塞到优先队列里面去#include <iostream>#include <algorithm>#include <cmath>#include <cstdio>#include <fstream>#include <iomanip>#include <deque>#include <vector>#include <string>#include <cstring&

2020-12-09 18:16:01 441

原创 并查集/带权并查集/离散化

#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>#define IOS std::ios::sync_with_stdio(0) , cin.tie(0);using namespace std;const int maxn = 5e4 + 5;int fa[maxn], Rank[maxn], num[maxn], N, M, cnt, n; //

2020-12-07 16:46:39 113

原创 USACO Training 1.3.4 Prime Cryptarithm

#include <iostream>#include <iomanip>#include <fstream>#include <cstdio>#include <cstring>#include <string>#include <algorithm>#include <cmath>using namespace std;int a1[33] , a2[11];int b[11];int

2020-11-25 22:39:32 70

原创 Trivial Things (杂七杂八的东西)

求string长度s.length()

2020-11-10 19:11:58 261

原创 对于二维数组(字符串)的变换(平移/旋转)

P1205 [USACO1.2]方块转换 Transformations#include <bits/stdc++.h>using namespace std;char a[20][20];char b[20][20];char c[20][20];int n;bool rotate1 (void){ for(int x=1 ; x<=n ; ++x){ for(int y=1 ;y<=n ;++y){ if (b[y][n-x+1] != a[x][y

2020-11-10 18:53:57 529

原创 (字符串连接)P1320 压缩技术(续集版)

#include<bits/stdc++.h>using namespace std;char a[300] , b[50000];int main(){ int n ,sum=0 , num ; scanf("%s" , &a); n=strlen(a); strcat(b,a); for(int i=2 ; i<=n ;++i){ scanf("%s",&a); strcat(b

2020-11-08 20:34:59 230 1

原创 数组越界

P1789 【Mc生存】插火把#include <bits/stdc++.h>using namespace std;const int MAXN=0x3f3f3f;int a[1000][1000];void fire(int x , int y){ for(int i=x-2 ; i<=x+2 ; ++i){ if(i<0) continue; //本来没有判断是否越界 ,输入1的时候i就是 // -1直接运行不

2020-11-08 15:35:52 121

原创 优美幻方(自夸)

这是我自己觉得长得比较好看的题解幻方#include<bits/stdc++.h>using namespace std;int a[40][40];int rightr(int x , int n){ if(x==1) return n; else return x-1;}int rightc(int x , int n){ if(x==n) return 1; else return x+1;}int down(int x , int n){ if(x==n) r

2020-11-05 12:09:35 58

原创 2020-11-03

一道水题P5729 【深基5.例7】工艺品制作这个可以但是这个不可以

2020-11-03 20:27:20 43

原创 2020-10-31

没想到斐波那契数列翻车了#include<bits/stdc++.h>using namespace std;double Fn(int x){ if(x==1) return 1; if(x==2) return 1; return ( Fn(x-1)+ Fn(x-2) );}long long a[100];int main(){ int n; cin>>n; a[1]=1; a[2]=2; if( n==1 || n==2) cout<&lt

2020-10-31 10:59:25 52

原创 2020-10-24

因为 151 既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。写一个程序来找出范围 [a,b] (5 \le a < b \le 100,000,000)a,b( 一亿)间的所有回文质数。#include <bits/stdc++.h>using namespace std;bool huiwen(int x){ int y=x,s=0; while( y!=0 ){ s = s*10 + y%10; y /= 10; } if

2020-10-24 23:35:51 63

原创 2020-10-24

#include<bits/stdc++.h>using namespace std;const long long MAXN=0x3f3f3f;int a[MAXN];int b[MAXN];int main(){ long long minn=0,maxn=0,n,p,k,h=0; cin>>n; minn=pow(10,n-1); maxn=pow(10,n); for(int i=minn ; i<=maxn ;++i){ p=i.

2020-10-24 20:12:22 64

原创 2

#include <iostream>int main (){cout<<"三角形没有考虑边长大于等于零。很烦,自以为输入的数据会是正整数";cout<<"int a[xxx]";cout<<"之后又 int a;然后出错,各种变量的名字不能搞混";return 0;}...

2020-10-24 20:10:52 62

原创 2020-10-16

过滤多余空格#include#include#include#includeusing namespace std;int main(){char st[1000];while(scanf("%s",st)==1)printf("%s ",st);return 0;}st[1000]定义了字符组,但是%s是字符串,而且 st 后面为什么没有数字

2020-10-24 20:10:19 39

原创 2020-10-16

在strcpy那一段就看不懂他要干什么了#include#include#include#include#includeusing namespace std;int main(){char t[21], cname[11][20];for(int i = 1 ; i < = 10 ; ++ i)gets ( cname [i] ) ;for(int i = 1 ;i < = 9 ;++ i ){ int k=i; for(int j =i+1 ;j<=10 ;

2020-10-24 20:10:10 61

空空如也

空空如也

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

TA关注的人

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