Loading

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 75 下一页
摘要: 本文转载自:https://blog.csdn.net/qq_37268511/article/details/103486142 有时候我们并不想跳转到系统自定义的错误页面中,那么我们需要自定义页面并且实现它的跳转 有三种方法可以实现 方法一:最简单的实现,也是最快的 在web.xml下配置如下: 阅读全文
posted @ 2021-04-11 09:58 拾月凄辰 阅读(1010) 评论(0) 推荐(0) 编辑
摘要: 本文来源:https://blog.csdn.net/weixin_44411398/article/details/112510646 1. 打开链接https://github.com.ipaddress.com/,在搜索框中输入网址 github.com 得到如下搜索结果: 2. 复制上述IP 阅读全文
posted @ 2021-04-10 15:47 拾月凄辰 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 思路 方法:层序遍历 保存层序遍历每一层的最后一个数字即可。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right 阅读全文
posted @ 2021-03-14 20:08 拾月凄辰 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 思路 LeetCode官方题解 - 接雨水 阅读全文
posted @ 2021-03-14 17:56 拾月凄辰 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 思路 方法:动态规划 思路来源: LeetCode官方题解 - 最大正方形 理解 三者取最小+1 1 class Solution { 2 public: 3 int maximalSquare(vector<vector<char>>& matrix) { 4 if (matrix.size() 阅读全文
posted @ 2021-03-13 20:25 拾月凄辰 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 思路 方法:用栈模拟 1 class Solution { 2 public: 3 string decodeString(string s) { 4 deque<char> d; 5 6 for(int i = 0; i < s.length(); ++i) { 7 if(s[i] == ']') 阅读全文
posted @ 2021-03-13 20:04 拾月凄辰 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 思路 方法:找规律 1 class Solution { 2 public: 3 string maximumBinaryString(string binary) { 4 int n = binary.length(); 5 int firstZeroIndex = -1; 6 for(int i 阅读全文
posted @ 2021-03-13 19:24 拾月凄辰 阅读(112) 评论(0) 推荐(0) 编辑
摘要: VS2017中使用scanf会出现如下错误,提示scanf不安全: 解决办法如下: 右击代码所属的项目,然后进入项目属性。 在项目属性界面,我们点击左侧的常规选项设置,进入常规设置。 然后,我们就可以在常规设置中找到sdl检查选项,默认为是。 我们点击选择该选项,改为否,然后点击右下角的确定即可。 阅读全文
posted @ 2021-03-12 11:51 拾月凄辰 阅读(2519) 评论(0) 推荐(0) 编辑
摘要: 思路 方法:暴力模拟 最直观的方法是不断地遍历数组,如果还有糖就一直分,直到没有糖为止。 1 class Solution { 2 public: 3 vector<int> distributeCandies(int candies, int num_people) { 4 vector<int> 阅读全文
posted @ 2021-03-09 18:22 拾月凄辰 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 思路 方法:哈希set 找到唯一元素数量的另一种方法是遍历给定 candies 数组的所有元素,并继续将元素放入集合中。通过集合的属性,它将只包含唯一的元素。最后,我们可以计算集合中元素的数量,例如 count。要返回的值将再次由 min(count,n/2) 给出,如前面的方法所述。其中 n 表示 阅读全文
posted @ 2021-03-09 18:11 拾月凄辰 阅读(56) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 75 下一页