E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
spaces
【线性dp】【循环查找的优化-> 字典存储 字典dp(dp值表示的是一个集合)】【蓝桥杯14届】接龙数列
只不过这个比较的不是两个值的大小关系,而是最后一个值的数字,和开头的数字是否相等#include#include#include#include#include#pragmaGCCoptize(2)//开O2usingname
spaces
td
编程浩
·
2023-11-29 14:02
蓝桥杯
算法
职场和发展
P9242 [蓝桥杯 2023 省 B] 接龙数列(dp+最长接龙序列+分类)
1.计算0~9为结尾的最长子串长度2.对于每个数字,比较其开头可连接子串长度+1与原来以其末位为末尾的子串长度3.更新以其末位为末尾的子串长度#include#includeusingname
spaces
td
%d%d2
·
2023-11-29 14:58
#
dp算法
蓝桥杯
11.25快速排序细节,sort函数,二分使面积差最小
快速排序i从左边开始,遇到大于等于x的停下来,j遇到小于等于x的停下来,然后如果i#include#include#include#include#includeusingname
spaces
td;intarr
CQU_JIAKE
·
2023-11-29 13:15
算法
算法
数据结构与算法编程题32
统计二叉树中双分支结点(度为2的结点)个数#define_CRT_SECURE_NO_WARNINGS#includeusingname
spaces
td;typedefcharElemType;#defineERROR0
爱发明的小兴
·
2023-11-29 13:00
算法与数据结构
数据结构
数据结构与算法编程题33
统计二叉树中双分支结点(度为2的结点)个数#define_CRT_SECURE_NO_WARNINGS#includeusingname
spaces
td;typedefcharElemType;#defineERROR0
爱发明的小兴
·
2023-11-29 13:24
算法与数据结构
数据结构
位运算详解
对于基本的位运算,我们有一个常用的口诀:1.与&:遇0则02.或|:遇1则13.异或^:相同为0,相异为1.下面是常用的C++位运算符:假设变量A=60,变量B=13测试代码#includeusingname
spaces
td
阿尔法豆
·
2023-11-29 12:04
c++
算法
《算法笔记》第五章源代码
P153#include#includeusingname
spaces
td;boolcmp(inta,intb){returna>b;}voidto_array(intn,intnum[]){for(inti
LuxArcher
·
2023-11-29 12:23
算法笔记学习
算法
c语言
opencv将图片转换为视频
直接上代码,没什么特别的东西#include#includeusingname
spaces
td;usingnamespacecv;intmain(){VideoWritervideo("test.mp4
zeng_haoyu
·
2023-11-29 12:07
opencv
opencv
opencv
【数组】- 如何在C++的数组中查找元素?
输入第一行一个整数m:数的个数(0usingname
spaces
td;intmain(){inta[100],n,i,x;//存放x第一次出现的位置(position),假设没有找到in
小鹏编程
·
2023-11-29 11:30
C++
c++
数组
C++ 查找数组中第k小的数
/**题目描述给定一个整数数组a[0,...,n-1],求数组中第k小数输入描述首先输入数组长度n和k,其中1usingname
spaces
td;intmain(){intn,k;cin>>n>>k;inta
WYXHAHAHA123
·
2023-11-29 11:58
C++
c++使用openssl静态库 实现AES 分片加密 解密
#include#include#include"Iphlpapi.h"#include#includeusingname
spaces
td;#pragmacomment(lib,"Iphlpapi.lib
想做大牛的小白
·
2023-11-29 10:27
c++
windows
openssl
c++
windows
P9231 [蓝桥杯 2023 省 A] 平方差(拆分问题)
分析:x=(y+z)*(y-z);y+z与y-z同奇偶性(x要么为奇数,要么为偶数)奇数:1与其本身乘积偶数:2与x/2乘积(为4的倍数)#includeusingname
spaces
td;intf(intx
%d%d2
·
2023-11-29 10:06
#
数学
蓝桥杯
算法
CF 1901B Chip and Ribbon 学习笔记
链接传送门代码#includeusingname
spaces
td;typedeflonglongLL;constintN=2e5+10;LLa[N],c[N];intmain(){intt;scanf(
三冬四夏会不会有点漫长
·
2023-11-29 09:38
Codeforces
ribbon
学习
笔记
poj3627 水题
/*Time:2019.12.2Author:Goventype:水题err:ref:*/#include#includeusingname
spaces
td;inth[20005];boolcmp(intx
暖昼氤氲
·
2023-11-29 09:26
C++——结构体数组
将自定义的结构体放入到数组中方便维护语法:struct结构体名数组名[元素个数]={{},{},...{}}例子:structStudentstuArray[]=//放在main函数里实例:#includeusingname
spaces
td
双余人
·
2023-11-29 06:15
c++
C++——加号运算符重载
运算符重载概念:对已有的运算符进行定义,赋予其另一种功能,以适应不同的数据类型加号运算符重载作用:实现两个自定义数据类型进行相加的运算实例:#includeusingname
spaces
td;#include
双余人
·
2023-11-29 06:15
c++
C++——按位与运算
按位与运算在判断奇偶数时有奇效#includeusingname
spaces
td;intmain(){intn;cin>>n;co
双余人
·
2023-11-29 06:15
c++
C++——函数的常见样式与声明
1.常见的函数样式有4种1.无参返回#includeusingname
spaces
td;voidtest01(){coutusingname
spaces
td;voidtest02(inta){coutusingname
spaces
td
双余人
·
2023-11-29 06:44
c++
opencv 学习------显示图片程序
#include"stdafx.h"#include"opencv2\opencv.hpp"usingnamespacecv;usingname
spaces
td;intmain(){Matsrc;//加载图片
春蕾夏荷_728297725
·
2023-11-29 06:59
c++
MFC
opencv
opencv 学习------转换图片颜色程序
可以将原图转为灰度图片、hrv等等,程序如下所示:#include"stdafx.h"#include"opencv2\opencv.hpp"usingnamespacecv;usingname
spaces
td
春蕾夏荷_728297725
·
2023-11-29 06:59
c++
MFC
opencv
QT 在Windows下实现ping功能(ICMP)
文件末尾添加一行:LIBS+=-liphlpapi-lws2_32.h文件在.h文件中加入:#include#include#include#include#include#includeusingname
spaces
td
skyyx2002
·
2023-11-29 06:49
QT
/
C++
Windows
网络
qt
windows
开发语言
C++:将用户输入的小写字母转换成大写字母
65代表的是大写的字母A这个功能设计的比较全面了,就是要注意一下那个数组的长度稍微大一点,不然可能会出现溢出的情况建议初学者可以先学习一下基本的语法之后再来写这个内容#includeusingname
spaces
td
我爱温州
·
2023-11-29 04:26
c++
1052 Linked List Sorting
#include#include#include#include#include#includeusingname
spaces
td;constintmaxn=100010;structNode{intaddress
alicca
·
2023-11-29 04:17
算法
数据结构
c++
dfs背包贪心
源程序:背包问题#include#include#include#includeusingname
spaces
td;constintmaxn=22;intn,v;intw[maxn];intc[maxn
alicca
·
2023-11-29 04:46
算法
c++
牛客练习赛15
pragmawarning(disable:4996)2#include3#include4#include5#include6#include7#definelllonglong8usingname
spaces
td
weixin_30823683
·
2023-11-29 04:39
数据结构与算法
educoder 二进制数据的位运算_Nowcoder 牛客练习赛23
CODE#include#includeusingname
spaces
td;constintA[7]={10
weixin_39517357
·
2023-11-29 04:39
educoder
二进制数据的位运算
牛客练习赛10第二题
#include#include#include#include#include#defineLLlonglong#defineN1000009usingname
spaces
td;inta[N],n;intb
向着曙光前进
·
2023-11-29 03:37
ACM
数据结构代码更新中...
下面是思路的阐述动态数组的实现dynamicArray.h#pragmaonce#include#include#includeusingname
spaces
td;typedefstructdynamicArray
贾胤豪
·
2023-11-29 03:07
数据结构
数据结构
c++
算法
牛客练习赛53 ABC
A:简单dp#include#definelllonglongusingname
spaces
td;constllmod=1e9+7;lld[1000000][2];lln;intmain(){d[1][
Mr.Gzj
·
2023-11-29 03:06
CodeFoeces-940A
代码#includeusingname
spaces
td;intmain(){intn,d,s[110],ans=0;cin>>n>>d;for(inti=0;i>s[i];}sort(s,s+n);if
ss5smi
·
2023-11-29 03:37
放苹果
0usingname
spaces
td;#include#includeintputapples(intm,intn);intmain(){intnum1,num2;while(cin>>num1>>num2
UAV
·
2023-11-29 03:31
第十四届蓝桥杯C++省赛B组 补题(3 - 10)
全排列枚举)E:接龙数列(简单dp)F:岛屿个数(bfs)G:字串简写H:整数删除(链表模拟)I:景区导游(LCA)J:砍树(树上边差分)民间数据入口C:冶炼金属模拟一下即可#includeusingname
spaces
td
.Ashy.
·
2023-11-29 03:53
算法
第十四届蓝桥杯大赛题解
A题(填空)日期统计dfs+剪枝#include#definelllonglong#defineINF0x7f7f7f7fusingname
spaces
td;constintN=3e8+10;intn,
曼切斯特的流氓
·
2023-11-29 03:51
其他基础技巧
图论
深度优先
算法
c++
蓝桥杯
树上差分(砍树)蓝桥杯
#includeusingname
spaces
td;intn,m,tot=0,a,b,ans=0;constintN=1e6+10;intvis[N]={0},fa[N]={0},F[N]={0};intver
m0_67605338
·
2023-11-29 03:14
c++
算法
图论
【面向对象】代码存一存
日期类#includeusingname
spaces
td;constintD[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};boolisR(intx){returnx
鹭天
·
2023-11-29 03:13
算法
数据结构
[C++] PAT 1076 Forwards on Weibo (30分)
73323402562312341415226SampleOutput:45题解:该题是图的BFS,1.题目中有层数限制,则将访问标志数组vis[],用访问层数标志结点是否被访问,注意每次进行BFS前将其初始化#include#includeusingname
spaces
td
快乐de约定
·
2023-11-29 03:02
C++/PAT
1076. Forwards on Weibo 解析
#include#include#include#include#include#defineMAX1010usingname
spaces
td;intn,l;structNode{intlevel;vectorfollow
sheepyWYY
·
2023-11-29 03:32
PAT
PAT
1087 All Roads Lead to Rome(最短路求最大权值,最短路路径条数,节点个数,回溯路径)
#includeusingname
spaces
td;#defineintlonglongintn,k;stringst,ed;mapmp;mapname;mapw;inte[210][210];intindx
呆鱼敲代码
·
2023-11-29 03:01
深度优先
图论
算法
1076. Forwards on Weibo (30)
intlayer;};还有就是在bfs中定义queue,不然在其他地方还得考虑每次新的bfs初始化#include#include#include#include#defineMAX1010usingname
spaces
要认认真真
·
2023-11-29 03:26
pat-a-图
PAT1076 Forwards on Weibo
代码#includeusingname
spaces
td;vectornet[10010];boolvisit[10010];intn,L,k,tmp;intcnt=0;structnode{intkey
巧乐兹呀
·
2023-11-29 03:26
PAT
算法
使用std::mutext与std::condition_variables实现信号量
https://zhuanlan.zhihu.com/p/462668211#ifndef_SEMAPHORE_H#define_SEMAPHORE_H#include#includeusingname
spaces
td
shanql
·
2023-11-29 03:10
C/C++
操作系统
信号量
爬楼梯(力扣LeetCode)动态规划
1阶+1阶+1阶1阶+2阶2阶+1阶提示:1dp(n+1);dp[1]=1;dp[2]=2;for(inti=3;iusingname
spaces
td;
月有薄蚀
·
2023-11-29 02:21
leetcode
leetcode
动态规划
算法
C++ 的智能指针std::shared_ptr
,利用局部变量/对象分配在栈上,代码段结束时会自动释放的特性(2)另一方面,利用对象释放时会自动调用析构函数的特性3.智能指针的使用实例使用代码如下:#include#includeusingname
spaces
td
kaola_kao
·
2023-11-29 00:45
c++
Codeforces Round #838 (Div. 2)题解
1,1/2=07/2=3,3/2=1,1/2=07/2=3,3/2=1,1/2=0三次,4/2=2,2/=14/2=2,2/=14/2=2,2/=1两次所以输出2code#includeusingname
spaces
td
Kicamon
·
2023-11-29 00:41
cf
c++
算法
学习
数据结构
Codeforces Round #756 (Div. 3)
你可以任意反转他的前缀,问最少反转几次可以使得这个数为偶数分析:首先很明显的是,如果给的数中每一位都是奇数那么很明显不可能刚开始就是偶数答案为0最高位为偶数答案为1其次答案为2代码:#includeusingname
spaces
td
Code_Shark
·
2023-11-29 00:40
codeforces题解
c++
编程语言
acm竞赛
Codeforces Round #759 (Div. 2)
要求求出最后花朵的高度如果花朵死亡,则返回-1连续两天不浇水死亡今天浇水昨天没浇水张高1厘米今天浇水了昨天也浇水了张高5厘米今天没浇水,不长高分析:按照题意模拟即可代码:#includeusingname
spaces
td
Code_Shark
·
2023-11-29 00:40
codeforces题解
算法
c++
编程语言
acm竞赛
AtCoder Beginner Contest 226
A.四舍五入题意:给定一个小数,四舍五入到附近的整数将小数点前和小数点后的数读入并判断小数点后的数是否≥500\geq500≥500即可#includeusingname
spaces
td;intmain
Code_Shark
·
2023-11-29 00:10
AtCoder
c++
acm竞赛
编程语言
刷题记录第三十三天-反转字符串和反转字符串II
反转字符串#includeusingname
spaces
td;intmain(){stringstr="hello";intleft=0,right=str.size()-1;while(left
onlyzzr
·
2023-11-28 23:04
每日一题
算法
c++
数据结构
刷题记录第三十五天-(KMP算法)找出字符串中的第一个匹配项的下标
KMP算法真是刷一次忘一次#includeusingname
spaces
td;voidget_next(vector&next,strings){intj=0;next[0]=0;for(inti=1;
onlyzzr
·
2023-11-28 23:03
每日一题
算法
C++11:强枚举类型enum
#include namespaceT//命名空间T{ enumColor{Black,Gray,Green};}name
spaceS
{ enumSize{Small=1,Middle,Large
五岳凌峰
·
2023-11-28 22:08
C++
c++
enum
强枚举类型
enum
class
上一页
117
118
119
120
121
122
123
124
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他