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
并查集模版(C++)
并查集例题1并查集例题2#includeusingname
spaces
td;constintN=1e5;intf[N];//寻找根节点intfind(intx){if(x!
√+&
·
2024-01-11 05:10
算法实现
并查集
模版
集合
数据结构
算法
数据结构:合并集合—并查集
=x)p[x]=find(p[x]);returnp[x];}//初始化,假定节点编号是1~nfor(inti=1;iusingname
spaces
td;constintN=100010;intp[N]
奋斗吧!骚年!
·
2024-01-11 05:09
#
数据结构
数据结构
图论
c++
并查集
并查集模板题:合并集合
#include#include#includeusingname
spaces
td;constintN=1e5+10;intp[N];intfind(intx){if(x!
名字想不称展
·
2024-01-11 05:08
#
并查集
算法
c++
图论
合并集合—并查集模板
输入样例:45M12M34Q12Q13Q34输出样例:YesNoYes#includeusingname
spaces
td;constintN=1e6+10;intp[N];intfind(intx){if
ou_fan
·
2024-01-11 05:08
ou_fan的学习记录
算法
c++
数据结构
【并查集】并查集模板:合并集合
#includeusingname
spaces
td;constintN=100010;intn,m;intp[N];intfind(intx){if(p[x]!
暮色_年华
·
2024-01-11 05:07
#
并查集
蓝桥杯
c++
拓扑学
算法基础之耍杂技的牛
个奶牛交换位置比较交换位置后的危险系数最大值若Wi+Si>Wi+1+Si+1则交换前大交换后更优需要交换因此按照W+S从小到大排序就是最优解再计算危险系数#include#includeusingname
spaces
td
阳光男孩01
·
2024-01-11 02:01
算法
算法基础之排队打水
排队打水核心思想:贪心时间长的排在后面打水从小到大排序再乘对应权重即可#include#includeusingname
spaces
td;typedeflonglongLL;constintN=100010
阳光男孩01
·
2024-01-11 02:31
算法
c++
数据结构
算法基础之货仓选址
≥∣a–b∣将n个数两两分组1~~n-1(奇数会剩一个)分别用绝对值不等式即可推出来货仓位置应该在中位数上(奇数)或在中间两数之间(包括端点)(偶数)#include#includeusingname
spaces
td
阳光男孩01
·
2024-01-11 02:31
算法
c++
开发语言
数据结构
C++:ifstream通过getline读取文件会忽略最后一行空行
#include#include#includeusingname
spaces
td;voidreadWholeFileWithGetline(stringfileName){stringtmpStr;inti
风静如云
·
2024-01-11 00:46
C/C++
c++
sdbusplus:多线程共享同一个bus,做同步调用,行为未定义
//add_service1.cpp#include#include#include#include#includeusingname
spaces
td;intaddInt(intd1,intd2){returnd1
风静如云
·
2024-01-11 00:46
Sdbusplus
linux
【练9.2 打印ASCII码】
【输入样例】A【输出样例】65#includeusingname
spaces
td;intmain(){charch;cin>>ch;cout<<ch+0;}
松桥爸(仁勇)
·
2024-01-11 00:15
算法
c++
开发语言
2-4基础算法-离散化/贪心/01背包问题
离散化数组要求内部有序(一般去重)可以通过离散化下标得到值也可以通过值得到离散化下标#include#include#includeusingname
spaces
td;intmain(){inta[6]
卡__卡
·
2024-01-10 23:30
C/C++算法竞赛
算法
数据结构
c语言
c++
开发语言
青少年编程
计算log(对数)的c++代码
代码#include#includeusingname
spaces
td;intmain(){doublex;cout>x;if(x<=0){cout<<"输入的数必须大于0!"
学习智者
·
2024-01-10 23:15
c++
算法
开发语言
LUCAS(数论定理)
image.png#include#include#includeusingname
spaces
td;typedeflonglongLL;usingname
spaces
td;LLexp_mod(LLa,
_弓长_大人
·
2024-01-10 22:25
JVM启动参数及垃圾回收机制
-XX:MaxMeta
spaceS
ize:设置元空间(在JDK8之后替代了永久代)的最大大小。-XX:PermSize:设置
学习使我快乐——玉祥
·
2024-01-10 22:17
jvm
java
测试工具
新手练习项目 4:简易2048游戏的实现(C++)
)三、说明一、效果图二、代码(带注释)//创作者:Code_流苏(CSDN)//未经允许,禁止转载发布,可自己学习使用#include#include#include#includeusingname
spaces
td
Code_流苏
·
2024-01-10 21:04
各类课设与项目
游戏
c++
开发语言
C++ 多态,异常处理,STL模板库
模板类实现顺序表#includeusingname
spaces
td;templateclassSeqList{private:T*data;//存储数据的数组intlength;//当前顺序表的长度intmaxSize
WengIng
·
2024-01-10 20:16
c++
开发语言
c++ 类继承
#includeusingname
spaces
td;intblood=10000;classhero{protected:stringname;inthp;intattack;public:hero()
WengIng
·
2024-01-10 20:46
c++
C++中初始化列表和构造函数体内初始化的区别
测试代码测试一:#includeusingname
spaces
td;classA{public:intx;public:A(){coutx=x;coutx=a.x;return*this;}A(constA
plastic dreamer
·
2024-01-10 19:29
c++
c++
C++ STL总结 - 基于算法竞赛
(●’◡’●)1.vector声明usingname
spaces
td;#include//引入头文件vectora;//相当于长度动态变化的int数组vectorb[88];//相当于第一维长88,第二维长度动态变化的
_snowstorm_
·
2024-01-10 19:29
数据结构与算法
c++
算法
rpc
学习
火车票订票系统(哈希表实现,代码+注释)
#ifndef_SYSTEM_H_#define_SYSTEM_H_#include#include#include#defineSIZE20000usingname
spaces
td;enumbugvalue
一只废狗狗狗狗狗狗狗狗狗
·
2024-01-10 19:23
算法
数据结构
哈希算法
c++
CodeFoeces-998A
代码#includeusingname
spaces
td;intmain(){intn,s[10],a=0,b=0;cin>>n;for(inti=0;i>s[i];b+=s[i];}intt[10]={
ss5smi
·
2024-01-10 19:27
基础数据结构第九期 堆(数组+STL)
堆的基本操作(模板)://down模板:#includeusingname
spaces
td;constintN=100010;inth[N],siz;intn,m;voiddown
娇娇yyyyyy
·
2024-01-10 18:37
#数据结构与算法
数据结构
c++ vector(二) insert, assign
#include#includeusingname
spaces
td;intmain(){vectorv(3),v2;v[0]=2;//v[0]是第0个元素v[1]=7;v[2]=9;//v=[2,7,9
wanghua609
·
2024-01-10 18:04
[ABC334E] Christmas Color Grid 1
代码#include#defineintlonglongusingname
spaces
td;constintN=1005,mod=998244353;intn,m,cnt,ans,tot,vis[N][
欧耶2023
·
2024-01-10 17:37
算法
图论
矩阵中的最长递增路径 C++
1#include#includeusingname
spaces
td;constintN=210;intn,m;intg[N][N];intres[N][N];//存放以x,y为起点的最长路径boolst
m0_68565376
·
2024-01-10 17:02
矩阵
c++
线性代数
HDU 1078 FatMouse and Cheese(记忆化搜索,DP)
FatMousehasstoredsomecheeseinacity.Thecitycanbeconsideredasasquaregridofdimensionn:eachgridlocationislabelled(p,q)where0#include#include#includeusingname
spaces
td
林小鹿@
·
2024-01-10 16:19
算法
dfs
动态规划
PHP设计模式-策略模式
例子计算器的设计代码MathStrategy.phpname
spaceS
trategy;interfaceMathStrategy{publicfunctioncalc(int$num1,int$num2
PHP的艺术编程
·
2024-01-10 14:38
C++类模板分文件编写
include文件下的person.h#pragmaonce//防止头文件重复包含#include#includeusingname
spaces
td;//声明templateclassPerson{public
computer_vision_chen
·
2024-01-10 13:37
C++笔记
c++
开发语言
2024/01/03 c++ work
1.利用模板实现单链表#includeusingname
spaces
td;//模板实现单链表//定义一个类(结点类)templateclassNode{public:Tdate;//数据域//指针域Node
qin-新征程
·
2024-01-10 12:15
c++
开发语言
纯虚函数的和抽象类
纯虚函数和虚函数的区别在与后面是不是有=0,如果没有=0上面的函数就是一个虚函数虚函数在运行的时候会动态绑定对象实际运行的函数,比如下面的例子中,main函数运行的时候,coutarea()usingname
spaces
td
steven~~~
·
2024-01-10 11:30
c++
开发语言
C++_纯虚函数and抽象类
抽象类介绍纯虚函数抽象类纯抽象类(俗称:接口类)介绍本文主要介绍纯虚函数和抽象类纯虚函数直接看源码吧,纯虚函数样式为:virtual类型函数名(参数表)=0;源码#include#includeusingname
spaces
td
一航ciao
·
2024-01-10 11:55
C++学习参考
c++
笔记
学习
C++ set容器遍历问题
#include#include#include#includeusingname
spaces
td;voidtest(){classPet{public:intage;stringname;stringtype
warmingsummer
·
2024-01-10 09:01
c++
改行学it
C++重新认知:运算符重载
2.重载运算符的函数一般形式函数类型operator运算符名称(参数列表){对运算符的重载处理}例如:没有重载前#includeusingname
spaces
td;classTime{public:Time
Rain_ZZX
·
2024-01-10 06:02
C++重新认知系列
c++
C++ STL常用函数总结
1vector#include#include#include#include#includeusingname
spaces
td;intmain(){//vectorvectora;a.size();a.empty
伏城无嗔
·
2024-01-10 05:02
算法笔记
c++
算法
创建一个矩形中有两个三角形
0.5f,-0.5f,0.0f,//左下-0.5f,0.5f,0.0f,//左上};unsignedintindices[]={0,1,3,//第一个三角形1,2,3//第二个三角形};usingname
spaces
td
Ming Xu
·
2024-01-10 04:57
OpenGL图形渲染
算法
2024华为OD机试:最多几个直角三角形
输入描述第一行输入一个正整数T(1#include#includeusingname
spaces
td;intdfs(vector&segments,vector&used,intindex){intans
TPEngineer
·
2024-01-10 01:59
华为OD机试2024题库c++
华为od
算法
CodeFoeces-618A
代码#includeusingname
spaces
td;intmain(){intn,s[100000]={0};cin>>n;intl=0;while(n--){s[l++]=1;while(l>1&
ss5smi
·
2024-01-10 01:01
8-C++的nullptr、 自动类型推导 、进制输出、设置场宽相关知识点
一个资源在多个指针之间共享,每当有一个智能指针管理资源的时候,使用计数加1,当一个智能释放管理权的时候,使用计数减1,当使用计数时,次数资源没有被使用,这时才会销毁#include#includeusingname
spaces
td
Summer_taotao
·
2024-01-10 01:32
c++
算法
数据结构
杨辉三角形(c++题解)
问题描述打印出杨辉三角的前N行(Nusingname
spaces
td;intn;longlonga[55][55];intmain(){cin>>n;a[1][1]=1;for(inti=2;i<=n;
hb_zhyu
·
2024-01-09 23:44
c++
开发语言
算法
P1019 [NOIP2000 提高组] 单词接龙 刷题笔记
luogu.com.cn)思路来自大佬Chardo的个人中心-洛谷|计算机科学教育新生态(luogu.com.cn)匹配:将第一个字符串末尾和第二个字符串第一个开始匹配如果j#includeusingname
spaces
td
谦川
·
2024-01-09 22:45
算法
洛谷 P1217 [USACO1.5] 回文质数 Prime Palindromes 刷题笔记
只有偶数才会是质数优化2回文数的判断次数要优于检查素数先判断是否为回文数再检查是否为质数if(hw(i)&&isprime(i))这里有关于&&的条件一但左边函数为0右边函数不再进行判断#includeusingname
spaces
td
谦川
·
2024-01-09 22:45
笔记
算法
c++11--内存对齐
#includeusingname
spaces
td;struct/*alignas(16)*/ColorVector{charr;doubleg;doubleb;doublea;};intmain(){
raindayinrain
·
2024-01-09 22:14
1.3.语言-C++11
内存对齐
美丽的区间-蓝桥
下面是c++代码:#includeusingname
spaces
td;intmain(){//请在此输入您的代码intn,s,arr[100000],sum=0,j=0,Min=999999,num=0
cy-code
·
2024-01-09 22:11
算法
c++
火星人-蓝桥
下面是c++代码:#include#includeusingname
spaces
td;intmain(){//请在此输入您的代码intn,m,arr[10000],index=1;cin>>n>>m;for
cy-code
·
2024-01-09 22:41
算法
c++
数据结构
丽丽的01密码串-蓝桥
下面是c++代码:#includeusingname
spaces
td;intmain(){//请在此输入您的代码intone=0,zero=0;strings;cin>>s;for(inti=0;i
cy-code
·
2024-01-09 22:10
算法
c++
开发语言
弹珠堆放-蓝桥
下面是c++代码:#includeusingname
spaces
td;intmain(){//请在
cy-code
·
2024-01-09 22:10
c++
算法
开发语言
回文判断-蓝桥
回文判定-蓝桥云课(lanqiao.cn)解题思路:这道题的数量级有10e6,如果双重循环肯定会爆的,所以可以联想到双指针,也就是头尾一起遍历,将o(n^2)转化成o(n),截至条件为iusingname
spaces
td
cy-code
·
2024-01-09 22:09
算法
1.2.。。。。
有道云笔记#includeusingname
spaces
td;intblood=10000;classhero{protected:stringname;inthp;intattack;public:hero
来日可期げ
·
2024-01-09 21:36
笔记
1.3.。。。
1有道云笔记2#includeusingname
spaces
td;/*******线性表的数据结构********/constintdefaultSize=10;//设置默认顺序表大小templateclassSeqList
来日可期げ
·
2024-01-09 21:36
笔记
上一页
80
81
82
83
84
85
86
87
下一页
按字母分类:
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
其他