acwing 123

acwing -- 3745. 牛的学术圈 I

h指数问题,当看到题目要求最大,最小的字眼是,可以想到二分,dp,枚举。 本题采用二分答案,对h指数进行二分。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ......
学术 acwing 3745

acwing -- 3370. 牛年

大模拟,本题我们可以唯一确定每头牛的相对年龄。 若无法确定牛的相对年龄,可以用图论进行遍历。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<unordered_map> using ......
acwing 3370

acwing -- 3358. 放养但没有完全放养

利用计数的思想,把每个字母分配到26个桶中,下标从小到大排序,利用upper_bound即可判断 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int ma ......
acwing 3358

acwing -- 3346. 你知道你的ABC吗

简单模拟,最小的两个数字是a, b, 最大的数字时a + b + c #include<iostream> #include<cstdio> #include<algorithm> #include<set> using namespace std; int main() { multiset<in ......
acwing 3346 ABC

[TM4]TM4C123G使用笔记(一)

# [TM4]TM4C123G使用笔记(一) TI的板子真让人头大😓甚至重装了两遍KEIL5 如何用keil5新建工程可以参考如下博客: https://blog.csdn.net/D_XingGuang/article/details/89390211?spm=1001.2014.3001.55 ......
TM4 笔记 TM 123G C123

AcWing 340. 通信线路

题目传送门:340. 通信线路 - AcWing题库 题目大致意思 对于一条路径,他的花费是,其经过的所以路线中花费最大的一条,你可以选择k条线,使其变为免费,求1到n的最小花费。 解题方法 本题可以用spfa加上dp来写。 对于同样是单源最短路,不可以用dijkstra的原因是:该题会将路径更改为 ......
线路 AcWing 340

山东大学考研机试--AcWing 3717. 整数序列

## 题目描述 很多整数可以由一连串的整数序列(至少两个数)相加而成,比如 25=3+4+5+6+7=12+13。输入一个整数 N,输出 N 的全部整数序列,如果没有则输出 NONE。 ## 输入格式 一个整数 N。 ## 输出格式 每行输出一个满足条件的整数序列。 序列内部元素从小到大排序。 优先 ......
整数 序列 AcWing 大学 3717

关于 AcWing 网站及延伸

--AcWing 网站 https://www.acwing.com/ AcWing 是一个在线编程学习平台,提供了各种算法和工程课程,以及丰富的题库和活动。你可以在 AcWing 上学习编程知识,刷题练习,参加比赛,或者和其他同学交流。 AcWing 的名字来源于英文单词 “acwing”,意思是 ......
AcWing 网站

123. 买卖股票的最佳时机 III

1. 题目 读题 考查点 2. 解法 思路 有两种解法 动态规划 双指针 代码逻辑 具体实现 动态规划 思路 动态规划的思路是这样的: 我们可以把问题分解成多个子问题,每个子问题都是在某一天结束时,完成了多少次交易,手上是否持有股票,以及此时的最大利润是多少。 我们可以用一个二维数组来表示这些子问题 ......
时机 股票 123 III

acwing 智商药

题目链接:5046. 智商药 - AcWing题库 首先考虑dfs 不用想肯定超时 过了10/17个测试点 代码 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 typedef pair<int,int> PII; 5 typedef lon ......
智商 acwing

AcWing,第110场周赛 智商药

## [AcWing,第110场周赛 智商药](https://www.acwing.com/problem/content/5049/) tag:树状数组, 线段树,二维数点(因为有 $r$ 这个限制,算吧) 分析:当吃药时 $r$ 时,只有 $[l, r - 1]$ 的方法对答案有贡献,不难看出 ......
智商 AcWing 110

AcWing,第108场周赛T3 拼接数组

## [AcWing,第108场周赛T3](https://www.acwing.com/problem/content/description/5043/) 前置知识:[P1115 最大子段和](https://www.luogu.com.cn/problem/P1115) 的dp和线段树作法 分 ......
数组 AcWing 108

123

第一题我稍微给你改了改, 第三题很简单,就是枚举i,check(i)返回i是不是我要的那个数,比较方法就是一直%10(取个位),然后/10,比如25和5,%10都是5 第二题自己看着改一改,思路就是枚举两个串的首个相同位置 i 和 j ,比较i+k和j+k,k一直加 自己稍微改一改,祝顺利!! t1 ......
123

AcWing 3662. 最大上升子序列和

## [$AcWing$ $3662$. 最大上升子序列和](https://www.acwing.com/problem/content/description/3665/) ### 一、题目描述 给定一个长度为 $n$ 的整数序列 $a_1,a_2,…,a_n$。 请你选出一个该序列的 **严格 ......
序列 AcWing 3662

