自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 资源 (1)
  • 收藏
  • 关注

原创 【小机箱鼠标键盘几乎失灵】

机箱鼠标键盘失灵

2022-12-11 17:00:33 179 1

原创 leetcode 899. Orderly Queue

math

2022-08-03 14:47:12 106

原创 linux/ubuntu查看磁盘空间

查看磁盘空间

2022-07-22 10:41:59 412

原创 查看cuda版本

代码】查看cuda版本。

2022-07-20 16:06:38 385

原创 C++ 字符串 连等

C++语法

2022-06-11 14:54:43 446

原创 不理解的python

python总有自己意识之外的事情>>> m=[[0]*3]*3>>> m[[0, 0, 0], [0, 0, 0], [0, 0, 0]]>>> m[0][0]=1>>> m[[1, 0, 0], [1, 0, 0], [1, 0, 0]]为什么?给一个元素赋值,竟然给三个元素赋值了?这种初始化方式为什么会这样啊?python列表初始化...

2022-04-14 22:46:17 200

原创 ZJ2 编程题1

字节跳动 2018描述有三只球队,每只球队编号分别为球队1,球队2,球队3,这三只球队一共需要进行 n 场比赛。现在已经踢完了k场比赛,每场比赛不能打平,踢赢一场比赛得一分,输了不得分不减分。已知球队1和球队2的比分相差d1分,球队2和球队3的比分相差d2分,每场比赛可以任意选择两只队伍进行。求如果打完最后的 (n-k) 场比赛,有没有可能三只球队的分数打平。输入描述:第一行包含一个数字 t (1 <= t <= 10)接下来的t行每行包括四个数字 n, k, d1, d2(1 &lt

2022-04-13 10:31:14 122

原创 leetcode 单调数列、用好函数

单调数列class Solution {public: bool isMonotonic(vector<int>& nums) { return is_sorted(nums.begin(), nums.end()) || is_sorted(nums.rbegin(), nums.rend()); }};计算机的思路class Solution {public: bool isMonotonic(vector<int&gt

2022-04-11 10:33:46 210

转载 KPM讲解

LC_KPM

2022-04-11 08:29:52 144

原创 leetcode796. 旋转字符串 Rotate String

Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s.A shift on s consists of moving the leftmost character of s to the rightmost position.For example, if s = “abcde”, then it will be “bcdea” after o

2022-04-10 15:31:51 556

原创 leetcode 804. Unique Morse Code Words

International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:‘a’ maps to “.-”,‘b’ maps to “-…”,‘c’ maps to “-.-.”, and so on.For convenience, the full table for the 26 letters of the Englis

2022-04-10 15:25:23 204

原创 leetcode之House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatica

2022-04-10 15:21:15 240

原创 leetcode 780. Reaching Points

Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false otherwise.The allowed operation on some point (x, y) is to convert it to either (x, x + y) or (x +

2022-04-09 22:07:57 379

转载 矩阵快速幂

矩阵快速幂https://leetcode-cn.com/problems/climbing-stairs/solution/pa-lou-ti-by-leetcode-solution/

2022-04-08 15:51:27 69

原创 leetcode744. 寻找比目标字母大的最小字母

给你一个排序后的字符列表 letters ,列表中只包含小写英文字母。另给出一个目标字母 target,请你寻找在这一有序列表里比目标字母大的最小字母。在比较时,字母是依序循环出现的。举个例子:如果目标字母 target = ‘z’ 并且字符列表为 letters = [‘a’, ‘b’],则答案返回 ‘a’示例 1:输入: letters = [“c”, “f”, “j”],target = “a”输出: “c”示例 2:输入: letters = [“c”,“f”,“j”], target

2022-04-08 12:03:09 112

原创 leetcode63. 不同路径 II

路径有障碍,向右向下障碍1, 空0class Solution {public: int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) { // vector<vector<int>> path=obstacleGrid; int m=obstacleGrid.size(); int n=obstacleGrid[0]

2022-04-08 09:09:40 54

原创 leetcode 75. 颜色分类

思路一:0换到前面,2换到后面class Solution {public: void sortColors(vector<int>& nums) { int i=0,j=nums.size()-1; int temp; for(int k=0;k<nums.size();k++){ if(nums[k]==0){ swap(nums[k],nums[i]);

2022-04-07 13:34:53 192

原创 leetcode118. 杨辉三角

方法一:def com( n, m): if m==0: return 1 result=1 result2=1 for i in range(1,m+1): result=result*(n+1-i)/i return int(result)class Solution: def generate(self, numRows: int) -> List[List[int]]: L

2022-04-06 23:31:18 259

原创 661. 图片平滑器

图像平滑器 是大小为 3 x 3 的过滤器,用于对图像的每个单元格平滑处理,平滑处理后单元格的值为该单元格的平均灰度。每个单元格的 平均灰度 定义为:该单元格自身及其周围的 8 个单元格的平均值,结果需向下取整。(即,需要计算蓝色平滑器中 9 个单元格的平均值)。如果一个单元格周围存在单元格缺失的情况,则计算平均灰度时不考虑缺失的单元格(即,需要计算红色平滑器中 4 个单元格的平均值)。class Solution {public: vector<vector<int>&

2022-04-02 21:46:53 559

原创 c++语法 字符串

字符串c++语法string类用s.size()统计个数字符串用strlen(s)统计

2022-04-02 10:02:43 405

原创 数组类算法 运用基础算法思想

合并两个有序数组def quicksort(nums): if len(nums)<2: return nums m=math.floor(len(nums)/2) pivot=nums[m] less=[i for i in nums[:m] if i <=pivot]+[i for i in nums[m+1:] if i<=pivot] greater=[i for i in nums[:m] if i >pivot]+

2022-04-01 22:25:42 1004

原创 leetcod217. 存在重复元素

给你一个整数数组 nums 。如果任一值在数组中出现 至少两次 ,返回 true ;如果数组中每个元素互不相同,返回 false 。示例 1:输入:nums = [1,2,3,1]输出:true示例 2:输入:nums = [1,2,3,4]输出:false示例 3:输入:nums = [1,1,1,3,3,4,3,2,4,2]输出:true提示:1 <= nums.length <= 105-109 <= nums[i] <= 109思路0:蒙特卡洛法b

2022-04-01 21:41:49 1536

原创 数组类算法 做好初始定义

给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。请注意 ,必须在不复制数组的情况下原地对数组进行操作。示例 1:输入: nums = [0,1,0,3,12]输出: [1,3,12,0,0]示例 2:输入: nums = [0]输出: [0]提示:1 <= nums.length <= 104-231 <= nums[i] <= 231 - 1作者:力扣 (LeetCode)链接:https://leetcode-

2022-03-30 21:26:33 223

原创 场景文字消除

图像修复Pixel-CNN变分自编码器GAN需要了解 前两个

2021-11-22 14:16:23 1662

原创 numpy操作

维数np.ndim(A)A.shape返回元组(tuple)A.shape[0]点乘/点积np.dot(A,B)或A@B 需要 A的第1维 和 B的第0维 相等,否则报错“not aligned”

2021-10-20 18:23:23 57

原创 linux命令

nautilus . 可视化图形界面当前文件夹

2021-10-18 19:19:12 66

原创 网速命令行测速

常用启动命令:服务端:saneri@saneri-VirtualBox:~$ iperf3 -s -p 12345 -i 1客户端:C:\Users\iperf3>iperf3.exe -c 192.168.1.43 -p 12345 -i 1 -t 20 -w 100k

2021-10-13 14:55:57 393

原创 C++字符串操作库函数

C++字符串操作库函数其中重要的:

2021-10-05 16:18:18 89

原创 leetcode162. Find Peak Element

Find Peak ElementA peak element is an element that is strictly greater than its neighbors.Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.You may imagin.

2021-09-27 22:55:19 295

原创 leetcode153. 寻找旋转排序数组中的最小值

已知一个长度为 n 的数组,预先按照升序排列,经由 1 到 n 次 旋转 后,得到输入数组。例如,原数组 nums = [0,1,2,4,5,6,7] 在变化后可能得到:若旋转 4 次,则可以得到 [4,5,6,7,0,1,2]若旋转 7 次,则可以得到 [0,1,2,4,5,6,7]注意,数组 [a[0], a[1], a[2], …, a[n-1]] 旋转一次 的结果为数组 [a[n-1], a[0], a[1], a[2], …, a[n-2]] 。给你一个元素值 互不相同 的数组 nums

2021-09-25 15:22:09 74

原创 leetcode74. 搜索二维矩阵

题目在这里编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性:每行中的整数从左到右按升序排列。每行的第一个整数大于前一行的最后一个整数。示例 1:输入:matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3输出:true示例 2:输入:matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13输出:false提示:m ==

2021-09-24 13:15:51 53

原创 leetcode33. 搜索旋转排序数组

整数数组 nums 按升序排列,数组中的值 互不相同 。在传递给函数之前,nums 在预先未知的某个下标 k(0 <= k < nums.length)上进行了 旋转,使数组变为 [nums[k], nums[k+1], …, nums[n-1], nums[0], nums[1], …, nums[k-1]](下标 从 0 开始 计数)。例如, [0,1,2,4,5,6,7] 在下标 3 处经旋转后可能变为 [4,5,6,7,0,1,2] 。给你 旋转后 的数组 nums 和一个整数 ta

2021-09-24 11:10:22 53

原创 leetcode 34. 在排序数组中查找元素的第一个和最后一个位置

给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。如果数组中不存在目标值 target,返回 [-1, -1]。进阶:你可以设计并实现时间复杂度为 O(log n) 的算法解决此问题吗?示例 1:输入:nums = [5,7,7,8,8,10], target = 8输出:[3,4]示例 2:输入:nums = [5,7,7,8,8,10], target = 6输出:[-1,-1]示例 3:输入:nums = [], t

2021-09-23 20:23:16 52

原创 NC105 二分查找-II

题目:描述请实现有重复数字的升序数组的二分查找给定一个 元素有序的(升序)整型数组 nums 和一个目标值 target ,写一个函数搜索 nums 中的第一个出现的target,如果目标值存在返回下标,否则返回 -1示例1输入:[1,2,4,4,5],4返回值:2说明:从左到右,查找到第1个为4的,下标为2,返回2示例2输入:[1,2,4,4,5],3返回值:-1示例3输入:[1,1,1,1,1],1返回值:0代码:class Solution {public:

2021-09-23 17:56:13 70

原创 CLion(失败一)

在win10上,工位的台式机安装CLion,重启之后打不开了正常安装,创建连接时.c,.cpp,.h等一系列我都勾选了18年之后的不能用激活码了刚安装完我就用了网上下的license,试用期本来就是满的,看不出有啥效果刷算法题的程序放进去,报错看不懂,甚至using namespace std;都报错网上说可能是配置问题,于是进行的操作:安装mingw64,为了有编译C的gcc.exe和编译C++的g++.exemingw64/bin添加到环境变量,命令行gcc -v测试ming64和v

2021-09-23 15:22:09 573

C#串口通信

串口通信概述 串行通信控件与API函数 PC与PC串口通信实例

2017-09-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除