Points cakes
描述
A mother has n different sizes of cake,she wants to give to
you can help she solve this problem?
输入
there are many case of testdata,for each testdata,
first line: an integer n(3<=n<=1000), means how many cakes does the mother has.
second line: n integers, for each a[i](1<=a[i]<=50), a[i] means the size of ith cake.
输出
for each teatdata, output two integers x, y(x<=y)
x, y means how many cakes do the two children have.
样例输入
3
1 2 3
样例输出
3 3
题意: 分配蛋糕, 有n块不同大小的蛋糕, 要求分配给两个人, 如果不可以实现分配均匀(重量相同分配).
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
#define MAX 1005
int n;
int a[MAX];
int maxt, sum;
int sum_half;
void DP(int w,int reLen)
{
}
int main()
{
//
}