//---------------------------15/04/09----------------------------
//Abstract Factory 抽象工厂----对象创建型模式
/*
1:意图:提供一个创建一系列相关或相互依赖对象的接口,而无需制定他们具体的类。
2:别名:Kit
3:动机...
分类:
其他好文 时间:
2015-04-09 22:03:48
阅读次数:
141
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
For example:
Given the following binary tre...
分类:
其他好文 时间:
2015-04-09 22:02:36
阅读次数:
117
#include
#include
#include
//#include
#include const long long max_size = 2000; // max length of strings
const long long N = 5;...
分类:
其他好文 时间:
2015-04-09 22:00:36
阅读次数:
120
#include
#include
#include
//#include
#include const long long max_size = 2000; // max length of strings
const long long N = 5;...
分类:
其他好文 时间:
2015-04-09 22:01:15
阅读次数:
208
将矩阵中值为0的元素所在的行和列设置为0, in-place O(1)space O(mn) time
使用O(m+n)space 的方案比较容易想到...
分类:
其他好文 时间:
2015-04-09 22:00:53
阅读次数:
128
模板题:
#include
#include
#define ll long long
const int N = 100000 + 10;
ll sum[N << 2];
ll addv[N << 2];
int num[N];
int n,q;
void pushUp(int u) {
sum[u] = sum[u * 2] + sum[u * 2 + 1];
}
void b...
分类:
其他好文 时间:
2015-04-09 22:01:54
阅读次数:
140
CentOS7修改主机名小结
CentOS7下修改主机名
第一种:hostname 主机名
这种方式,只能修改临时的主机名,当重启机器后,主机名称又变回来了。
第二种:hostnamectl set-hostname
使用这种方式修改,可以永久性的修改主机名称!...
分类:
其他好文 时间:
2015-04-09 22:03:01
阅读次数:
139
1314 - Names for Babies
PDF (English) Statistics Forum
Time Limit: 4 second(s) Memory Limit: 32 MBLong time ago, there was a strange kingdom. Peoples of different religions, different cult...
分类:
其他好文 时间:
2015-04-09 22:01:05
阅读次数:
194
看到生产上的代码片段:
try {
Thread.sleep(10);
XXXX
} catch (InterruptedException e) {
LogCore.core.error(ExceptionUtils.getStackTrace(e));
}
心生疑窦:
为什么不直接用
try {
Thread.sleep(10);...
分类:
其他好文 时间:
2015-04-09 21:59:11
阅读次数:
660
BZOJ题面是图片来的.
文字版题面
1797 货币兑换2007年NOI全国竞赛
时间限制: 1 s
空间限制: 128000 KB
题目等级 : 大师 Master题目描述 Description小 Y 最近在一家金券交易所工作。该金券交易所只发行交易两种金券:A 纪 念券(以下简称 A 券)和 B 纪念券(以下简称 B 券)。每个持有金券的顾客都有 一个自己的帐户。金券的数目可以...
分类:
其他好文 时间:
2015-04-09 22:01:40
阅读次数:
243
问题描述
我们称序列Z = 是序列X = 的子序列当且仅当存在严格上升的序列,使得对j = 1, 2, … ,k, 有xij = zj。比如Z = 是X = 的子序列。
现在给出两个序列X 和Y,你的任务是找到X 和Y 的...
分类:
其他好文 时间:
2015-04-09 22:01:07
阅读次数:
116
Github是一件利器,使用过程中总会遇见一些问题,慢慢总结中...........
分类:
其他好文 时间:
2015-04-09 22:00:46
阅读次数:
153
#include
#include
#include
//统计某个字符第一次出现的位置
char* strchr(char *p,char a)
{
int i;
assert(p!=NULL);
for(i=0;i<strlen(p);i++)
{
if(p[i]==a)
return p+i;
}
return 0;
}
//统计某个...
分类:
其他好文 时间:
2015-04-09 21:58:35
阅读次数:
133
文前:其实我的DP这么弱目测学了斜率优化也好不了因为我的DP稍微有点难度就推不出状态转移方程了>0ω<————————————————–
在做DP时候我们常常会因为自己推出的方程有太多的状态而苦恼,这些状态中有太多是对最终答案没有贡献的,而我们...
分类:
其他好文 时间:
2015-04-09 21:57:18
阅读次数:
115
UIAlertView和UIActionSheet是iOS自带的弹出式对话框。当这俩个控件出现时,用户无法与其他控件进行交互。
两个区别在于:
UIAlertView是显示在屏幕中央的,而UIActionSheet是显示在底部的按钮列表。
UIAlertView的用法非常简单:
1.创建UIAlertView,指定该对话框的标题、消息内容、以及该对话框包含的按钮信息。如果要监听按钮点击警告框...
分类:
其他好文 时间:
2015-04-09 21:58:26
阅读次数:
117
题目连接:点击打开链接
解题思路:
全源最短路
完整代码:
#include
#include
#include
#include
#include
using namespace std;
int n , m;
const int maxn = 1111;
const int INF = 1000000000;
int d[maxn][maxn];
void init...
分类:
其他好文 时间:
2015-04-09 21:57:42
阅读次数:
116