HDU 1003 Max Sum (动规)
HDU 1231 的简化版。。。...
分类:
其他好文 时间:
2014-07-22 09:16:34
阅读次数:
157
#pragma warning(disable:4996)
#include <cstdio>
#include <tchar.h>
#include <Windows.h>
#include <vector>
using namespace std;
/*
submit time : 4
1.Runtime Error
Last executed input: [1], 2...
分类:
其他好文 时间:
2014-07-22 09:03:04
阅读次数:
285
Problem Description
An equal sum partition of a sequence of numbers is a grouping of the numbers (in the same order as the original sequence) in such a way that each group has the same sum. For examp...
分类:
其他好文 时间:
2014-07-20 15:42:42
阅读次数:
256
这是实际场景当中的一个例子,拿出来分析总结思路。-- SQL 查询 --SELECT orderQuery.Rk_SkuCode , orderQuery.SkuName, SUM(ISNULL(orderQuery.OrderTotal, 0)) - SUM(ISNULL(removeQuery....
分类:
数据库 时间:
2014-07-20 09:16:02
阅读次数:
649
链接:http://vjudge.net/problem/viewProblem.action?id=49406
题意:根据给出的n,k,s求出n个数每个数都不大于k,和为s的序列(n个数每个都不同)的总情况数。
思路:
1.二进制枚举枚举出所有可能排列,并求和若和为s,则符合,否则不符合。
代码:
#include
#include
#include
#include
#include...
分类:
其他好文 时间:
2014-07-19 18:35:20
阅读次数:
203
class Solution {public: int maxSubArray(int A[], int n) { int cur_sum = 0; int max_sum = INT_MIN; for (int i=0; i max_...
分类:
其他好文 时间:
2014-07-19 15:18:15
阅读次数:
160
Description 给出3*n个数xi,要求构造三个长度为n的序列ai,bi,ci,使得满足下列条件: 1到3*n的每个数都在三个序列中的某个出现一次且仅一次; S=sum((x[ai]-x[bi])*x[ci])最大。 输出最大的S。多组数据。Input Format 第一行...
分类:
其他好文 时间:
2014-07-19 14:39:18
阅读次数:
214
GCD SUMTime Limit:8000/4000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatusProblem Description给出N,M执行如下程序:long long ans = 0,ansx ...
分类:
其他好文 时间:
2014-07-19 09:15:30
阅读次数:
234
Problem Description
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5...
分类:
其他好文 时间:
2014-07-19 08:25:40
阅读次数:
224
/*
ID: lucien23
PROG: sort3
LANG: C++
*/
#include
#include
#include
#include
using namespace std;
void exchange(int nums[], int begin, int end, int N, int x);
int sum = 0;
int main()
{
ifstream ...
分类:
其他好文 时间:
2014-07-19 02:12:25
阅读次数:
176