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
ans
1621:轻拍牛头(约数个数)---信息学奥赛一本通
#includeusingnamespacestd;typedeflonglongll;constintN=1e6+5;intn,a[N],
ans
[N],cnt[N];intmain(){scanf("
陈进士学习
·
2023-08-07 14:43
信息学奥赛一本通
算法
c++
数据结构
开发语言
约数
Leetcode69 x的平方根
二分查找法代码publicintmySqrt(intx){intl=0,r=x,
ans
=-1;while(l<=r){intmid=l+(r-l)/2;if((long)mid*mid<=x
魑魅魍魉114
·
2023-08-07 10:35
java
算法
数据结构
[区间DP]石子合并极其变种问题(环形,40000堆型)P1880 [NOI1995]石子合并+[Sdoi2008]石子合并/poj1738An old Stone Game
求将这N堆石子合并成一堆总花费,要求N#include#includeusingnamespacestd;constintN=50005;intstone[N];intn,t,
ans
;voidcombine
osatalp
·
2023-08-07 06:52
树形动态规划
石子合并极其变种问题
leetcode-day7
Listt=newArrayList();List>
ans
=newArrayList>()
WANJ.YES
·
2023-08-07 00:45
leetcode
深度优先
算法
小红书2023/08/06Java后端笔试 AK
1e5+10;voidsolve(){stringline,t;getline(cin,line);line+='';vectorans;unordered_mapcnt;for(inti=0;i=3)
ans
.push_back
openallzzz
·
2023-08-07 00:34
笔试
算法
C++
动态规划
算法
图论
leetcode做题笔记58
='')
ans
++;if(
ans
!=0&&s[i]=='')break;}retu
si_mple_
·
2023-08-06 21:49
字符串的应用
leetcode
笔记
算法
子集 II——力扣90
文章目录题目描述题目描述classSolution{public:vectort;vector>
ans
;vector<vector
hazel爱吃肉
·
2023-08-06 14:03
算法刷题笔记
leetcode
算法
职场和发展
数据结构
c++
leetcode 1290.二进制链表转整数
⭐️题目描述leetcode链接:二进制链表转整数ps:101(0val;//左移1位,相当于乘以2printf("%d",
ans
);head=head->next;}returnans;}
cccyi7
·
2023-08-06 14:32
刷题
leetcode
链表
学习
C++ 计算器实现加减乘除
二话不说,先上代码#include#includeusingnamespacestd;intmain(){inta,b;while(1){intf1=0,f2=0,
ans
=0;chara[99];cin
一腔诗意醉了酒
·
2023-08-06 12:29
C/C++
c++
字符串
switch
算法
roman-to-integer
strings){intans=0;for(inti=0;i
ans
DaiMorph
·
2023-08-06 10:41
leetcode算法题--统计范围内的步进数字数目
count-stepping-numbers-in-range/description/数位dp题目,需要稍微做下变更constmodint=1e9+7funccountSteppingNumbers(lowstring,highstring)int{
ans
bob62856
·
2023-08-06 08:47
Algorithm
算法
leetcode
职场和发展
python在linux下备份文件
安装defcheck_dir(os_dir):ifnotos.path.exists(os_dir):print(os_dir,"doesnotexist")defask_for_confirm():
ans
yenggd
·
2023-08-06 06:40
python
笔记
python
D. Professor Higashikata(并查集)
对于询问,先统计原字符串中1的个数cnt,最小操作数
ans
。然后对于每个询问动态维护cnt,
ans
,s的值即可。注意:并查集初始话一定要到p[n+1],不然
Cambrain_
·
2023-08-06 02:52
数据结构
数据结构
字母异位词分组 LeetCode热题100
代码classSolution{public:vector>groupAnagrams(vector&strs){map>mp;map>::iteratorit;vector>
ans
;m
薛动静
·
2023-08-06 00:30
面试算法
LeetCode
哈希表
leetcode
算法
食物链 带权/种类并查集
=x){intt=find(p[x]);d[x]+=d[p[x]];p[x]=t;}returnp[x];}intmain(){intn,k,op,x,y,
ans
=0;scanf
'Karma
·
2023-08-05 23:08
算法
120. 三角形最小路径和
递归,超时classSolution{public:intans;voiddfs(vector>&triangle,intx,inty,intsum){if(x==triangle.size()-1){
ans
Python ml
·
2023-08-05 18:12
LeetCode
算法
数据结构
选数(c++题解)
intsu(intx){检察是否为素数intcnt=0;for(inti=2;i>n>>m;for(inti=1;i>a[i];}node(1,0,0);cout<<
ans
hb_zhyu
·
2023-08-05 17:43
c++
算法
数据结构
杨辉三角 LeetCode热题100
代码classSolution{public:vector>generate(intnumRows){vector>
ans
(numRows);for(inti=0;i
ans[
薛动静
·
2023-08-05 13:49
面试算法
LeetCode
leetcode
算法
面试
“蔚来杯“2022牛客暑期多校训练营10-H Wheel of Fortune
0usingnamespacestd;constintmod=998244353,N=16e6+5;intA,B,a[10],b[10],n=7;intdp[15],fac[N],inv[N],res,cnt,_a,_b,
ans
ren1xin
·
2023-08-05 10:33
算法
c++
概率论
leetcode做题笔记53
思路一:前缀和intmaxSubArray(int*nums,intnumsSize){intsum=0,
ans
=0,temp=nums[0],flag=1;for(inti=1;i=0){flag=0
si_mple_
·
2023-08-05 08:07
数组的应用
leetcode
笔记
算法
【算法题】【51nod】1384 全排列
*;publicclassMain{staticchar[]chs;//题目的字符串staticboolean[]vis;//访问标记staticchar[]
ans
;//暂存每一个排列publicstaticvoidmain
Vinko_wei
·
2023-08-05 07:00
代码随想录算法训练营day25 | 216. 组合总和 III,17. 电话号码的字母组合
代码:classSolution{privateintsum=0;privateListpath=newArrayList>
ans
=newArrayList>c
Chamberlain T
·
2023-08-05 05:29
代码随想录
#
回溯
算法
2023河南萌新联赛第(四)场 L.7是大奖?(数位DP基础)
我们把ansl,rans_{l,r}ansl,r转化为
ans
1,r−
ans
1,l
PTCCTP
·
2023-08-05 05:48
c++
2023-08-04力扣每日一题
链接:980.不同路径III题意:一个迷宫,求走过所有空格子且不重复的从起点到终点的路线有几条解:dfs板子题实际代码:#includeusingnamespacestd;intn=0,m=0,
ans
=
Qian丶Xi
·
2023-08-04 21:53
力扣每日一题
leetcode
算法
dfs
初级算法-数学
includeusingnamespacestd;vectorfizzBuzz(intn){vectorans;for(inti=0;i>n;vectorans=fizzBuzz(n);for(auto&s:
ans
Qian丶Xi
·
2023-08-04 21:53
力扣每日一题
leetcode
算法
c++
算法通关村第二关——反转链表青铜笔记
=null){ListNodecurNext=cur.next;cur.next=
ans
.next;
ans
.next=cur;cur=curNext;}ret
愛夜
·
2023-08-04 02:43
算法与数据结构
算法
链表
笔记
2023-08-03力扣今日五题
next;ListNode(intx):val(x),next(NULL){}};vectorreversePrint(ListNode*head){vectorans;autobi=inserter(
ans
Qian丶Xi
·
2023-08-04 00:01
力扣每日一题
leetcode
算法
2023-08-03力扣今日四题
includeusingnamespacestd;intstringToint(string&s){intans=0;for(inti=0;i='0'&&str[i]iMin.size())returnINT_MIN;elseif(
ans
.size
Qian丶Xi
·
2023-08-04 00:57
力扣每日一题
leetcode
leetcode22. 括号生成(回溯算法-java)
示例1:输入:n=3输出:[“((()))”,“(()())”,“(())()”,“()(())”,“()()()”]示例2:输入:n=1输出:[“()”]提示:1
ans
=newA
SP_1024
·
2023-08-03 21:46
java
数据结构
算法
算法
java
深度优先
贪心算法
数据结构
动态规划
P1036 [NOIP2002 普及组] 选数
m;intans=0;boolshu(intx){for(inti=2;im){intmid=0;for(inti=1;i>n>>m;for(inti=1;i>a[i];dfs(1,1);cout<<
ans
前 方
·
2023-08-03 10:36
搜索每日一题
算法
2023-08-01力扣每日一题
快速幂和慢速乘+暴力TLE(2558/2584)首先对于这个数组来说,求值只依靠序列的最大值和最小值,并且所有子序列都要求,所以我们先将数组排序对于每次遍历到的数字nums[i]都有一个nums[i]^3加入到
ans
Qian丶Xi
·
2023-08-03 06:17
力扣每日一题
算法
动态规划
leetcode
c++
AcWing111. 畜栏预定
#includeusingnamespacestd;typedeflonglongll;constintN=5e4+5;intn,m,cnt[N],x,y,res,
ans
[N];structnode{intx
陈进士学习
·
2023-08-03 00:55
AcWing
算法
c++
贪心
c语言
开发语言
AOJ 2249 Road Construction 最短路径 Dijkstra算法优化
intcost=0):to(to),len(len),cost(cost){}};typedefpairP;vectoredges[10007];intinf=0x3f3f3f3f,N,M,d[10007],
ans
'晚风'
·
2023-08-02 12:59
图论
算法
数据结构
(树) 剑指 Offer 32 - II. 从上到下打印二叉树 II ——【Leetcode每日一题】
3,9,20,null,null,15,7],3/\920/\157返回其层次遍历结果:[[3],[9,20],[15,7]]提示:节点总数>levelOrder(TreeNode*root){vector>
ans
酷酷的懒虫
·
2023-08-02 09:21
LeetCode
leetcode
算法
职场和发展
【HDU 1286】找新朋友
includeusingnamespacestd;#defineLOCAL0//返回小于n且与n互质的数的个数inteuler(intn){intans=n;inttmp=n;for(inti=2;i*i1){
ans
Siding
·
2023-08-02 09:15
打印控制行 P5730 【深基5.例10】显示屏 液晶屏上,每个阿拉伯数字都是可以显示成 3×5 的点阵的(其中 X 表示亮点,. 表示暗点)。现在给出数字位数(不超过 100)和一串数字,要
文章目录题目Java代码题目跳转链接原来思路列举所有数组然后多重for循环可能出现格局排列问题改进版:分为5行
ans
[]++;以行为一块思想Java代码importjava.util.Scanner;publicclassMain
QuantumYou
·
2023-08-02 04:58
#
ICPC
洛谷
LeetCode
蓝桥杯
字符串
【算法心得】善用js可以把函数写在函数里的特性;善用spread表达式生成新数组
https://leetcode.cn/problems/combinations/善用js可以把函数写在函数里的特性这样维护全局变量很烦把子函数直接写在combine()内部,n和k可以直接用,也不用因为
ans
Ranye123
·
2023-08-02 02:57
算法
javascript
开发语言
x 的平方根——力扣69
文章目录题目描述法一二分查找题目描述法一二分查找intmySqrt(intx){intl=0,r=x,
ans
=-1;while(l<=r){intmid=(l+r)/2;if((longlong)
hazel爱吃肉
·
2023-08-02 02:56
算法刷题笔记
leetcode
算法
职场和发展
数据结构
链表
Matlab的double函数
比如在复数表示中,举例如下:(1)double((1+i/2)/(i-1/4)^(1/2))得到
ans
=0.9943-0.4733i(2)double(cosh(1/2)/(sinh(1/2)*i+1)
超级大超越
·
2023-08-01 22:30
Matlab
matlab
线性代数
矩阵
2023牛客多校训练第五场铜银牌题解
牛客多校训练第五场铜银牌题解A#include#defineintlonglongusingnamespacestd;constintN=5e5+10,d=700;intn,m,a[N],bl[N],
ans
胡 耀文
·
2023-08-01 13:06
牛客
打比赛的题解笔记
算法
【LeetCode1】【哈希】每日一题 day30
&nums,inttarget){mapcha;vectorans;intsize=nums.size();for(inti=0;i
ans
lyx_2016
·
2023-08-01 10:44
LeetCode
题目
leetcode
讲好普通话没那么难!
-知乎https://www.zhihu.com/question/34838352/
ans
文晓晓儿
·
2023-07-31 12:23
三数之和——力扣15
文章目录题目描述法一双指针+排序题目描述法一双指针+排序classSolution{public:vector>threeSum(vector&nums){intn=nums.size();vector>
ans
hazel爱吃肉
·
2023-07-31 08:19
算法刷题笔记
leetcode
算法
数据结构
c++
职场和发展
链表
贪心专题--P1199 [NOIP2010 普及组] 三国游戏
#includeusingnamespacestd;longans,
ANS
,
Silver_bullet2004
·
2023-07-31 07:13
贪心算法
c++
贪心算法
c++
算法
暑假刷题第17天--7/29
146.序列-AcWing题库(二叉堆+归纳--重点学习)#include#include#includeusingnamespacestd;intn,m,a[1005][2005],now[2005],
ans
不能AC的小菜鸡
·
2023-07-31 06:25
暑假打卡
算法
c++
数据结构
暑假刷题第18天--7/30
AcWing题库(dfs)#include#include#include#include#includeusingnamespacestd;constintN=18;boolvis[N];inta[N],n,
ans
不能AC的小菜鸡
·
2023-07-31 06:22
暑假打卡
深度优先
算法
图论
2020-02-17
octave:1>3+7
ans
=10octave:2>9-2
ans
=7octave:3>5*6
ans
=30octave:4>1/5
ans
=0.20000octave:5>2^10
ans
=1024octave
kamanda
·
2023-07-30 23:33
Codeforces Round 889 (Div. 2) (C1~C2)
提示如果C1会了但不会C2,也应该先将C1解法看一遍C1Dual(EasyVersion)题意给定长度为nnn的数组aaa,(n=1;i--){//累加c19c12+c19=c31
ans
.push_back
CCSU_梅子酒
·
2023-07-30 14:58
Codeforces
Codeforces
构造专题
算法
【补题笔记】杭州师范大学第四届程序设计新生赛
#includeusingnamespacestd;typedeflonglongLL;intn;intcnt[130];intone=0,
ans
=0
xhyu61
·
2023-07-30 08:48
算法学习
做题笔记
算法
c++
陶陶摘苹果(题解)(升级版)
陶陶想知道在susingnamespacestd;intn,s,a,b,
ans
;intx[5005],y[5005];intdfs(intnum,intr
hb_zhyu
·
2023-07-30 08:13
算法
上一页
24
25
26
27
28
29
30
31
下一页
按字母分类:
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
其他