#include
#include
using namespace std;
int a[1000];
int dp[1000];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
int maxx=0;
for(int i=1;i<=n;...
分类:
其他 时间:
2015-07-12 12:49:51
收藏:
0 评论:
0 赞:
0 阅读:
233
今天在配置OpenStack的Glance时,前边进行的都很顺利,当作到这一步时sudo glance-manage db_sync时出现了如下错误
根据错误提示,想到可能是配置问题,于是就查找了配置文档,发现需要在/etc/glance/glance-registry.conf和/etc/glance/glance-api.conf中加入下面一句话
sql_connection = mys...
分类:
Web开发 时间:
2015-07-12 12:49:41
收藏:
0 评论:
0 赞:
0 阅读:
874
Two Wrongs Can Make a Right (and Are Difficult to Fix)Allan KellyCODE NEVER LIES, BUT IT CAN CONTRADICT ITSELF. Some contradictions lead to those “How can that possibly work?” moments.
In an interview...
分类:
其他 时间:
2015-07-12 12:49:31
收藏:
0 评论:
0 赞:
0 阅读:
281
Ubuntu Coding for Your FriendsAslam KhanSO OFTEN, WE WRITE CODE IN ISOLATION and that code reflects our per- sonal interpretation of a problem, as well as a very personalized solution. We may be part o...
分类:
系统服务 时间:
2015-07-12 12:49:21
收藏:
0 评论:
0 赞:
0 阅读:
207
The Unix Tools Are Your FriendsDiomidis SpinellisIF, ON MY WAY TO EXILE ON A DESERT ISLAND, I had to choose between an IDE and the Unix toolchest, I’d pick the Unix tools without a second thought. Here...
分类:
其他 时间:
2015-07-12 12:49:11
收藏:
0 评论:
0 赞:
0 阅读:
197
Senior's Array
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 514 Accepted Submission(s): 199
Problem Description
One day, Xuej...
分类:
其他 时间:
2015-07-12 12:49:01
收藏:
0 评论:
0 赞:
0 阅读:
141
定义L为X与Y的最长公共子序列的长度(子序列在字符串内不一定连续,一个长度为L的字符串有2L个子序列,包括空子序列)。
现在学姐姐取出了X的所有长度为L的子序列,并要求学弟回答在这些子序列中,有多少个是Y的子序列。...
分类:
其他 时间:
2015-07-12 12:48:51
收藏:
0 评论:
0 赞:
0 阅读:
266
题目大意
求有向图中经过某一点k的最大环(数据规模不支持floyd)。
题解
以k为起点在正向图中spfa求单源最短路,再在反向图中spfa求单源最短路。枚举除k外的每一个点i,如果有一个同时包含i与k的环,ans=max{ans,dist[i]+invdist[i]}ans=\max\{ans,dist[i]+invdist[i]\}。
Code
#include
#incl...
分类:
其他 时间:
2015-07-12 12:48:41
收藏:
0 评论:
0 赞:
0 阅读:
260
17)...
分类:
其他 时间:
2015-07-12 12:48:31
收藏:
0 评论:
0 赞:
0 阅读:
363
[导读] 系统 uname -a 查看内核 操作系统 CPU信息 head -n 1 etc issue 查看操作系统版本 cat proc cpuinfo 查看CPU信息 hostname 查看计算机名 lspci -tv 列出所有PCI设备 lsusb -tv
系统
# uname -a #查看内核/操作系统/CPU信息
# head -n 1 /etc/issu...
分类:
系统服务 时间:
2015-07-12 12:48:21
收藏:
0 评论:
0 赞:
0 阅读:
253
抽象工厂属于创建型设计模式
设计意图:提供一个接口,可以创建一系列相关或相互依赖的对象,而无须指定它们具体的类。
光看设计意图有些抽象,不好理解,让我们来看一下实例类图,结合类图我们再做具体的解释,相信会让大家豁然开朗的。我们以生产汽车为例,我们生产的汽车分两个系列,小车、卡车,每个系列汽车都有发动机和油箱。
上图:
IAbstrcatFactory:抽象工厂接口,声明创建抽象产品的方...
分类:
其他 时间:
2015-07-12 12:48:12
收藏:
0 评论:
0 赞:
0 阅读:
265
$json2 = json_decode($json, true);
//echo "json2:";
//var_dump($json2);
json_encode string json_encode ( mixed $value [, int $options = 0 ] )返回 value 值的 JSON 形式
json_decode
mixed json_decode (...
分类:
Web开发 时间:
2015-07-12 12:48:11
收藏:
0 评论:
0 赞:
0 阅读:
516
原文:http://www.raywenderlich.com/99473/introducing-react-native-building-apps-javascript 注意:所有图片放在了百度相册空间,如果你看不到图片,请复制图片URL,然后粘贴到地址栏中进行查看。接着,在styles中增加如下样式: flowRight: { flexDirection: 'row', a...
分类:
其他 时间:
2015-07-12 12:47:01
收藏:
0 评论:
0 赞:
0 阅读:
296
#include
using namespace std;
//产生任意范围的随机数。
int Grial(int i,int j )
{
int x = 0;
while (!(x>=i && x<j))
{
x = rand() % j;
}
return x;
}
int main()
{
cout <<...
分类:
编程语言 时间:
2015-07-12 12:46:51
收藏:
0 评论:
0 赞:
0 阅读:
272
【题目链接】click here~~
【题目大意】n组团体去包车,每组团体的人数《=4,一辆车最多容纳4人,求所求车的数目最小
【解题思路】:思路见代码~~
// C
#ifndef _GLIBCXX_NO_ASSERT
#include
#endif
#include
#include
#include
#include
#include
#include
#include...
分类:
其他 时间:
2015-07-12 12:46:41
收藏:
0 评论:
0 赞:
0 阅读:
252
这里接着上篇stl非变易算法(一)进行总结。主要解析算法函数count、count_if、mismatch、equal、search、search_n以及find_end,给出算法函数的实现及测试用例。下面直接进入正题。统计等于某值的容器元素个数countcount函数用于计算容器中某个给定值的出现次数。计算迭代区间[first,last)上等于val值的元素个数ret,返回计数。//count算法...
分类:
编程语言 时间:
2015-07-12 12:45:31
收藏:
0 评论:
0 赞:
0 阅读:
195
Senior's Array
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 528 Accepted Submission(s): 209
Problem Description
One day, Xuejieji...
分类:
其他 时间:
2015-07-12 12:45:21
收藏:
0 评论:
0 赞:
0 阅读:
401
#include
#include
#include
#define N 10
#define L 10
//打印随机雷的位置,测试代码方便看雷
void sl_print(const
int a[L])
{
int i=0;
printf("地雷的随机位置为:");
for(i=0;i
{
printf("%02d ...
分类:
编程语言 时间:
2015-07-12 12:45:11
收藏:
0 评论:
0 赞:
0 阅读:
521
最近帮同学做一个项目,开发板是EFM8单片机,支持SPI和I2C协议(SMBus)。很久没搞过单片机了,而且条件限制,为了使单片机和外设成功通信,花了一个星期时间。刚开始使用SPI,发现代码逻辑都没问题,就是结果不对(后来知道是因为带中断的程序单步调试导致的,说多了都是泪),调了几天发现SPI确实调不通,就换了I2C,半天时间搞定,哈哈。本文重点解释I2C,废话少说了。
1、简介
I2C(In...
分类:
其他 时间:
2015-07-12 12:45:01
收藏:
0 评论:
0 赞:
0 阅读:
856
字符串反转
#include "stdafx.h"
#include
using namespace std;
char*reverse_str(char*str);
int _tmain(int argc, _TCHAR* argv[])
{
char*str = "abcdefgh";
char*dst = reverse_str(str);
cout << dst << ...
分类:
其他 时间:
2015-07-12 12:44:51
收藏:
0 评论:
0 赞:
0 阅读:
236