A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the sub...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:22:40   
                                阅读次数:
198
                             
                    
                        
                            
                            
                                using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Reflection;
namespace LL...
                            
                            
                                分类:
数据库   时间:
2014-08-23 11:22:30   
                                阅读次数:
269
                             
                    
                        
                            
                            
                                题目地址:POJ 1201   HDU 1384
根据题目意思,可以列出不等式如下:
Sj-Si>=c;
Si-S(i-1)>=0;
S(i-1)-Si>=-1;
然后用最短路spfa来解决这个不等式。用max来当源点,0为终点。最终的-d[0]就是答案。
代码如下:
#include 
#include 
#include 
#include 
#include 
#include...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:22:20   
                                阅读次数:
191
                             
                    
                        
                            
                            
                                性能测试
由于本人身处第三级城市。无法接触到比较牛逼的公司或者环境,以下正是网站环境摸了度娘好几遍,搭建完成,测试下已寻求提升空间。也希望自己能配置出能满足公司需要的网站运行环境,不能因为我这边的瓶颈而阻碍了公司进行,希望各位大能能不吝惜指点下谢谢。
1.阿里云云服务器ecs配置如下4核8G内存 10M带宽
2.php运行环境
Tengine-2.0.3  +php-fpm*4
一个...
                            
                            
                                分类:
Web程序   时间:
2014-08-23 11:22:11   
                                阅读次数:
253
                             
                    
                        
                            
                            
                                JAXP-DOM解析xml(CURD)...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:21:59   
                                阅读次数:
163
                             
                    
                        
                            
                            
                                ??
题意  给你n种长方体  每种都有无穷个  当一个长方体的长和宽都小于另一个时  这个长方体可以放在另一个上面  要求输出这样累积起来的最大高度
因为每个长方体都有3种放法  比较不好控制   可以把一个长宽高分成三个长方体  高度是固定的  这样就比较好控制了
#include  
#include  
#include  
using namespace std;  
...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:21:40   
                                阅读次数:
191
                             
                    
                        
                            
                            
                                js实现小写转大写,js实现数字转人民币,js实现数字转货币...
                            
                            
                                分类:
Web程序   时间:
2014-08-23 11:21:31   
                                阅读次数:
266
                             
                    
                        
                            
                            
                                题意   给你n个小石头  和一个数组a[m]   然后两个人轮流取石头  stan先取  olive后取  他们都完美发挥    谁取完最后一个石头谁就是赢家    感觉不是很容易看出来是dp题  令d[i]表示只有i个石子时谁赢   1表示stan赢  0表示olive赢   
i-a[j]表示从i个石子一次取走a[j]个还剩下的    所以有  当(i-a[j]>0&&d[i-a[j]]=...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:21:21   
                                阅读次数:
253
                             
                    
                        
                            
                            
                                WCFwindows  communication fundation...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:21:10   
                                阅读次数:
141
                             
                    
                        
                            
                            
                                ??
在用cookie保存用户名的时候,发现cookie值不能存中文,报如下错:
 Control character in cookie value, consider BASE64 encoding your value
错误发生在:response.addCookie(cookie);
在以前的编程中也碰到过这样的问题,主要是cookie值里面存在非法参数,如存在”\r\n”、”\n...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:21:00   
                                阅读次数:
183
                             
                    
                        
                            
                            
                                第一次写这样的题目,反正出现了各种坑爹问题,调了老半天,除了延迟标记外,这题还要开一个cnt数组用来存储各个区间内颜色的种类数,
每次改变颜色时,更新一次。
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#includ...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:20:40   
                                阅读次数:
179
                             
                    
                        
                            
                            
                                被第二个条件给坑了
You are giving candies to these children subjected to the following requirements:
Each child must have at least one candy.Children with a higher rating get more candies than their ne...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:20:30   
                                阅读次数:
173
                             
                    
                        
                            
                            
                                1、模型与视图完全分离,我们可以修改视图而不影响模型
2、可以更高效地使用模型,因为所有的交互都发生在一个地方——Presenter内部
3、我们可以将一个Presenter用于多个视图,而不需要改变Presenter的逻辑。这个特性非常的有用,因为视图的变化总是比模型的变化频繁。
4、如果我们把逻辑放在Presenter中,那么我们就可以脱离用户接口来测试这些逻辑(单元测试)...
                            
                            
                                分类:
移动开发   时间:
2014-08-23 11:20:20   
                                阅读次数:
327
                             
                    
                        
                            
                            
                                1.什么是OGNL
:OGNL是Object Graphic Navigation Language(对象图导航语言)的缩写,
它是一个开源项目。 Struts2框架使用OGNL作为默认的表达式语言。
功能比EL强的N倍.
OGNL仅仅只是一种表达式语言而已,使用它必须结合Struts2的标签.
  讲解OGNL比先了解ValueStack(值栈),Struts2核心....
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:20:10   
                                阅读次数:
210
                             
                    
                        
                            
                            
                                一 JDBC链接
通常你希望SessionFactory来为你创建和缓存(pool)JDBC连接. 如果你采用这种方式, 只需要如下例所示那样,打开一个Session: 
Session session = sessions.openSession(); // open a new Session
一旦你需要进行数据访问时, 就会从连接池(connection pool)获得一个JD...
                            
                            
                                分类:
系统相关   时间:
2014-08-23 11:20:01   
                                阅读次数:
266
                             
                    
                        
                            
                            
                                上代码:
public class MainActivity extends Activity {
	ImageView imgView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout....
                            
                            
                                分类:
移动开发   时间:
2014-08-23 11:19:50   
                                阅读次数:
240
                             
                    
                        
                            
                            
                                禁止搜索引擎收录的方法(robots.txt)一、什么是robots.txt文件?搜索引擎通过一种程序robot(又称spider),自己主动訪问互联网上的网页并获取网页信息。您能够在您的站点中创建一个纯文本文件robots.txt,在这个文件里声明该站点中不想被robot訪问的部分,这样,该站点的...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:19:10   
                                阅读次数:
338