码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
HDU 2087 剪花布条 KMP题解
KMP的应用,不过查找的时候注意一点就够了:查找到一个子串的时候,直接跳过整个串,而不是使用next数组前跳,因为根据题意需要剪出小饰条,小饰条之间不能重叠。 const int MAX_N = 1001; char txt[MAX_N], pat[MAX_N]; int next[MAX_N], len; void genNext() { for (int i = 1, j = 0...
分类:其他好文   时间:2014-08-12 17:11:34    阅读次数:197
hdu 2048
#include //2084 hdu c++#includeusing namespace std;int a[105][105],b[105][105];int n;int max(int x, int y){ return x>y?x:y ; }int f(int i,int...
分类:其他好文   时间:2014-08-12 16:58:14    阅读次数:198
rwkj 1143
#include #includeusing namespace std;int a[1005][1005],b[1005][1005];int n;int max(int x, int y){ return x>y?x:y ; }int f(int i,int j){ if(b[...
分类:其他好文   时间:2014-08-12 16:52:24    阅读次数:206
Yii CModel中rules验证规则[转]
array(array(‘username’, ‘required’), array(‘username’, ‘length’, ‘min’=>3, ‘max’=>12), array(‘password’, ‘compare’, ‘compareAttribute’=>’password2′, ‘...
分类:其他好文   时间:2014-08-12 16:50:24    阅读次数:271
CF339D Xenia and Bit Operations线段树
把区间和改成,第一层|,第二层 ^。每次给出一个x,y把 第x个变成y ,输出 sum[1];#include #include #include #include #include #include #include #include #include #include #include #inc...
分类:其他好文   时间:2014-08-12 16:22:44    阅读次数:190
uva 10791 Minimum Sum LCM ( 唯一分解定理 )
使用唯一分解定理的时候不一定要打出素数表,这句话是相对上一篇来讲的。做这道题目之前我对唯一分解定理方法的理解不完全。 现在多想到了一些 唯一分解,将当前需要分解的n用因子将其分解表达。需要试因子。 因子的枚举应该是从2开始(从1开始没有意义),当当前数字n可以整除当前因子i时,就使其不断除以i,直到不能整除。 这个步骤实际上已经在根本上避免了出现像4、6这种因子在唯一分解式中的出现——之前...
分类:其他好文   时间:2014-08-12 13:49:44    阅读次数:222
hdu 1087
//本题用DP算法: 从一组数据中找一组递增数列且和为最大,假如我们从最后面往前找,每次都要找出前面比本身的小的数 ,//并加上f[j],就是此时f[j]最大的值//用f[ ]记下相应的位置的最大和,f[ i ]=max(num[ i ] ,f[ i ]+num[ j ] ),其中0num[ j ]...
分类:其他好文   时间:2014-08-12 13:19:24    阅读次数:210
POJ 1379
模拟退火算法。随机MAX个点,然后,退火移动,选取距离所有点中最短中最长者即可。理解和我上一篇一样。#include #include #include #include #include #include using namespace std;const int MAXN=1010;const ...
分类:其他好文   时间:2014-08-12 13:17:44    阅读次数:198
Django 六大框架之 Models
先睹为快fromdjango.dbimportmodelsclassPerson(models.Model):first_name=models.CharField(max_length=30) last_name=models.CharField(max_length=30) 核心要点 ...
分类:其他好文   时间:2014-08-12 13:00:24    阅读次数:171
对象处理方法, 首先内存中要要有对象原形 才可以返回对象
struct op( name = "ccc")coc = #( cc = op name: 20 , op name: "name" )--- 保存数组配置o = gt_max_namespace.gt_cl_hp_fileiooutin(); o. setfile "c://t.txt" ...
分类:其他好文   时间:2014-08-12 12:55:34    阅读次数:146
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!