#include
using namespace std;
class CPerson
{
protected:
string m_szName;
string m_szId;
int m_nSex;//0:women,1:man
int m_nAge;
public:
CPerson(string name,string id,int...
分类:
其他好文 时间:
2014-05-07 03:04:18
阅读次数:
239
枚举+二分查找。
A+B+C >= K ----> C >= K - A -B ----> 统计大于等于C的个数即可。
#include
#include
#include
#include
#include
#include
using namespace std;
int a[1010];
int Scan() //输入外挂
{
int...
分类:
其他好文 时间:
2014-05-07 02:52:11
阅读次数:
322
有个徒弟问我,要创建一个索引,去优化一个SQL,但是创建了索引之后其他 SQL 也要用 这个索引,其他SQL慢死了,要优化的SQL又快。遇到这种问题咋搞?
一般遇到这种问题还是很少的。处理的方法很多。我简单的给大家介绍一种方法。
还是直接看我实验操作步骤吧。
在SCOTT账户里面创建一个测试表和一个索引
SQL> create table test as select * from ...
分类:
数据库 时间:
2014-05-07 02:35:18
阅读次数:
496
递归版
struct Edge
{
int from, to, cap, flow;
Edge(){}
Edge(int from, int to, int cap, int flow) : from(from), to(to), cap(cap), flow(flow){}
};
int n, m, s, t;
vector edges;
vector G[maxn];
bool v...
分类:
其他好文 时间:
2014-05-06 23:39:25
阅读次数:
351
Sys.Application.add_load(function() {
var form = Sys.WebForms.PageRequestManager.getInstance()._form;
form._initialAction = form.action = window.location.href;
});
if (!documen...
分类:
Web程序 时间:
2014-05-06 23:36:38
阅读次数:
408
#include
using namespace std;
class Stu //声明基类
{
public:
Stu(int n, string nam ); //基类构造函数
void display( ); //成员函数,输出基类数据成员
protected: //(*)访问权限为保护型的数据成员
int nu...
分类:
其他好文 时间:
2014-05-06 23:20:29
阅读次数:
296
Maximum Weight Difference
Chef has gone shopping with his 5-year old son. They have bought N items so far. The items are numbered from 1 to N, and the item i weighs Wi grams.
Chef's son insist...
分类:
其他好文 时间:
2014-05-06 22:59:49
阅读次数:
451
题目连接:uva 11578 - Situp Benches
题目大意:健身房有两个仪器,初始角度为10度,每次有人使用需要交15元,每调10度需要花费10元,现在有n个人,给出每个人使用仪器的顺序和角度,保证不会同时有大于2个人序号一样,求最小花费,并且输出每个人分别使用哪一个仪器,并且所有人使用结束后,要将仪器调回10度。
解题思路:dp[i][x][y]表示第i个人,一个...
分类:
其他好文 时间:
2014-05-06 22:54:40
阅读次数:
361
常用市电过零扫描电路及其对应扫描程序,使用普通io口,扫描时间一般为几百微妙内...
分类:
其他好文 时间:
2014-05-06 22:42:14
阅读次数:
268
题意:给出1-10个长度为60的字符串,求出最长的公共子串(长度不能小于3),如果有多个一样长的,输出字典序最短的。
解法:想到kmp时,自己第一反应枚举第一个串的所有子串,在其他所有串中走一遍kmp,复杂度为10*60*60*60,但是发现只需枚举第一个串后缀就可以,每次枚举记录在所有串能走最远中走的最短的那个长度。这样复杂度就成了10*60*60,0ms AC。
代码:/*****...
分类:
其他好文 时间:
2014-05-06 22:41:38
阅读次数:
320