结点leetcode 19
Leetcode2585. 获得分数的方法数
 ## 题解 多重背包的模板 f[i][j]表示前i种题目得分为j的方案数 f[i][j] += f[i-1][j- ......
LeetCode/最小面积矩形
给一系列顶点,计算这些点能组成矩形的最小面积 ###1. 最小面积矩形(列举对角线+哈希) **矩形的边平行于x轴和y轴** 通过双重循环列举对角线顶点,计算满足条件的矩形面积 ``` class Solution { public: int minAreaRect(vector>& points) ......
[LeetCode] 2451. Odd String Difference
You are given an array of equal-length strings words. Assume that the length of each string is n. Each string words[i] can be converted into a differe ......
每日一题 力扣 1377 https://leetcode.cn/problems/frog-position-after-t-seconds/
力扣 1377 https://leetcode.cn/problems/frog-position-after-t-seconds/ 这道题目用dp去做,构建邻接矩阵,做的时候需要注意题目条件,如果青蛙跳不动了,这个概率就保持不变了 一般跳青蛙,很容易想到dp 核心代码如下 public doub ......
AT_wtf19_c2 Triangular Lamps Hard 解题报告
[AT_wtf19_c2 Triangular Lamps Hard](https://www.luogu.com.cn/problem/AT_wtf19_c2) 解题报告: 做法参考自 [WTF C2 Triangular Lamps Hard 別解法 by yosupo](https://yos ......
[LeetCode] 1344. Angle Between Hands of a Clock 时钟指针的夹角
Given two numbers, `hour` and `minutes`, return *the smaller angle (in degrees) formed between the *`hour`* and the *`minute`* hand*. Answers within ` ......
LeetCode 98. 验证二叉搜索树
``` class Solution { public: vector dfs(TreeNode* root)//依次返回是否是二叉搜索树,最大值最小值 { vector res{1,root->val,root->val}; if(root->left) { auto l=dfs(root->le ......
LeetCode 222. 完全二叉树的节点个数
``` class Solution { public: int countNodes(TreeNode* root) { if(!root) return 0; auto l=root->left,r=root->right; int x=1,y=1;//记录左右两边层数 while(l) l=l ......
二刷Leetcode-Days07
动规: /** * 70. 爬楼梯 * @param n * @return */ public int climbStairs(int n) { if (n <= 2) { return n; } int[] dp = new int[n]; dp[0] = 1; dp[1] = 2; for ( ......
upload-labs靶场第19关
这关是一个文件包含漏洞 文件解析 先上传一个图片木马 进行抓包获取路径 因为服务器会把上传的文件重命名一个新的 因为他是先验证 然后上传到服务器 所以他的文件路径要改 配合文件漏洞获取他的信息查看源代码提示这一关做了白名单验证文件上传后先保存在对象中 随后对文件进行判断存在,检查扩展名,检查大小,重 ......
【双指针】LeetCode 340. 至多包含 K 个不同字符的最长子串
# 题目链接 [340. 至多包含 K 个不同字符的最长子串](https://leetcode.cn/problems/longest-substring-with-at-most-k-distinct-characters/description/ "340. 至多包含 K 个不同字符的最长子串 ......
[LeetCode] 1090. Largest Values From Labels
There is a set of n items. You are given two integer arrays values and labels where the value and the label of the ith element are values[i] and label ......
leetcode2215哈希列表的应用
哈希列表存储的是不重复的元素,使用两个哈希列表存储这两个数组。再遍历其中一个哈希列表,查看是否存在另一个哈希列表中 set.insert() set1.count(元素) for(int num:nums1){ set1.insert(num); } for(int num:set1){ if(!s ......
19-RestClient查询文档-快速入门
我们以match_all查询为例 发起查询请求 代码解读 第一步,创建SearchRequest对象,指定索引库名 第二步,利用request.source()构建DSL,DSL中可以包含查询、分页、排序、高亮等 query():代表查询条件,利用QueryBuilders.matchAllQuer ......
LeetCode 95. 不同的二叉搜索树 II
``` class Solution { public: vector dfs(int l,int r)//返回以n为根节点的所有可能子树 { vector res; if(l>r) return {NULL}; for(int k=l;k left=dfs(l,k-1); vector right ......
打卡19
 ~~~c++ #include #include #include using namespace std ......
考研数学⭐每天几道题:通过去根号找寻被隐藏的变限积分(2023年5月19日)
 ## 1️⃣ [被根号隐藏的变限积分](https://zhaokaifeng.c ......
LeetCode 103. 二叉树的锯齿形层次遍历
``` class Solution { public: vector> res; void bfs(TreeNode* root) { queue q; q.push(root); int cnt=0; while(!q.empty()) { vector level; int len=q.siz ......
LeetCode 周赛 346(2023/05/21)仅 68 人 AK 的最短路问题
> **本文已收录到 [AndroidFamily](https://github.com/pengxurui/AndroidFamily),技术和职场问题,请关注公众号 [彭旭锐] 提问。** - [LeetCode 单周赛第 345 场 · 体验一题多解的算法之美](https://mp.wei ......
5.19学习总结-大道至简
大道至简,是宇宙万物发展之规律,是中华文化之精髓,是中华道家哲学,是大道理极其简单,简单到一两句话就能说明白。所谓“真传一句话,假传万卷书”。 “万物之始,大道至简,衍化至繁”出自老子的《道德经》。大道至简,不仅被哲学流派道家、儒家等所重视,也是人生在世的生活境界。 大道至简,大道无形,大道无法,这 ......
【2023-05-19】连岳摘抄
20:00 长存虔敬之心,善养赤子之趣,不断求索如海滩拾贝,得失不计,融入社会而怡然自得。 ——任继周 好人也不能犯原则性的错误。有时候,这种错误只要犯一次,一生就归零,甚至是负数。这是人生极其严酷的规律。许多像你爸爸这种破产的人,不仅是好人,往往还是聪明人。遗憾的是,只要犯了投资的原则性错误,好人 ......
5月19日总结
pytorch学习笔记——timm库 当使用ChatGPT帮我们工作的时候,确实很大一部分人就会失业,当然也有很大一部分人收益其中。我今天继续使用其帮我了解新的内容,也就是timm库。毫不夸张的说,Chat GPT比百分之80的博客讲的更清楚更好,仅次于源码。 当提到计算机视觉的深度学习框架时,Py ......
c语言刷leetcode——二分搜索
https://leetcode.cn/problems/path-with-minimum-effort/solutions/1345046/er-fen-by-dvuszkq61y-6vr1/ -- go语言的slice和rust语言的Vec的扩容流程是什么?
# go语言的slice和rust语言的Vec的扩容流程是什么? ## 文心一言: 在Go语言中,slice(切片)和Rust语言中的Vec都是用于存储一组固定长度的元素的数据结构。它们的扩容流程略有不同,下面是它们的基本概述: 1.Go语言的slice扩容: 当Go语言的slice用完了可用空间时 ......
5月19日打卡
例5-1 题目:作用域实例 clude <iostream> using namespace std; int i; int main#in() { i=5; { int i; i=7; cout<<"i="<<i<<endl; } cout<<"i="<<i<<endl; return 0; } ......
leetcode1493
递归: 1.记pre[i]为以i位置结尾的连续1长度。 pre[i]=0;ai=0 pre[i]=pre[i-1]+1;ai=1 记suf[i]为以位置i开头的连续1长度; suf[i]=0;ai=0 suf[i]=suf[i+1]+1;ai=1 计算删掉i位置的连续1的长度为pre[i-1]+su ......