码迷,mamicode.com
首页 >  
搜索关键字:k sum    ( 21381个结果
Hdu 1709 The Balance
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1709题意: 给N个整数,每个数只能使用一次。将他们组合起来,最后看在1~sum(a[1]..a[N])这些数里有多少数是这N个数组合不出来的. 先输出这些数的个数,再将这些数输出来。如果个数是0,那.....
分类:其他好文   时间:2014-08-14 23:35:26    阅读次数:355
Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:其他好文   时间:2014-08-14 23:26:46    阅读次数:219
Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path....
分类:其他好文   时间:2014-08-14 20:50:59    阅读次数:192
欧拉公式
LRJ算法入门经典第二版上面写错了,害得我想了半天。。。 V : 点数, E :边数  F :面数 欧拉公式 V - E + F = 2; V =  n + n / 4 sum(i * (n - 2 - i));  [ 0 E = n + n / 2 sum((i * (n - 2 - i ) + 1); [ 0 代码实现: #include #include #include #...
分类:其他好文   时间:2014-08-14 20:36:59    阅读次数:280
Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:其他好文   时间:2014-08-14 20:20:09    阅读次数:206
用递归求分数的和
import java.io.IOException;import java.util.Scanner;public class Sum { public static void main(String[] args) throws IOException { try { ...
分类:其他好文   时间:2014-08-14 20:11:09    阅读次数:206
Recursive sum in parent-child hierarchy T-SQL
---树形(父子关系类)分级类统计(父子统计)--涂聚文 2014-08-14drop table BookKindListcreate table BookKindList( BookKindID INT IDENTITY(1,1) PRIMARY KEY, BookKindName ...
分类:数据库   时间:2014-08-14 19:38:19    阅读次数:273
ZOJ 1074 To the Max (DP)
Problem Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within the whole array. The sum of a rectangle...
分类:其他好文   时间:2014-08-14 01:35:57    阅读次数:228
R语言基础(二) 可视化基础
> which.max(apply(x[c("x1","x2","x3")], 1, sum))49> x$num[which.max(apply(x[c("x1","x2","x3")], 1, sum))][1] 2005138149> hist(x$x1)> plot(x$x1,x$x2)> ...
分类:其他好文   时间:2014-08-14 01:15:17    阅读次数:197
用qsort排序
?? 冒泡,快排都是常见的排序方法,这里介绍用头文件中的qsort函数排序。不过自己要先一个cmp函数。 #include//qsort的头文件 int a[100]={0,2,4,1,5,7,3,8,9}; //要排序的数组 struct Person//要排序的结构体 { char num[20]; char name[100]; int score; int sum; }man...
分类:其他好文   时间:2014-08-13 22:39:27    阅读次数:330
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!