题目:
链接:点击打开链接
题意:
有n个硬币,知道其价值A1。。。。。An。数量C1。。。Cn。问在1到m价值之间,最多能组成多少种价值。
思路:
dp[i]表示i价值能够组成的最大种数。
代码:
#include
#include
#include
using namespace std;
int n,m;
int a[110],c[110];
int ...
分类:
其他好文 时间:
2014-05-22 13:26:38
阅读次数:
205
#include//??????????С???? ? С????
#include
using namespace std;
int lfh(int n)
{
return (n*(n+1)/2)*(n*(n+1)/2);
}
unsigned int js(int n)
{
unsigned int ms=0;
unsigned int sum=0;
uns...
分类:
其他好文 时间:
2014-05-22 12:08:06
阅读次数:
245
目录最大连续序列和不连续序列的最大和1.最大连续序列和是指所有连续子序列元素和最大的那个。#include#includeusing
namespace std;int main(){ freopen("in.txt","r",stdin); int n;
while(cin>>n) { int a...
分类:
其他好文 时间:
2014-05-22 11:49:54
阅读次数:
273
求区间 [l,r] 满足 素数 = a^2+b^2 a b为任意整数打素数表,如何证明 此时的素数满足
%4==1 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace
std; 7 const int .....
分类:
其他好文 时间:
2014-05-22 05:31:29
阅读次数:
200
题意:有十种珠宝用数字表示,现在给你每个珠宝的数量,问可不可以平均分给两个人。解题思路:DFS搜索可以写。将完全背包问题转换为搜索问题。具体代码:#include#include#includeusing
namespace std;int num[15],sum;bool dfs(int n,in...
分类:
其他好文 时间:
2014-05-22 03:26:34
阅读次数:
206
#include#includeusing namespace std;class
Text{public: Text():a(1){}private: int a; void display(){ cout<< "hello
world"<<endl;} friend vo...
分类:
编程语言 时间:
2014-05-22 01:04:05
阅读次数:
276
class word{public: word(){cout#includeusing
namespace std;class Text{public: static const int a = 1; ///static 数据成员独立与该类存在
///static int b = ...
分类:
编程语言 时间:
2014-05-22 00:51:09
阅读次数:
346
先看一段代码实验:#include#includeusing namespace
std;int main(){ unsigned int i = numeric_limits::max(); float f = i; unsigned
int j = (unsigned int ...
分类:
其他好文 时间:
2014-05-22 00:48:31
阅读次数:
286
#include #include #include using namespace std;int
main(){ int n; while(cin >> n) { stack one; string od1,od2; bool stat...
分类:
其他好文 时间:
2014-05-21 23:48:58
阅读次数:
370
题目:
链接:点击打开链接
题意:
判断是否能够平分弹珠。
算法:
多重背包。
思路:
模板。。。dp[i]中i表示花费。。
代码:
#include
#include
#include
using namespace std;
int n[7];
int dp[120010];
int V;
void bag_01(int c,int w)/...
分类:
其他好文 时间:
2014-05-20 16:03:26
阅读次数:
256