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
力扣381周赛
输入单词需要的最少按键次数II按距离统计房屋对数目II输入单词需要的最少按键次数I贪心模拟classSolution{public:intminimumPushes(stringword){intn=word.size(),
ans
十字星的约定_
·
2024-01-25 20:39
力扣
leetcode
算法
c++
图论
蓝桥 python笔记3——time模块、datetime模块
1901年1月1日到2000年12月31日存在多少个星期1importdatetimestart=datetime.date(1901,1,1)end=datetime.date(2000,12,31)
ans
Minus478256
·
2024-01-25 19:43
蓝桥_python
笔记
出现次数超过一半的数(c++题解)
题目描述给出一个含有n(0usingnamespacestd;inta[1000005];intn,x,
ans
;intmain(){cin>>n;for(inti=1;i>x;a[x]
hb_zhyu
·
2024-01-25 18:49
c++
算法
数据结构
LeetCode 784. 字母大小写全排列
/回溯4:306intn;StringBuildersb=newStringBuilder();Listans=newArrayList();voidbackTrack(intt){if(t==n){
ans
.add
Sasakihaise_
·
2024-01-25 16:53
LeetCode
leetcode
回溯法
位运算
区间覆盖(贪心算法)
问题描述数轴上有n(1#includeusingnamespacestd;structTT{intx,y;};boolcmp(TTa,TTb){returna.x
ans
YingMila
·
2024-01-25 11:55
算法
贪心算法
c++
Leetcode150. 逆波兰表达式求值 Evaluate Reverse Polish Notation - Python 以栈实现
"+","-","*","/"}:last=stack.pop()first=stack.pop()#eval()将字符串表达式转化为正常表达式#f'{变量名}'允许动态更新字符串内容,最后返回字符串
ans
princey2100
·
2024-01-25 10:20
栈
leetcode
力扣
leetcode
python
【leetcode 每日打卡】884. 两句话中的不常见单词
defuncommonFromSentences(self,s1:str,s2:str)->List[str]:freq=Counter(s1.split())+Counter(s2.split())
ans
yyhnet.cn
·
2024-01-25 03:38
leetcode
leetcode
算法
职场和发展
python
【洛谷】P1219 [USACO1.5]八皇后 Checker Challenge
Acode:#includeusingnamespacestd;intn,a[100],b[100],c[100],d[100],
ans
;//n,行,列,对角线一,对角线二,结果voidprint()/
gentle coder
·
2024-01-25 00:36
深度优先
算法
c++
小奇遐想
definelllonglongusingnamespacestd;constllmod=16777216;llsum[200005],l[200005],r[200005],a[200005];intn;llAns1=0,
Ans
2
wolf_szh
·
2024-01-24 21:34
小奇遐想
蓝桥杯省赛无忧 编程11 最大数组和
-){intn,k;cin>>n>>k;vectora(n),sum(n+1,0);for(inti=0;i>a[i];sort(a.begin(),a.end());for(inti=1;i=0){
ans
暗托涅瓦
·
2024-01-24 21:17
蓝桥杯省赛无忧
蓝桥杯
c++
排序
前缀
贪心
Microsoft Office VBA 学习日记(二)
代码书写一共是以下几个步骤:定义子过程(第一行)声明变量(Dim语句)为变量赋值(Msg和
Ans
)连接两个字符串(用&操作符)使用内置的VBA函数(MsgBox)使用内置的VBA常量(v
偷心伊普西隆
·
2024-01-24 18:42
microsoft
excel
day27打卡
target){constans=[];constdfs=(target,combine,idx)=>{if(idx===candidates.length){return;}if(target===0){
ans
.push
卑微学习人
·
2024-01-24 17:07
算法打卡
算法
190. 颠倒二进制位
从右往左将无符号32位数n开始遍历,每取出来一个数,将其放在
ans
的左边。
cccc楚染rrrr
·
2024-01-23 20:27
LeetCode
算法
数据结构
java
Leetcode—22.括号生成【中等】
vectorgenerateParenthesis(intn){vectorans;intm=n*2;stringpath(m,0);functiondfs=[&](inti,intopen){if(i==m){
ans
.emplace_back
源代码•宸
·
2024-01-23 04:05
LeetCode刷题
leetcode
算法
c++
经验分享
dfs
回溯
字符串
Leetcode—39.组合总和【中等】
Leetcode—39.组合总和算法思想实现代码classSolution{public:vector>combinationSum(vector&candidates,inttarget){vector>
ans
源代码•宸
·
2024-01-23 04:35
LeetCode刷题
leetcode
算法
c++
经验分享
剪枝
回溯
dfs
Leetcode—216.组合总和III【中等】
2023每日刷题(七十八)Leetcode—216.组合总和III算法思想实现代码classSolution{public:vector>combinationSum3(intk,intn){vector>
ans
源代码•宸
·
2024-01-23 04:35
LeetCode刷题
leetcode
深度优先
算法
dfs
剪枝
回溯
经验分享
Leetcode—40.组合总和II【中等】
Leetcode—40.组合总和II算法思想实现代码classSolution{public:vector>combinationSum2(vector&candidates,inttarget){vector>
ans
源代码•宸
·
2024-01-23 04:33
LeetCode刷题
leetcode
算法
职场和发展
剪枝
dfs
回溯
经验分享
Educational Codeforces Round 136 (Rated for Div. 2) E.Cleaning Robot(基础dp)
chars[2][N];intn,one,dp[N][2];intsolve(intx,inty){if(x>=n-1)return0;if(~dp[x][y])returndp[x][y];int&
ans
Code92007
·
2024-01-22 19:31
#
dp
216. 组合总和 III - 力扣(LeetCode)
输入示例k=3,n=7输出示例[[1,2,4]]解题思路解题代码classSolution{List>
ans
=newArrayListpath=newArrayDeque>combinationSum3
maybe_za
·
2024-01-22 19:14
leetcode
算法
职场和发展
【动态规划】最长不下降子序列
的序列:A1A2…..An求最长不下降子序列:Ai1,Ai2,,,,,Aik,其中ai1usingnamespacestd;intn;inta[999999],dp[999999];intcnt=1,
ans
cCcOcCc_Chen
·
2024-01-22 11:37
动态规划
算法
计算矩阵边缘元素之和(c++)
输入格式第一行分别为矩阵的行数和列数(musingnamespacestd;inta[10005][10005],n,m,
ans
;intmain(){cin>>n>>m;for(inti=1;i>a[i
hb_zhyu
·
2024-01-22 08:41
矩阵
c++
算法
力扣 队列中可以看到的人数
请你返回一个长度为n的数组answer,其中
ans
OAIM.
·
2024-01-22 02:11
leetcode
算法
数据结构
2019-12-11
:计算a**n%b其中a、b和n都是32位的非负整数即求a的n次方对b的余数问题示例:例如:2**31%3=2代码实现如下classSolution:deffastPower(self,a,b,n):
ans
齐天大圣如来佛
·
2024-01-21 23:53
2021-03-07:在一个数组中,对于每个数num,求有多少个后面的数 * 2 依然
1returnprocess(arr,L,M)+process(arr,M+1,R)+merge(arr,L,M,R)}funcmerge(arr[]int,Lint,Mint,Rint)int{//新增的代码
ans
福大大架构师每日一题
·
2024-01-21 20:33
131. 分割回文串 - 力扣(LeetCode)
输入示例s="aab"输出示例[["a","a","b"],["aa","b"]]解题思路我们使用回溯、深度优先遍历的思想,使用
ans
记录路径,使用ret记录路径组合结果,使用f数组记录是否回文,使用n
maybe_za
·
2024-01-21 09:08
leetcode
算法
职场和发展
力扣 | 11. 盛最多水的容器
height.length;intans=0;for(inti=0;i
ans
molecule_jp
·
2024-01-21 05:56
计算机基础
编程语言
算法学习
leetcode
算法
职场和发展
【LeetCode】每日一题 2024_1_20 按分隔符拆分字符串(模拟/库函数)
按分隔符拆分字符串题目链接:2788.按分隔符拆分字符串题目描述代码与解题思路可以直接手动模拟:funcsplitWordsBySeparator(words[]string,separatorbyte)(
ans
戊子仲秋
·
2024-01-21 04:56
LeetCode
每日一题
leetcode
算法
职场和发展
CodeFoeces-624A
includeusingnamespacestd;intmain(){intd,l,v1,v2;doubleans=0.0;cin>>d>>l>>v1>>v2;
ans
ss5smi
·
2024-01-20 18:16
我在代码随想录|写代码Day11之双指针-三数之和,四数之和,N数之和篇
classSolution{public:vector>threeSum(vector&nums){intn=nums.size();sort(nums.begin(),nums.end());vector>
ans
27dCnc
·
2024-01-20 16:09
数据结构与算法
c语言刷题
C语言基础知识
c++
笔记
数据结构
算法
回文自动机模板
definelllonglonglllen[2000005],trie[2000005][26],num[2000005],fail[2000005];charstr[2000005];llsize=0,now=0,
ans
现在我也是
·
2024-01-20 15:08
一些模板
算法
LSTM 模型“实现”整数相加运算
数据准备为了满足模型训练的需要,应该准备50000条样本,每个样本包含query字符串和
ans
字符串,如下所示:query:52+758
ans
:810我们这里限定了加法运算的两个整数都是1-999的任意一个整数
王大丫丫
·
2024-01-20 11:56
人工智能
lstm
人工智能
深度学习
【DP】【贪心】122.买卖股票的最佳时机II
publicintmaxProfit(int[]prices){intans=0;if(prices.length<2){return0;}for(inti=1;i
ans
Allenlzcoder
·
2024-01-19 15:39
DP
贪心
APS排产相关的leetcode
defgetOrder(self,tasks:List[List[int]])->List[int]:fori,taskinenumerate(tasks):task.append(i)tasks.sort()
ans
YueTann
·
2024-01-19 04:32
leetcode
算法
职场和发展
419. Battleships in a Board
419.BattleshipsinaBoardclassSolution:defcountBattleships(self,board:List[List[str]])->int:
ans
=0foriinrange
ujn20161222
·
2024-01-18 18:52
leetcode
438. Find All Anagrams in a String
deffindAnagrams(self,s:str,p:str)->List[int]:iflen(s)
ans
ujn20161222
·
2024-01-18 18:19
leetcode
2024/1/17 DFS BFS + Div 3 a,b
思路:用bfs,遇到w就进入bfs一次,把搜索到的w全部变成.,然后
ans
++最后答案输出(其实就是看进入了几次bfs)
极度的坦诚就是无坚不摧
·
2024-01-18 14:36
寒假集训
寒假算法
深度优先
宽度优先
算法
c++
c语言
dfs
bfs
leetcode2744. 最大字符串配对数目
0int:d=defaultdict(int)
ans
=0foriinwords
晓宜
·
2024-01-18 04:27
算法
python
leetcode
后端
算法
力扣hot100 杨辉三角 递归 DP
添加时间复杂度,示例:O(n)O(n)O(n)空间复杂度:添加空间复杂度,示例:O(n)O(n)O(n)DPclassSolution{publicList>generate(intnumRows){List>
ans
兑生
·
2024-01-17 19:27
力扣
hot100
leetcode
算法
404、左叶子之和
root->left->right)){
ans
+=root->left->val;}}
ans
+=sumOfLeftLeaves(root->l
胖柚工作室
·
2024-01-17 14:22
#
二叉树
Leetcode
leetcode
数据结构
387. 字符串中的第一个唯一字符
哈希遍历两趟字符串classSolution:deffirstUniqChar(self,s:str)->int:
ans
=0mp=Counter(s)fori,chinenumerate(s):ifmp
hhmy77
·
2024-01-17 14:51
leetcode
35. 搜索插入位置
intans=-1;intleft=0,right=nums.length;while(left
ans
cccc楚染rrrr
·
2024-01-17 05:35
LeetCode
算法
数据结构
java
LeetCode Hot100 46.全排列
classSolution{privateint[]nums;privateListpath;//记录路径上的数,已选数字privateboolean[]onPath;//记录剩余未选数字privatefinalList>
ans
hn小菜鸡
·
2024-01-17 01:54
算法刷题-回溯
leetcode
算法
职场和发展
U390341 小猫爬山题解
经历了千辛万苦,小猫们终于爬上了山顶,但是疲倦的它们再也不想徒步走下山了(呜咕>__
ans
)return;剪枝,如果组数已经大于最优值
ans
,就没有再搜的必要了if(t==n+1){已经将n个数都分好了组
鸠Wcx
·
2024-01-16 23:43
算法
【算法练习】leetcode算法题合集之二分查找篇
intx){intleft=0,right=x;intans=-1;while(left<=right){intmid=(right-left)/2+left;if((long)mid*mid<=x){
ans
秋装什么
·
2024-01-16 22:45
算法
算法
leetcode
职场和发展
【Py/Java/C++三种语言OD2023C卷真题】20天拿下华为OD笔试之【模拟/递归】2023C-螺旋数字矩阵【欧弟算法】全网注释最详细分类最全的华为OD真题题解
他发明了一种写法:给出数字个数n和行数m(0n:return#未填充矩阵的右边界:从上往下,固定end_j,正序遍历iforiinrange(start_i,end_i):
ans
闭着眼睛学算法
·
2024-01-16 22:05
最新华为OD真题
#
模拟
#
DFS
算法
java
c++
华为od
leetcode
python
矩阵
面试题57 - II. 和为s的连续正数序列
target=9输出:[[2,3,4],[4,5]]示例2:输入:target=15输出:[[1,2,3,4,5],[4,5,6],[7,8]]限制:1List[List[int]]:i,j=1,1sum=0
ans
周英杰Anita
·
2024-01-16 22:49
Codeforces Round 919 (Div. 2)C同余的同余
每有一个m,
ans
+1。(时间复杂
DBWG
·
2024-01-16 13:24
CF
算法
AtCoder Beginner Contest 264 G.String Fair(最短路/暴力dp 补写法)
constintN=27*27,M=N*27;intn,u,v,w,cnt[N];lldis[N],a[M],mx;strings;boolvis[N];intf(stringx){intn=x.size(),
ans
Code92007
·
2024-01-16 07:01
#
最短路/差分约束
最短路
暴力dp
spfa
l3无重复字符最长字串
charAt():charAt方法用于返回指定索引处的字符classSolution{publicintlengthOfLongestSubstring(Strings){intn=s.length(),
ans
初礼1A
·
2024-01-15 21:33
leetcode
java
Leetcode 剑指32
思路一:用队列分层vector>levelOrder(TreeNode*root){vector>
ans
;//存答案queueq;//存取每一层数组的指针if(root==NULL)returnans;
神奇咩咩
·
2024-01-15 20:46
上一页
2
3
4
5
6
7
8
9
下一页
按字母分类:
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
其他