码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
124. 二叉树中的最大路径和(Binary Tree Maximum Path Sum)
题目描述: 给定一个非空二叉树,返回其最大路径和。 本题中,路径被定义为一条从树中任意节点出发,达到任意节点的序列。该路径至少包含一个节点,且不一定经过根节点。 示例 1: 输入: [1,2,3] 1 / \ 2 3 输出: 6示例 2: 输入: [-10,9,20,null,null,15,7] ...
分类:其他好文   时间:2020-07-09 19:10:05    阅读次数:51
使用BERT词向量
启动远程服务 pip install --ignore-installed --upgrade tensorflow==1.10 pip install bert-serving-server pip install bert-serving-client #下载模型 mkdir model cd ...
分类:其他好文   时间:2020-07-09 15:21:36    阅读次数:138
89. 格雷编码
知识点:格雷编码的生成过程, G(i) = i ^ (i/2); 如 n = 3: G(0) = 000, G(1) = 1 ^ 0 = 001 ^ 000 = 001 G(2) = 2 ^ 1 = 010 ^ 001 = 011 G(3) = 3 ^ 1 = 011 ^ 001 = 010 G(4 ...
分类:其他好文   时间:2020-07-09 10:41:17    阅读次数:68
leetcode-----66. 加一
链接:https://leetcode-cn.com/problems/plus-one/ 代码 class Solution { public: vector<int> plusOne(vector<int>& digits) { int t = 1; for (int i = digits.si ...
分类:其他好文   时间:2020-07-08 21:27:49    阅读次数:43
8.图的邻点不同颜色
class Solution { public: vector<int> gardenNoAdj(int N, vector<vector<int>>& paths) { vector<int> G[N]; for (int i=0; i<paths.size(); i++){//建立邻接表 G[p ...
分类:其他好文   时间:2020-07-08 19:35:09    阅读次数:62
ubuntu16.04 安装 hustoj
一、安装 hustoj 手动执行以下shell命令: #!/bin/bash apt-get update sudo apt-get upgrade apt-get install -y mysql-server mysql-client apt-get install -y php7.0 apt- ...
分类:系统相关   时间:2020-07-08 13:39:39    阅读次数:93
300. 最长上升子序列(动态规划,二分查找)
方法一: 动态规划 (O(n)) class Solution { public int lengthOfLIS(int[] nums) { int n = nums.length; if(n < 2) return n; int[] dp = new int[n+1]; // dp[i] : 以第 ...
分类:其他好文   时间:2020-07-08 13:12:25    阅读次数:53
面试题 16.11. 跳水板(leetcode)-7月8日
题目 面试题 16.11. 跳水板(leetcode) 我的思路 数学方法,一共k+1种情况:使用shorter0次到k次。一个循环把i*shorter+(k-i)*longer,0<=i<=k算一遍即可。 我的实现 class Solution { public: vector<int> divi ...
分类:其他好文   时间:2020-07-08 10:24:19    阅读次数:64
LeetCode面试题 16.11. 跳水板
暴力枚举即可,注意特判k为0的情况。 class Solution { public: vector<int> divingBoard(int shorter, int longer, int k) { if(k == 0) { return {}; } vector<int> res; set<i ...
分类:其他好文   时间:2020-07-08 01:02:55    阅读次数:53
763. 划分字母区间
方法一:滑动窗口 class Solution { public List<Integer> partitionLabels(String s) { List<Integer> res = new ArrayList<>(); int[] arr = new int[128]; for(char c ...
分类:其他好文   时间:2020-07-07 18:10:25    阅读次数:53
共13024条   上一页 1 ... 70 71 72 73 74 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!