总和leetcode 39
Leetcode437. 路径总和 III
``` /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ......
[LeetCode] 2013. Detect Squares
You are given a stream of points on the X-Y plane. Design an algorithm that: Adds new points from the stream into a data structure. Duplicate points a ......
CF1853C Ntarsis' Set
[Miku](https://codeforces.com/contest/1853/problem/C) 一道逆向思维的题目。 我们假设最后的最小的数是个1,放在第一个位置上,然后我们往数列开头按照规则插入0,其中应该插在这个1后面的,我们视为无效插入,插在这个1前面的,我们视为有效插入。 显然随 ......
Codeforces 1852A Ntarsis' Set 题解
题目传送门:[Codeforces 1852A Ntarsis' Set](https://codeforces.com/contest/1852/problem/A) # 题意 给定一个集合,里面初始有 $1,2,3...10^{1000}$,告诉你每天会拿掉其中的第 $a_1, a_2, a_3 ......
go刷题Leetcode,生成文件夹与go文件模板
## go生成文件夹与模板 ### 起因 以前是用C/C++刷Leetcode时,将多个C/CPP文件放在同一个目录下,没有出任何问题,但是换成Go语言刷题。 在一个目录下创建多个go文件,每个文件都是以下 ```go package main func main(){ } ``` 在vscode下 ......
leetcode1448好节点深刻理解DFS+BFS
DFS 没有返回值 max在递归时要慎重用引用,因为在回溯时可能不能改变max; 因为节点的值可能有负数,所以最大值从根节点开始,根节点一定是好节点。 int goodNum=0; void dfs(TreNode* root,int max){ if(!root)return ; if(root- ......
LeetCode 热题 100 之 53. 最大子数组和
# 题目 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 **示例 1:** 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大, ......
HDU4738 Caocao's Bridges
## [$HDU4738$ $Caocao$'$s$ $Bridges$](https://blog.csdn.net/u012587561/article/details/48959779) ### 一、题目描述 曹操在长江上建立了一些点,点之间有一些边连着。如果这些点构成的无向图变成了连通图,那 ......
/tmp/ccVJLYWf.s:589: Error: selected processor does not support `cpsid i' in ARM mode 解决办法
linux20@ubuntu:~/Desktop/new$ arm-none-eabi-gcc -c ec_main.c /tmp/ccVJLYWf.s: Assembler messages:/tmp/ccVJLYWf.s:589: Error: selected processor does n ......
Python的OCR工具pytesseract解决TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information环境变量问题
pytesseract是基于Python的OCR工具, 底层使用的是Google的Tesseract-OCR 引擎,支持识别图片中的文字,支持jpeg, png, gif, bmp, tiff等图片格式。 如何安装使用请看我的上一篇。 在使用pytesseract打开图片是遇到没有找到文件解决pyt ......
LeetCode 406. 根据身高重建队列
``` class Solution { public: struct node { int val; int pre; node* next; node(int a,int b,node* c) { val=a; pre=b; next=c; } }; void insert(node* &hea ......
Cloud Ace 成为 Google Cloud Next '23 联合赞助商
Cloud Ace, Inc.(总部位于东京千代田区;总裁青木诚;以下简称“Cloud Ace”)将成为 Google Cloud Next '23 的基金会赞助商。Google Cloud 将于 2023 年 8 月 29 日(星期二)至 8 月 31 日(星期四)在加利福尼亚州旧金山举办该活动。 ......
[LeetCode] 2208. Minimum Operations to Halve Array Sum
You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Not ......
leetcode第354场周赛 2 - 双指针
[题目传送门](https://leetcode.cn/contest/weekly-contest-354/) # [2779. 数组的最大美丽值](https://leetcode.cn/problems/maximum-beauty-of-an-array-after-applying-ope ......
LeetCode 热题 100 之 21. 合并两个有序链表
# 题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** 输入:l1 = [1,2,4], l2 = [1,3,4] 输出:[1,1,2,3,4,4] **示例 2:** 输入:l1 = [], l2 = [] 输出:[] **示 ......
LeetCode 热题 100 之 560. 和为 K 的子数组.md
# 题目 给你一个整数数组 nums 和一个整数 k ,请你统计并返回 该数组中和为 k 的连续子数组的个数 。 **示例 1:** 输入:nums = [1,1,1], k = 2 输出:2 **示例 2:** 输入:nums = [1,2,3], k = 3 输出:2 **提示:** 1 int ......
[Leetcode Weekly Contest]355
链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-355/) ## [Leetcode]6921. 按分隔符拆分字符串 给你一个字符串数组 words 和一个字符 separator ,请你按 separator 拆分 word ......
CF506E Mr. Kitayuta's Gift 思考--zhengjun
妙妙题。 首先可以有一个 $O(kn^2)$ 的 dp,但是显然不行。 但是,发现其中的大多数转移都浪费在自环上了,所以考虑不要这个东西。 这个 dp 一共有三种转移: 1. 左右端点一起向内移动一格; 2. 左端点或右端点单独移动; 3. 左右端点都不动。 所以考虑加一维 $k$ 表示走了 $k$ ......
前端请求报错:'JSON parse error: syntax error, expect {, actual e…1, line 1, column 2selectUid%5B%5D=VluJeA9upFXgJD', code: '500'}
1、如果不用 JSON.stringify(inputJson) 包起来就会报错 let inputJson = {"selectUid" : selectUid}; var response = await $.ajax({ type: 'POST', url: 'xxx', data: inpu ......
rgi heatmap 报错AttributeError: 'DataFrame' object has no attribute 'append'
在使用rgi heatmap 时候运行时候报错: rgi heatmap -i rgi_json/ --output rgi_heatmap -cat gene_family -clus samples 报错: Traceback (most recent call last): File "/gp ......
LeetCode 热题 100 之 438. 找到字符串中所有字母异位词
# 题目 给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。不考虑答案输出的顺序。 异位词 指由相同字母重排列形成的字符串(包括相同的字符串)。 **示例 1:** 输入: s = "cbaebabacd", p = "abc" 输出: [0,6] 解释: ......
【题解】Ntarsis' Set - Codeforces 1852A
**出处:** Codeforces Round 887 **链接:** https://codeforces.com/problemset/problem/1852/A **题目大意:** 给定一个包含 $n$ 个正整数的表示删除位置的严格升序序列 $p$ ,以及另外一个连续正整数的被删除的无穷序 ......
vmware6.7安装vc报错VMware VirtualCenter failed firstboot. An error occurred while starting service 'vpxd'
错误 VMware VirtualCenter failed firstboot. An error occurred while starting service 'vpxd' 解决方案 Please search for these symptoms in the VMware Knowledg ......
LeetCode 热题 100 之 3. 无重复字符的最长子串
# 题目 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: s = "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串 ......
idea解析sql语句报错:Unable to resolve column 'uname'
### 1. 如题  ### 2. 解决办法  { unordered_set node;//记录所有节点 unordered_map> g; ......
sqlserver:拒绝了对对象 'QualityChxxx' (数据库 'xxx',架构 'dbo')的 SELECT 权限
选择 数据库(xxxx) —>安全性—->架构—->dbo(属性)—>权限—>添加—>浏览–>QualityChxxx ......
Cannot read properties of undefined (reading 'state') 或者 Cannot read properties of undefined (reading 'commit')
第一步,先检查是否在main.js中引入 store.js 如果检查完都引入了,且还是存在报错,第二步: 在 package.json 将vuex 的版本更换为其它版本,并从新yarn安装,建议vuex 版本为 3.0然后从新启动项目即可解决 ......
Codeforces Round 887 (Div 2) C. Ntarsis' Set
Ntarsis' Set 题意是给你n个数,每次按照顺序删除位于a[i]位置的这n个数,问k次后最小的是多少 参考这位大佬的题解Codeforces Round 887 (Div 2)A~C - 知乎 (zhihu.com) 结合一个官方题解,进行一次操作后,由于前面删掉i个数,a[i]到a[i+1 ......