码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
LeetCode第 30 场双周赛题解
5177. 转变日期格式 思路:按照空格划分出年月日,年已经是数字形式,不需要做处理。月是英文单词的缩写,需要对应到相应的数字。 对于日,只需要把结尾的英文序数词去掉,只留下数字即可。 这里要注意月和日可能是个位数,这种情况下要在前面补一个0. class Solution { string mon ...
分类:其他好文   时间:2020-07-13 11:58:07    阅读次数:75
1512. Number of Good Pairs
Given an array of integers nums. A pair (i,j) is called good if nums[i] == nums[j] and i < j. Return the number of good pairs. Example 1: Input: nums ...
分类:其他好文   时间:2020-07-13 09:59:42    阅读次数:75
Luogu3521 [POI2011]ROT-Tree Rotations
Description link 给定一棵二叉树,每个叶子上面有权值,你可以任意交换某个点的两颗子树 使得最后形成的树的中序遍历出来的子树的逆序对最少 \(n \le 2\times10^5\) Solution 如果你真的想做这个题,请耐心手玩样例并看懂这个题神仙一样的输入方式…… 考虑逆序对怎么 ...
分类:其他好文   时间:2020-07-13 09:17:09    阅读次数:52
11.dijksta 最短路径(最大概率)
class Solution { vector<vector<pair<int,double> > >v; public: double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int s ...
分类:其他好文   时间:2020-07-12 22:32:44    阅读次数:79
双指针算法
双指针算法 LeetCode 3. 无重复字符的最长子串 while()是非法的,在外更新答案 class Solution { public int lengthOfLongestSubstring(String s) { char[] c = s.toCharArray(); int n = c ...
分类:编程语言   时间:2020-07-12 22:13:42    阅读次数:73
007-大数据-高并发网络基础1
高并发入门基础-1 Nginx网络基础 lvs:四层架构 nginx:七层架构 网络分层: 应用层7 nginx软件 HTTP协议、ssh协议 表示层6 TCP协议、UDP协议 会话层5 传输层4 lvs内核 三次握手-->>四次分数 网络层3 IP协议、ICMP协议 链路层2 物理层1 TCP/I ...
分类:其他好文   时间:2020-07-12 22:11:31    阅读次数:70
LC 1515. Best Position for a Service Centre (Simulated Annealing)
link class Solution { public: int n; double eps=1E-6; const int dx[4]={-1,0,1,0}; const int dy[4]={0,1,0,-1}; double getMinDistSum(vector<vector<int>> ...
分类:其他好文   时间:2020-07-12 19:05:29    阅读次数:75
[P6139] 【模板】广义后缀自动机 - 广义SAM
给定 $n$ 个由小写字母组成的字符串 $s_1,s_2\ldots s_n$,求本质不同的子串个数。(不包含空串) ...
分类:其他好文   时间:2020-07-12 18:26:50    阅读次数:49
力扣-48-转转图像
传送门 将n×n的矩阵旋转90度,而且不能额外开辟新的空间 可以分为两步骤:①、矩阵转置;②、对矩阵的每一列,关于纵轴对换。 算法复杂度$O(n^{2})$ #include <algorithm> using namespace std; class Solution { public: void ...
分类:其他好文   时间:2020-07-12 17:12:31    阅读次数:86
5211. 概率最大的路径(197)
class Solution { public double maxProbability(int n, int[][] edges, double[] succProb, int start, int end) { Map<Integer,List<Node>> map = new HashMap ...
分类:其他好文   时间:2020-07-12 16:50:09    阅读次数:60
共13024条   上一页 1 ... 67 68 69 70 71 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!