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
1 oracle常用经典SQL查询 2 常用SQL查询: 3 4 1、查看表空间的名称及大小 5 6 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size 7 from dba_ta...
分类:
数据库 时间:
2014-07-20 22:21:32
阅读次数:
373
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
next_permutation
-----------------------------------------------------------------------
描述: 取得 [first, last) 所标示之序列的下一个排列组合。如果没有,返回 false,有,返回true
思路:
从后往前
1.找两个相邻元素,令左端的元素为*i,右端的元素为*ii,且满足 *i < *ii
2.找出第一个大于 *i 的元素,令其为 *j,将*i,*j元素对调
3.将ii右端的所有元素颠倒
源码:
t...
分类:
其他好文 时间:
2014-07-19 23:29:37
阅读次数:
383
链接: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
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