题目链接: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
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
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
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
---树形(父子关系类)分级类统计(父子统计)--涂聚文 2014-08-14drop table BookKindListcreate table BookKindList( BookKindID INT IDENTITY(1,1) PRIMARY KEY, BookKindName ...
分类:
数据库 时间:
2014-08-14 19:38:19
阅读次数:
273
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
> 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函数排序。不过自己要先一个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