码迷,mamicode.com
首页 >  
搜索关键字:k sum    ( 21381个结果
函数的参数
一、形参与实参 1、形参:在定义函数阶段所定义的参数称为形式参数,即形参,相当于变量名。 2、实参:在调用函数阶段所传入的参数称为实际参数,即实参,相当于变量值。 def func(a, b): # 定义函数时的参数a,b即为形参 res = a + b return res num_sum = f ...
分类:其他好文   时间:2020-03-18 15:43:28    阅读次数:38
[LeetCode] 124. Binary Tree Maximum Path Sum
二叉树的最大路径和。题意是给一个二叉树,节点是数字,请输出一个最大的路径和。例子, Example 1: Input: [1,2,3] 1 / \ 2 3 Output: 6 Example 2: Input: [-10,9,20,null,null,15,7] -10 / \ 9 20 / \ 1 ...
分类:其他好文   时间:2020-03-18 15:15:37    阅读次数:58
Flink设置并行度的几种方式
Flink设置并行度的几种方式 代码中设置setParallelism() 全局设置: env.setParallelism(3); 部分设置算子设置: sum(1).setParallelism(3) 客户端CLI设置: ./bin/flink run -p 3 修改配置文件设置/conf/fli ...
分类:其他好文   时间:2020-03-18 11:28:37    阅读次数:695
[LintCode] 1844. subarray sum equals k II
Given an array of integers and an integer k, you need to find the minimum size of continuous subarrays whose sum equals to k, and return its length. i ...
分类:其他好文   时间:2020-03-18 09:33:00    阅读次数:42
39. 组合总和
1 class Solution 2 { 3 vector<vector<int>> res; 4 int sum = 0; 5 public: 6 void helper(vector<int>& nums, int start,int target, vector<int>& out) 7 { ...
分类:其他好文   时间:2020-03-18 00:02:52    阅读次数:65
40. 组合总和 II
1 class Solution 2 { 3 vector<vector<int>> res; 4 int sum = 0; 5 public: 6 void helper(vector<int>& nums, int start,int target, vector<int>& out) 7 { ...
分类:其他好文   时间:2020-03-17 23:55:47    阅读次数:93
CF261B Maxim and Restaurant
"我的blog" 题目链接: "CF261B Maxim and Restaurant" $$preface$$ 背包DP+期望的一道题 $$description$$ 题目翻译有QwQ $$solution$$ 我们要分两种情况讨论: $$\sum_{i=1}^{n}a[i]\leq p$$ $$ ...
分类:其他好文   时间:2020-03-17 19:25:10    阅读次数:57
「总结」$pdf$课:$dp$
1. 枚举根 可以把每个点抽象成从这个点到根路径上的点全部+1,规则改为两个点可以消去。 不同子树显然不属于同一个集合。 我们可以进行操作。 对于一个点来说。 相当于给予一个$a$数组。 求最终剩下的个数和消去的次数。 那么分$sum a_{max} =a_{max}$和$sum a_{max}<a ...
分类:其他好文   时间:2020-03-17 19:14:46    阅读次数:65
leetcode 1 两数之和
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/two-sum 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用 ...
分类:其他好文   时间:2020-03-17 14:03:15    阅读次数:47
python基础(二)
1、使用while循环输入1 2 3 4 5 6 ... 8 9 10 count = 1 while count <= 10: print(count) # count = count + 1 count += 1 2、使用while循环输入1 2 3 4 5 6 8 9 10 count = 1 ...
分类:编程语言   时间:2020-03-17 10:21:57    阅读次数:96
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!