上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: 题目链接: https://leetcode-cn.com/problems/li-wu-de-zui-da-jie-zhi-lcof/ 动态规划 状态表示: f[i][j]表示从左上角走到[i,j]处拿到的礼物的最大价值; 状态计算: f[i][j] = max(f[i - 1][j], f[i] 阅读全文
posted @ 2020-06-08 16:53 NaughtyCoder 阅读(206) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/que-shi-de-shu-zi-lcof/ 二分 时间复杂度:O(logn) 空间复杂度:O(1) class Solution { public: int missingNumber(vector<int>& nums 阅读全文
posted @ 2020-06-06 10:33 NaughtyCoder 阅读(114) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/zai-pai-xu-shu-zu-zhong-cha-zhao-shu-zi-lcof/ 二分 时间复杂度:O(logn) 空间复杂度:O(1) class Solution { public: int search(ve 阅读全文
posted @ 2020-06-06 10:30 NaughtyCoder 阅读(124) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/gu-piao-de-zui-da-li-run-lcof/ 朴素版 状态表示:相当于枚举在哪天卖, f[i]表示以prices[i]结尾的子数组的最大利润; 状态计算:f[i]的最大利润等于min(f[i - 1], pr 阅读全文
posted @ 2020-06-02 16:34 NaughtyCoder 阅读(145) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/nge-tou-zi-de-dian-shu-lcof/ 朴素版 状态表示:f[i][j]表示投掷wani枚骰子,j点数的出现次数; 状态计算:f[i][j] = f[i - 1][j - 1 ] + f[i - 1][j 阅读全文
posted @ 2020-06-02 09:43 NaughtyCoder 阅读(122) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/ba-zi-fu-chuan-zhuan-huan-cheng-zheng-shu-lcof/ 应该先去除字符串首部的空格,然后再判断正负。 难点在于处理溢出。 INT_MAX 2147483647 INT_MIN -214 阅读全文
posted @ 2020-05-31 10:14 NaughtyCoder 阅读(109) 评论(0) 推荐(0)
摘要: ping 测试网络连通性 ifconfig 显示当前系统中所有网络设备,基于ICMP协议开发的。 netstat 参数 -a (all)显示所有选项,netstat 默认不显示 LISTEN 相关。 -t (tcp)仅显示 tcp 相关选项 -u (udp)仅显示 udp 相关选项 -n 不显示别名 阅读全文
posted @ 2020-05-29 22:14 NaughtyCoder 阅读(819) 评论(0) 推荐(0)
摘要: bind 客户端可以调用bind函数吗?可以,可以指定端口 详见复习资料 客户端为何不调用bind函数,什么时候像套接字分配IP和端口号 listen 它现在定义的是已完成连接队列的最大长度,表示的是已建立的连接(established connection),正在等待被接收(accept 调用返回 阅读全文
posted @ 2020-05-28 18:50 NaughtyCoder 阅读(222) 评论(0) 推荐(0)
摘要: 题目链接:https://www.acwing.com/problem/content/description/86/ 双指针 快慢指针,快指针一次走两步,慢指针一次走一步,如果快指针无法继续前进,没有环; 否则,当快指针与慢指针第一次相遇以后,令快指针等于头结点,快慢指针各自每次走一步,再次相遇的 阅读全文
posted @ 2020-05-08 20:33 NaughtyCoder 阅读(88) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode cn.com/problems/jian sheng zi ii lcof/ 贪心 阅读全文
posted @ 2020-05-08 19:54 NaughtyCoder 阅读(69) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页