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
蓝桥杯备战——完全日期
//问2001年1月1到2021年12月31有多少个完全日期#includeusingnamespacestd;boolcheck(inty,intm,intd){intans=0;while(y){
ans
CZMM@dehua
·
2024-01-26 16:16
蓝桥杯
[蓝桥杯]真题讲解:子串简写(暴力+二分)
defineintlonglongusingnamespacestd;voidsolve(){intk;strings;charc1,c2;cin>>k>>s>>c1>>c2;intans=0;for(inti=0;i=k&&s[j]==c2)
ans
Turing_Sheep
·
2024-01-26 12:00
备战蓝桥杯
#
基础算法与数论题目
蓝桥杯
职场和发展
【LeetCode】每日一题 2024_1_23 最长交替子数组(模拟)
逐渐找回之前刷题的节奏了,终于是在寒假稳住一点了题目:最长交替子数组题目链接:2765.最长交替子数组题目描述代码与解题思路funcalternatingSubarray(nums[]int)int{
ans
戊子仲秋
·
2024-01-26 10:19
LeetCode
每日一题
leetcode
算法
职场和发展
代码随想录算法训练营day38 | 动态规划: 理论基础,509. 斐波那契数,70. 爬楼梯,746. 使用最小花费爬楼梯
动规五部曲:dp数组递推公式初始化遍历顺序打印检查509.斐波那契数自己写的没什么套路的acclassSolution:deffib(self,n:int)->int:ifn==0:return0
ans
jzh013
·
2024-01-26 10:12
算法
动态规划
leetcode
python
数据结构
Leetcode—52.N皇后II【困难】
inttotalNQueens(intn){intans=0;vectorcol(n),on_path(n),diag1(2*n),diag2(2*n);functiondfs=[&](intr){if(r==n){
ans
源代码•宸
·
2024-01-26 05:10
LeetCode刷题
leetcode
算法
职场和发展
经验分享
c++
dfs
回溯
[算法系列] 两数之和——有序数组(Java)
publicint[]twoSum(int[]nums,inttarget){int[]
ans
=newint[2];for(inti=0,j=nums.length-1;itarget){j--;}else
没有一杯咖啡逃过九块九除了我
·
2024-01-26 05:06
算法
算法
java
【LeetCode每日一题】2865. 美丽塔 I
2024-1-24文章目录[2865.美丽塔I](https://leetcode.cn/problems/beautiful-towers-i/)2865.美丽塔I初始化变量
ans
为0,用于记录最大的和值
翁佳明
·
2024-01-26 00:45
LeetCode
leetcode
算法
职场和发展
算法训练营day49_动态规划
算法训练营day49_动态规划121.买卖股票的最佳时机贪心左边大的没用;枚举每一天,更新
ans
,若小于买入,更新买入;classSolution{public:intmaxProfit(vector&
摘樱桃几百遍
·
2024-01-25 22:55
代码随想录打卡
算法
动态规划
leetcode
代码随想录算法训练营day2| leetcode977有序数组的平方、209长度最小的子数组、59螺旋矩阵
收获1】对数组进行排序时可以使用sort函数sort(Array.begin(),Array.end());【收获2】数组中的push_back()函数的使用方法vectorans;//定义一个新的容器
ans
WEnyue4261
·
2024-01-25 21:00
代码随想录算法训练营
算法基础
数据结构
力扣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
上一页
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
其他