码迷,mamicode.com
首页 >  
搜索关键字:np    ( 2362个结果
hdu 5183 Negative and Positive (NP)(STL-集合【HASH】)
题意:When given an array(a0,a1,a2,?an?1)and an integerK, you are expected to judge whether there is a pair(i,j)(0≤i≤j st;ll ans,K;int n;int T;ll a[10000...
分类:其他好文   时间:2015-03-11 21:20:46    阅读次数:143
背包问题
这个是我在网上找到的背包九讲,写的非常好:背包问题(Knapsack problem)是一种组合优化的NP完全问题。问题可以描述为:给定一组物品,每种物品都有自己的重量和价格,在限定的总重量内,我们如何选择,才能使得物品的总价格最高。问题的名称来源于如何选择最合适的物品放置于给定背包中。相似问题经常...
分类:其他好文   时间:2015-03-11 21:18:14    阅读次数:200
hdu 5183. Negative and Positive (哈希表)
Negative and Positive (NP)Time Limit: 3000/1500 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2177Accepted Submission(...
分类:其他好文   时间:2015-03-11 21:13:52    阅读次数:121
(二)Angularjs - 小实例
AngularJS处理数据表格使用 np-repeat 指令 ... {{ subject.name }} {{ subject.marks }} ...数据对象 1 $scope.student = { 2 fi...
分类:Web程序   时间:2015-03-10 16:45:14    阅读次数:228
数学之路-python数据处理(2)
插入列# -*- coding: utf-8 -*-"""Created on Mon Mar 09 11:21:02 2015@author: myhaspl@myhaspl.com"""print u"python数据分析\n"import pandas as pdimport numpy as np#构造商品销量数据mydf = pd.DataFrame({u'商品地区编码':[1,1,3,...
分类:编程语言   时间:2015-03-10 12:13:45    阅读次数:266
numpy的random模块
【说明】翻译自官网的文档。随机抽样(numpy.random)简单的随机数据 rand(d0,d1,...,dn)随机值>>> np.random.rand(3,2)array([[ 0.14022471, 0.96360618], #random [ 0.37601032, ...
分类:其他好文   时间:2015-03-10 06:46:22    阅读次数:79159
hdu 5183-Negative and Positive (NP)
题目:大概意思就是给定一个序列a[0],a[1]....a[n-1]和一个整数k,问是否有这样的两个下标是的NP-Sum(i,j)=k,这里NP-Sum(i,j)=a[i]-a[i+1]+a[i+2]-...+(-1)^(j-1)*a[j]。 思路:我们可以维护这个序列的后缀和(前缀也是可以的),然后枚举sum[i]查看在set表中是否存在sum[j]=sum[i]-k。 这里要分成i...
分类:其他好文   时间:2015-03-09 22:33:42    阅读次数:195
数学之路-python数据处理(1)
Pandas基础import pandas aspdimport numpy as np#数字序列myseries=pd.Series([1,3,5,np.nan,6,8])print myseries#日期序列mydate=pd.date_range('20150101',periods=42)print mydate生成序列结果如下:0    11    32    53  NaN4    6...
分类:编程语言   时间:2015-03-09 12:52:54    阅读次数:228
hdu5183---Negative and Positive (NP)(HASHMAP)
Problem Description When given an array (a0,a1,a2,?an?1) and an integer K, you are expected to judge whether there is a pair (i,j)(0≤i≤j/***************************************************************...
分类:其他好文   时间:2015-03-08 23:08:00    阅读次数:454
HDU 5183 Negative and Positive (NP) --Hashmap
题意:问有没有数对(i,j)(0x)是否出现,所以要逆序枚举。代码:#include #include #include #include #include #include #define Mod 1000000007#define lll __int64#define ll long longu...
分类:其他好文   时间:2015-03-08 16:58:57    阅读次数:152
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!