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
NameSpaces
哈希表算法模版
模拟散列哈希表活动-AcWing拉链法思路:代码如下:#include#includeusing
namespaces
td;constintN=1e5+3;//取大于1e5的第一个质数,取质数冲突的概率最小可以百度
Jared_devin
·
2024-02-15 03:53
Acwing
数据结构
散列表
哈希算法
数据结构
BFS basic_practice
AcWing844.走迷宫活动-AcWing模版bfs#include#include#includeusing
namespaces
td;typedefpairPII;constintN=105;intg
Jared_devin
·
2024-02-15 03:23
BFS
宽度优先
算法
数据结构
c++
2024牛客寒假算法基础集训营1
牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJA.DFS搜索思路:直接依次遍历子串即可代码如下:#includeusing
namespaces
td;#definefsfirst
Jared_devin
·
2024-02-15 03:22
算法
c++
贪心算法
动态规划
欧拉筛详解(附个人思想注释)
Ⅱ.个人的代码及注释:#include#include//包括memset初始化using
namespaces
td;constintN=2e5;intprime[N];//保存质数boolis_prime
Jared_devin
·
2024-02-15 03:22
算法
c++
图论
leetcode
深度优先
推荐算法
排序算法
【黑马程序员】C++函数
函数提高函数默认参数如果某个位置不传实参,那么该位置可以实用默认参数语法:返回值类型函数名(参数类型形参名=默认值)注意如果某个位置设置了默认参数,那么从左往右后面都必须有默认值```cpp#includeusing
namespaces
td
double_happiness
·
2024-02-15 03:14
#
C++笔记
c++
开发语言
牛客周赛 Round 29 题解
牛客周赛Round29题解代码风格后续目标代码写在solve()方法中#include//#include//#include//#include//#include//#includeusing
namespaces
td
ABOYL_TuNa
·
2024-02-15 02:09
算法
ACM题解
算法
牛客周赛22练习2啊
因为横纵坐标为整数且1using
namespaces
td;constintmaxn=5e5+5;constintmod=998244353;#definelllonglongintn,a[50000],
mfy的1号小迷弟
·
2024-02-15 02:09
牛客练习题
牛客周赛 29
牛客周赛Round29文章目录牛客周赛Round29A小红大战小紫B小红的白日梦C小红的小小红D小红的中位数E小红构造数组A小红大战小紫语法题#includeusing
namespaces
td;intmain
十字星的约定_
·
2024-02-15 02:38
算法
算法
c++
数据结构
牛客 周赛
SimpleGame#include#definelllonglongusing
namespaces
td;constintmaxn=1e5+9;lln,x,k,m;intf[maxn];bitsetvis
__Rain
·
2024-02-15 02:07
图论
c++
linux
牛客周赛 Round 28
A题#includeusing
namespaces
td;intmain(){ intx; intsum=0; for(inti=0;i>x; sum+=x; }
2301_78574448
·
2024-02-15 02:37
算法
c++
数据结构
JS实现归并排序
技术问题还是要多google),对递归过程的内存堆栈分析豁然开朗,下面先列出分析过程://AC++programtodemonstrateworkingofrecursion#includeusing
namespaces
td
Leondt
·
2024-02-15 02:31
寒假12 图论
#define_CRT_SECURE_NO_WARNINGS1#include#includeusing
namespaces
td;intconstN1=10010;intconstN2=100010;intarr
要成为编程高手的Yu
·
2024-02-15 02:25
算法
c++
数据结构
寒假11-洛谷打题记录
#define_CRT_SECURE_NO_WARNINGS1#include#include#includeusing
namespaces
td;intn,m,k;intfire[1000010];intice
要成为编程高手的Yu
·
2024-02-15 02:24
算法
c++
数据结构
C++入门学习(二十六)for循环
for(初始化;条件;递增/递减){//代码块}打印1~10:#includeusing
namespaces
td;intmain(){for(inti=1;i#include//需要包含这个头文件来使用
执沐
·
2024-02-15 01:54
C++入门
学习
C++入门学习(二十七)跳转语句—break语句
1、与switch语句联合使用C++入门学习(二十三)选择结构-switch语句-CSDN博客#include#includeusing
namespaces
td;intmain(){intnumber;
执沐
·
2024-02-15 01:54
C++入门
前端
javascript
数据库
C++入门学习(二十七)跳转语句—continue语句
直接看一下下面的代码更清晰:与上一节的break语句可以做一下对比:C++入门学习(二十七)跳转语句—break语句-CSDN博客#includeusing
namespaces
td;intmain(){
执沐
·
2024-02-15 01:23
C++入门
学习
给定n个结点的树,其中有k个结点是特殊结点(未知),定义好结点:该结点到k个特殊结点的距离之和最小。若随机k个结点为特殊结点,求好结点个数的期望值
#includeusing
namespaces
td;#defineintlonglong#definepbpush_back#definefifirst#definesesecond#definelsonpG
__night_
·
2024-02-15 01:42
codeforces
算法
数据结构
给定n个结点的树,定义G(k)为n个结点的图,u,v之间有边当且仅当u,v在树上的距离大于等于k。对任意k(1 <= k <= n), 求G(k)连通分量的个数
题目思路:代码优化:在找直径端点的时候把其他结点到直径两端点的距离都求出来,不用lca#includeusing
namespaces
td;#defineintlonglong#definepbpush_back
__night_
·
2024-02-15 01:12
codeforces
算法
有一个h*w(未知)的矩形,给定n,切n-1次,每切一次,把其中一块放在盒子里,另一块继续切。最后一块也放在盒子里,最终有n块矩形。给定n个矩形的长和宽(n个矩形是乱序的),求初始h,w
题目思路:#includeusing
namespaces
td;#defineintlonglong#definepbpush_back#definefifirst#definesesecond#definelsonpy.h
__night_
·
2024-02-15 01:12
codeforces
算法
给定长度为n的数组b,求对于任意1<=l<=r<=n, 求b[i] + b[j] + b[k] - (r - l) 的最大值(l<=i, j, k<=r)
题目思路:#includeusing
namespaces
td;#defineintlonglong#definepbpush_back#definefifirst#definesesecond#definelsonp
__night_
·
2024-02-15 01:42
codeforces
算法
【十七】【C++】stack的简单实现、queue的常见用法以及用queue实现stack
stack的简单实现#include#includeusing
namespaces
td;namespaceMystack{template>classstack{public:stack():_c(){
妖精七七_
·
2024-02-15 00:49
C++
c++
算法
2-6基础算法-快速幂/倍增/构造
普通的快速幂算法#include#includeusing
namespaces
td;longlongfastPower(longlon
卡__卡
·
2024-02-15 00:18
C/C++算法竞赛
算法
c++
数据结构
c语言
开发语言
1928_B. Equalize_排序_去重_双指针_滑动窗口_贪心
#includeusing
namespaces
td;voidsolve(){intn;cin>>n;vectora;for(inti=0;i>x;a.push_back(x);}sort(a.begin
三冬四夏会不会有点漫长
·
2024-02-15 00:39
全集
#
CF
div
2
B
题
算法
数据结构
shared_ptr放入vector,要及时clear,避免内存泄漏
下面简化一下这个问题,直接看代码:#include#include#includeusing
namespaces
td;intmain(){shared_ptra1(newint(1));cout>v1;
见牛羊
·
2024-02-14 22:12
C++小技巧
c++
C++ 关键字小结
#includeusing
namespaces
td;classA{public:A(intb){a=b;}private:inta;};intm
见牛羊
·
2024-02-14 22:12
C++
c++
开发语言
字符排列问题
问题:有n个字母,列出由该字母组成的字符串的全排列(相同的排列只计一次)输入:第一行输入是字母个数n,1using
namespaces
td;intf(intn){intsum=1;for(inti=1;
放心笑
·
2024-02-14 22:33
Sort学习笔记
一:使用sort必须了解的事情:必须的头文件#include和using
namespaces
td;它是属于c++STLvector中的方法;它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(
皮皮蒋
·
2024-02-14 20:15
洛谷C++简单题小练习day9—[AHOI2017]寻找探监点
代码部分#includeusing
namespaces
td;intx[10001],y[1000
小杨想赢一次
·
2024-02-14 20:53
蓝桥备战冲!
c++
开发语言
数据结构
算法
学习
精确覆盖问题学习笔记(三)——算法的初步实现
一、类CExactCoverSolution的声明#include#include#include#includeusing
namespaces
td;//类型的定义typedefintELEMENT_TYPE
laomai
·
2024-02-14 20:51
算法
精确覆盖问题
代码
算法
c++输出n选m的所有排列
需要按升序输出所有排列,比如从0到9中选出2个的所有排列为010203...091012...98一共10*9=90个c++代码为#include#include#include#includeusing
namespaces
td
laomai
·
2024-02-14 20:49
C/CPP
算法
c++生成n选m的组合
个的所有无重复组合为01020304050607080912131415...787989一共45个,c++代码为#include#include#include#include#includeusing
namespaces
td
laomai
·
2024-02-14 20:49
算法
C/CPP
寒假思维训练计划day2
Codeforces题意:给定两个长度为n的数组,可以对a数组进行操作:选定l#defineintlonglong#definefffirst#definesssecond#definepbpush_backusing
namespaces
td
嘗_
·
2024-02-14 18:26
算法
1610:扫雷游戏地雷数计算
1#includeusing
namespaces
td;intmain(){intn,
无聊的木子
·
2024-02-14 18:21
C++
算法
游戏
L1-096 谁管谁叫爹
三、代码#includeusing
namespaces
td;#includeintmain(){intn;cin>>n;while(n--){intn1,n2,s1=0,s2=0;cin>>n1>>n2
still&
·
2024-02-14 16:12
PTA
c++
L2-001 紧急救援
三、代码#includeusing
namespaces
td;//无穷大#definemaxInt
still&
·
2024-02-14 16:12
算法
c++
数据结构
迪杰斯特拉算法
Dijkstra
L2-005 集合相似度
一、题目二、解题思路Nc是两个集合都有的不相等整数的个数:A∩B;Nt是两个集合一共有的不相等整数的个数:A∪B=A.size()+B.size()-A∩B;三、代码#includeusing
namespaces
td
still&
·
2024-02-14 16:12
算法
c++
数据结构
集合
set
深度优先搜索hnust-oj
intmain(){Graphg;CreateUDG(g);DFSTraverse(g);cout#include#includeusing
namespaces
td;#defineMVNum100//
久长愿长久
·
2024-02-14 14:47
笔记
深度优先
c++
算法
数据结构
OJ_计算不带括号的表达式
题干C++实现#define_CRT_SECURE_NO_WARNINGS#include#include#include#includeusing
namespaces
td;intmain(){charstr
Listennnn
·
2024-02-14 14:46
数据结构与算法
算法
c语言
数据结构
OJ_括号匹配
题干C++实现#define_CRT_SECURE_NO_WARNINGS#include#include#includeusing
namespaces
td;intmain(){stackmyStack
Listennnn
·
2024-02-14 14:45
数据结构与算法
算法
c语言
数据结构
OJ_深度优先搜索
题干c++代码#include#includeusing
namespaces
td;#defineMax_M100#defineMax_N100chara[Max_M][Max_N],M,N;voiddfs
Listennnn
·
2024-02-14 14:15
数据结构与算法
深度优先
算法
打印ASCII码
用例输入1A用例输出165代码#include//头文件调用using
namespaces
td;intmain(){chara;intb;cin>>a;b=(int)a;cout<<
2401_82881310
·
2024-02-14 14:36
c++
算法
开发语言
计算分数的浮点数值
用例输入157用例输出10.714285714代码#includeusing
namespaces
td;intmain(){doublea,b,c;cin>>a>>b;c=a/b;prin
2401_82881310
·
2024-02-14 14:06
算法
判断素数c++
用例输入157用例输出1F代码#include#includeusing
namespaces
td;intmain(){intn,y;boolisprime=tr
2401_82881310
·
2024-02-14 14:35
算法
正经人不会想看的不用动脑子的内容之dfs与bfs的极限拉扯
题目描述已知nn个整数x_1,x_2,\cdots,x_nx1,x2,⋯,xn,以及11个整数kk(kusing
namespaces
td;intn,k;intans=0;inta[22];boolshisushu
Zzwwjjjjjjj
·
2024-02-14 13:46
c++
图论
算法
深度优先
宽度优先
c++自学笔记001-输入输出
#include#includeusing
namespaces
td;intmain(){inta,b,c;cout>a>>b>>c;cout>是插入运算符。
梁逸尘
·
2024-02-14 13:10
c++笔记
cin与cout
CodeFoeces-994A
代码#includeusing
namespaces
td;intmain(){intn,m,a[10],b[10];cin>>n>>m;for(inti=0;i>a[i];}for(inti=0;i>b[
ss5smi
·
2024-02-14 13:57
【C++计算几何】点是否在线段上
样例输入Copy331275样例输出CopyYES解法(共线)还需保证Q不在P1P2的延长线或反向延长线上#includeusing
namespaces
td;intmain(){doubleqx,qy,
CuberW
·
2024-02-14 13:38
数学
算法
201709CSPT5除法
有一个长度为nnn的序列,对其有mmm个操作:1:对[L,R]1:对[L,R]1:对[L,R]之间所有vvv的倍数除以vvv2:对[L,R]2:对[L,R]2:对[L,R]之间所有求和#includeusing
namespaces
td
wly127
·
2024-02-14 13:38
CSP
算法
图论
数据结构
202209CSPT4吉祥物投票
投给xxx号的人将票转投给www号作品3:x,w3:x,w3:x,w号作品票数交换4:4:4:输出xxx号作品票数5:5:5:输出票数最多的作品号数(如果票数相同输出编号小的)#includeusing
namespaces
td
wly127
·
2024-02-14 13:07
CSP
算法
欧拉筛板子
造数组时间复杂度:O(n)查询:O(1)#includeusing
namespaces
td;constintN=100000010;boolnums[N];longlongf[N],cot=0;intmain
why_not_fly
·
2024-02-14 11:20
算法
数据结构
上一页
15
16
17
18
19
20
21
22
下一页
按字母分类:
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
其他