Authentication to host '10.167.32.123' for user 'root' using method 'mysql_native_password' failed with message: Reading from the stream has failed

连接Mysql5.7以上的版本的数据库出现报错: C#连接远程连接mysql时,抛异常:Authentication to host '10.167.32.123' for user 'root' using method 'mysql_native_password' failed with me ......

算法刷题笔记(一)(1) Acwing.153. 双栈排序

## Solution https://www.acwing.com/problem/content/155/ ##### **二分图,染色,贪心 O(n^2)** 性质 > 当且仅当i a[i]>a[k] 那么j和j之后的元素一定在i之后出栈,所以当序列遍历到j时,一定可以让i出栈,进而j就可以进 ......
算法 笔记 Acwing 153

123

```bash #!/bin/bash # 设置参数和路径 SECRET_KEY="liberty carbon thing glass unlock crucial today report lemon arm orient miss deputy despair delay faint razo ......
123

Acwing 4440 照相

# Acwing 4440 照相 ### [原题指路](https://www.acwing.com/problem/content/4443/) 因为序列长为偶数,考虑将牛进行两两分组 ![](https://img2023.cnblogs.com/blog/3163322/202306/3163 ......
Acwing 4440

算法学习day50动态规划part11-123、188

package LeetCode.DPpart11; /** * 123. 买卖股票的最佳时机 III * 给定一个数组,它的第 i 个元素是一支给定的股票在第 i 天的价格. * 设计一个算法来计算你所能获取的最大利润。你最多可以完成两笔交易。 * 注意:你不能同时参与多笔交易(你必须在再次购买前 ......
算法 动态 part day 123

【acwing】Trie字符串统计

Trie树 学习感受 相比于之前学习的kmp匹配算法,Trie树的实现还是非常好理解的。(kmp算法太难了orz) 从直观的模拟过程来看,trie树就像一颗树一样,从上(根节点)到下(叶节点)有序串联起来组成一个字符串。 每一个额外标记结束的位置表示字符串的结束,通过计算标记数即可指导一共有多少该字 ......
字符串 字符 acwing Trie

123. 买卖股票的最佳时机 III

给定一个数组,它的第 i 个元素是一支给定的股票在第 i 天的价格。 设计一个算法来计算你所能获取的最大利润。你最多可以完成 两笔 交易。 注意:你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。 ``` 输入:prices = [3,3,5,0,0,3,1,4] 输出:6 解释:在第 ......
时机 股票 123 III

123

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <script src="js/jquery-1.12.4.js"></script> <style> article{ height: 100p ......
123

#123

- By assigning different weights to the authentic and forged classes, Weight-BCELoss ensures that the model pays more attention to the minority class ......
123

前缀和 (Acwing_796 子矩阵的和)

[题目](https://www.acwing.com/activity/content/problem/content/830/) ![S[i,j]](https://img2023.cnblogs.com/blog/3096145/202305/3096145-20230529172938685 ......
前缀 矩阵 Acwing 796

Acwing 798.差分矩阵(模板)

[题目](https://www.acwing.com/problem/content/800) ``` #include using namespace std; const int N = 1010; int n, m, q; int a[N][N], b[N][N]; void insert( ......
矩阵 模板 Acwing 798

AcWing906.区间分组

# 题目详情 ![](https://img2023.cnblogs.com/blog/2826001/202305/2826001-20230523165112258-327765903.png) # 知识点 区间贪心 还是按照某端点值进行排序 从提出算法->验证算法有效性 # 思路 #### 做 ......
区间 AcWing 906

AcWing 99. 激光炸弹

......
炸弹 激光 AcWing 99

AcWing905.区间选点

# 题目详情 ![](https://img2023.cnblogs.com/blog/2826001/202305/2826001-20230522193234818-1657453835.png) # 知识点 区间贪心 **为什么叫贪心呢?** ——**短视**,每次只是在看眼前的东西,在眼前的 ......
区间 AcWing 905

AcWing901. 滑雪(python)

# 题目详情 ![](https://img2023.cnblogs.com/blog/2826001/202305/2826001-20230522162406198-673075706.png) ![](https://img2023.cnblogs.com/blog/2826001/20230 ......
AcWing python 901

AcWing900.整数划分(python)

# 题目详情 ![](https://img2023.cnblogs.com/blog/2826001/202305/2826001-20230522152834670-504842011.png) # 知识点 **计数类DP** 分析题目,k个数是默认排好序的,也就是说,对于划分我们的考虑是无序的 ......
整数 AcWing python 900