上一页 1 2 3 4 5 6 7 8 9 10 ··· 35 下一页

2019年3月12日

Leetcode_638.Shopping Offers

摘要: https://leetcode.com/problems/shopping-offers/ In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are som 阅读全文

posted @ 2019-03-12 14:59 JASONlee3 阅读(127) 评论(0) 推荐(0) 编辑

2019年3月6日

window_c++_socket编程_winsock2.h

摘要: 1.初始化动态链接库 WSAStartup: The WSAStartup function initiates use of the Winsock DLL by a process. WSAStartup函数使用一个进程来初始化Winsock动态链接库ws2_32.dll。 初始化成功返回0,否 阅读全文

posted @ 2019-03-06 11:14 JASONlee3 阅读(3788) 评论(0) 推荐(0) 编辑

2018年12月8日

leetcode_238. Product of Array Except Self_思维

摘要: https://leetcode.com/problems/product-of-array-except-self/ 给一个vector<int> nums,输出一个vector<int> res,res[i]为nums中除去nums[i]以外所有数的乘积。且不能使用除法运算,时间复杂度为O(n) 阅读全文

posted @ 2018-12-08 19:52 JASONlee3 阅读(103) 评论(0) 推荐(0) 编辑

2018年12月6日

leetcode_951. Flip Equivalent Binary Trees_二叉树遍历

摘要: https://leetcode.com/problems/flip-equivalent-binary-trees/ 判断两棵二叉树是否等价:若两棵二叉树可以通过任意次的交换任意节点的左右子树变为相同,则称两棵二叉树等价。 思路:遍历二叉树,判断所有的子树是否等价。 For a binary tr 阅读全文

posted @ 2018-12-06 18:50 JASONlee3 阅读(334) 评论(0) 推荐(0) 编辑

2018年12月5日

leetcode_378. Kth Smallest Element in a Sorted Matrix_堆的应用

摘要: Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th 阅读全文

posted @ 2018-12-05 15:49 JASONlee3 阅读(143) 评论(0) 推荐(0) 编辑

2018年11月10日

codeforces_1075_C. The Tower is Going Home

摘要: http://codeforces.com/contest/1075/problem/C 题意:一个长宽均为1e9的棋盘,n个垂直障碍在x列无限长,m个水平障碍在第y行从第x1列到x2列。可以水平和垂直走。问从(1,1)走到(1e9,*)最少需要消除多少个障碍。 思路:只有遇到从1开始的水平障碍和一 阅读全文

posted @ 2018-11-10 17:16 JASONlee3 阅读(240) 评论(0) 推荐(0) 编辑

2018年11月7日

leetcode_Stone Game_dp_思维

摘要: Alex和Lee玩游戏,共有偶数堆石头,石头总数为奇数,两人每次要么拿第一堆,要么拿最后一堆,两人以最优策略拿石堆(一次拿走完整的一堆),Alex先手,Alex赢返回True,否则返回False。 思路:一共偶数堆石头,当石堆总数为偶数时,Alex拿;当石堆总数为奇数时,Lee拿。每次拿石堆,要么拿 阅读全文

posted @ 2018-11-07 10:32 JASONlee3 阅读(154) 评论(0) 推荐(0) 编辑

2018年11月6日

leetcode_Counting Bits_dp

摘要: 给定num,用O(num)的时间复杂度计算0--num中所有数的二进制表示中1的个数。 i&(i-1)<=i-1 阅读全文

posted @ 2018-11-06 21:32 JASONlee3 阅读(104) 评论(0) 推荐(0) 编辑

2018年10月28日

Divide and Conquer_1.最大连续子数组

摘要: 给定一个数组,求它的一个子数组,使其求和最大。 这个问题的应用:给定一只股票很多天的价格,计算从哪天买进哪天卖出能获得最大利润。 给定 prices:100 113 98 87 65 78 120 110 115 计算delta delta: 13 -15 -11 -22 13 42 -10 5 求 阅读全文

posted @ 2018-10-28 14:07 JASONlee3 阅读(294) 评论(0) 推荐(0) 编辑

2018年10月24日

python_MachineLearning_感知机PLA

摘要: 感知机(perceptron)是二类分类的线性模型,其输入为实例的特征向量,输出为实例的类别,取+1和-1二值。感知机对应于输入空间(特征空间)中将实例划分为正负两类的分离超平面,属于判别模型。感知机学习旨在求出将训练数据进行线性划分的分离超平面,为此,导入基于误差分类的损失函数,利用梯度下降法对损 阅读全文

posted @ 2018-10-24 15:33 JASONlee3 阅读(190) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 35 下一页

导航