码迷,mamicode.com
首页 >  
搜索关键字:hduoj sum    ( 21465个结果
【CF600E】Lomset gelral 题解(树上启发式合并)
题目链接 题目大意:给出一颗含有$n$个结点的树,每个节点有一个颜色。求树中每个子树最多的颜色的编号和。 树上启发式合并(dsu on tree)。 我们先考虑暴力怎么做。遍历整颗树,暴力枚举子树然后用桶维护颜色个数。这样做是$O(n^2)$的,显然会T。我们需要一种更快的算法:树上启发式合并。 关 ...
分类:其他好文   时间:2020-07-17 22:21:39    阅读次数:58
C. Given Length and Sum of Digits... (贪心)
https://codeforces.com/problemset/problem/489/C C. Given Length and Sum of Digits... You have a positive integer m and a non-negative integer s. Your ...
分类:其他好文   时间:2020-07-17 22:18:10    阅读次数:71
python 的偏函数(Partial function)
先引出偏函数 #一个带有可变参数的sum函数 def sum(*args): s=0 for i in args: s=s+n return s #想要输出(sum(10,20)+sum(1,2,3,4,5)) print(sum(10,20)+sum(1,2,3,4,5)) 这样虽然通俗易懂,但是 ...
分类:编程语言   时间:2020-07-17 22:06:21    阅读次数:83
Jmeter压力测试
压测设置 线程数:并发数量,能跑多少量。具体说是一次存在多少用户同时访问 Rame-Up Period(in seconds):表示在多长时间内启动完上述的线程数。 循环次数:这个设置不会改变并发数,可以延长并发时间。总请求数=线程数*循环次数 调度器:设置压测的启动时间、结束时间、持续时间和启动延 ...
分类:其他好文   时间:2020-07-17 19:44:02    阅读次数:87
P5837 [USACO19DEC]Milk Pumping G (单源最短路,dijkstra)
题意:有一$n$个点,$m$条边的双向图,每条边都有花费和流量,求从$1$~$n$的路径中,求$max\frac{min(f)}{\sum c}$. 题解:对于c,一定是单源最短路,我们可以用dijkstra,但是这个最小流量不是很好搞,但是题目所给的数据范围较小,所以我们可以直接枚举最小流量,然后 ...
分类:其他好文   时间:2020-07-17 19:42:27    阅读次数:70
leetcode148two-sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n ...
分类:其他好文   时间:2020-07-17 13:33:50    阅读次数:46
面试题13:机器人的运动范围
本题考察的是回溯算法,可以使用DFS解决问题。 C++版本 #include <iostream> #include <vector> using namespace std; int getDigitSum(int num){ int sum = 0; while(num > 0){ sum += ...
分类:其他好文   时间:2020-07-17 11:28:13    阅读次数:48
7.15
7.15 dp专题 T1.sum 小Z爱求和 https://www.luogu.com.cn/problem/T138967 无脑暴力骗20... 正解 n2 个元素,挨个统计是 O( n2 ) ,所以统计每个点的贡献 复杂度降到O(n) 对于每个点,他可能贡献的区间是 L= pre(k-1) 前 ...
分类:其他好文   时间:2020-07-16 21:46:57    阅读次数:58
缺失值、重复值处理
缺失值处理 1.当缺失值的比例占数据样本的比例比较小,则可以直接删除。 2.数据补齐 查看缺失值 df = pd.read_excel(r'缺失值处理.xlsx') df 每列缺失值的总数 df.isnull().sum() 列缺失值所占的比例 #apply df.apply(lambda x: s ...
分类:其他好文   时间:2020-07-16 21:46:44    阅读次数:117
深入浅出第十一章python
import numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom scipy import statsimport mathdf=pd.read_csv("hfda_ch10_employees.csv")#print( ...
分类:编程语言   时间:2020-07-16 21:41:06    阅读次数:87
21465条   上一页 1 ... 61 62 63 64 65 ... 2147 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!