码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
算法与数据结构--图的实现、基本操作及应用
#include #include #include using namespace std; #define INFINITY DBL_MAX //无穷大 #define MAX_VERTEX_NUM 20 //最大顶点个数 enum GraphKind //图的类型 { DG,DN,UDG,UDN//有向图、有向网、无向图、无向网 }; //弧结构 typedef struct...
分类:其他好文   时间:2014-06-07 01:52:18    阅读次数:214
hdu 1102 Constructing Roads
题目:         链接:点击打开链接 题意:         求需要修建的公路的最短长度。 算法: 思路:         prim最小生成树 代码: #include #include #include using namespace std; #define MAX 100000000 #define MAXN 110 int map[MAXN][MAXN]; int ...
分类:其他好文   时间:2014-06-07 01:49:07    阅读次数:213
projecteuler---->problem=6----Sum square difference
title: The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 Hence ...
分类:其他好文   时间:2014-06-05 12:03:29    阅读次数:243
针对上课内容的想法
int Largest(int list[], int length){ int i,max; for(i = 0; i max) { max=list[i]; } } return max;}首先进行...
分类:其他好文   时间:2014-06-03 09:53:50    阅读次数:267
求一堆数组中最大的子数组
成员:周其范20112794 胡宝月20112827上课的时候老师布置了这个题目,初一看这个题目,我们讨论的时候就是在想,应该从第一个数开始,一个一个加,一直加到最后一个数,然后从第二个数开始,一个一个加,加到最后一个,以此类推,在比较的过程中,我们需要比较每加一次的数大小,把每比一次的数赋给sum...
分类:其他好文   时间:2014-06-03 09:53:07    阅读次数:243
linux shell设置颜色
使用echo或者printf时,可以添加输出文本的颜色设置echo -e "Maximum \e[1;31m" $max_threads "\e[0mthreads allowed!" >> $term_dir/summary或者printf("\033[;34mfile\033[0m")31开始代...
分类:系统相关   时间:2014-06-03 09:11:52    阅读次数:306
[leetcode]Max Points on a Line @ Python
原题地址:https://oj.leetcode.com/problems/max-points-on-a-line/题意:Givennpoints on a 2D plane, find the maximum number of points that lie on the same strai...
分类:编程语言   时间:2014-06-03 08:55:48    阅读次数:282
【HDOJ】1394 Minimum Inversion Number
逆序数的性质。1. 暴力解 1 #include 2 3 #define MAXNUM 5005 4 5 int a[MAXNUM]; 6 7 int main() { 8 int n; 9 int i, j, sum, min;10 11 while (scanf(...
分类:其他好文   时间:2014-05-31 07:50:50    阅读次数:170
Aizu 1335 Equal Sum Sets
DescriptionLet us consider sets of positive integers less than or equal ton. Note that all elements of a set are different. Also note that the order o...
分类:其他好文   时间:2014-05-31 05:12:49    阅读次数:246
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-05-30 14:59:37    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!