上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: https://codeforces.com/contest/1899 一个小游戏 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n; int ma 阅读全文
posted @ 2023-12-09 18:11 深渊之巅 阅读(26) 评论(0) 推荐(0)
摘要: i2c i2c中发出时钟信号的是主机。主机通过地址来访问从机。 发送数据到总线的叫发送器,接受数据的器件叫接收器。 在物理结构上,i2c由一条串行总线SDA和一条串行时钟总线SCL构成。 I2C基本编程步骤:初始化时钟、配置引脚、起始信号、读、写、终止信号 使用到的中断:I2C2_EV_IRQHan 阅读全文
posted @ 2023-12-09 15:53 深渊之巅 阅读(256) 评论(0) 推荐(0)
摘要: 串行外设接口SPI模块 spi分为主从两种模式,一个spi通讯系统要包含一个主设备和一个或多个从设备。提供时钟的是主设备。 spi的读写操作都是从主设备发起的。 SPI信号线 SPI接口一般使用四条信号线通信: SDI(数据输入),SDO(数据输出),SCK(时钟),CS(片选) MISO: 主设备 阅读全文
posted @ 2023-12-09 15:10 深渊之巅 阅读(284) 评论(0) 推荐(0)
摘要: .... 阅读全文
posted @ 2023-12-06 11:05 深渊之巅 阅读(11) 评论(0) 推荐(0)
摘要: 枚举子数组问题,常见有固定一个点,枚举另一个端点,还有枚举中间点。 本题使用双指针算法,对右端点进行枚举,每次累加[l, r]区间内,所有以右端点为结尾的子数组对答案的贡献度,也就是长度 r- l + 1 class Solution: def countSubarrays(self, nums: 阅读全文
posted @ 2023-12-03 09:56 深渊之巅 阅读(33) 评论(0) 推荐(0)
摘要: 题目不难,但是涉及到的知识点很丰富。 细节: 左右两侧同时找小于,会重复计数,同时小于等于又会少算。 加个限制,左侧找小于等于,右侧找小于,就可解决。 详细分析:https://leetcode.cn/problems/sum-of-subarray-minimums/solutions/25446 阅读全文
posted @ 2023-11-27 17:15 深渊之巅 阅读(25) 评论(0) 推荐(0)
摘要: 简单模拟即可: class Solution { public: vector<int> findWordsContaining(vector<string>& words, char x) { int n = words.size(); vector<int> res; for(int i = 0 阅读全文
posted @ 2023-11-27 16:54 深渊之巅 阅读(12) 评论(0) 推荐(0)
摘要: flash闪存,可以一种可编程式存储器 flash结构体定义 typedef struct { __IO uint32_t ACR; /*!< FLASH access control register, Address offset: 0x00 */ 访存控制器 __IO uint32_t PDK 阅读全文
posted @ 2023-11-26 18:56 深渊之巅 阅读(145) 评论(0) 推荐(0)
摘要: dfs 深度优先搜索:一条路走到黑 基本模型: Returntype dfs(参数) { 判断边界(返回) 扩展状态 dfs下一步 返回} dfs + 记忆返回值 = 记忆化搜索 class Solution { public: int minPathCost(vector<vector<int>> 阅读全文
posted @ 2023-11-22 20:21 深渊之巅 阅读(15) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<climits> using namespace std; typedef long long LL; const int N = 5 阅读全文
posted @ 2023-11-22 19:33 深渊之巅 阅读(12) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 10 下一页