题目来源:HDU 1542 Atlantis
题意:给你一些矩形(左下角和右上角)求面积
思路:参考here这个超赞的 一看就懂了
#include
#include
#include
#include
using namespace std;
const int maxn = 210;
struct node
{
double l, r, h;
int s, val;
nod...
分类:
其他好文 时间:
2014-05-07 08:59:09
阅读次数:
395
题目大意:
添加和删除一个数,然后输出中位数。
简单的Splay 维护Splay上有多少个节点就可以了
#include
#include
#define inf 1LL<<60
#define maxn 222222
#define keyTree (ch[ch[root][1]][0])
using namespace std;
typedef long...
分类:
其他好文 时间:
2014-05-07 07:46:42
阅读次数:
405
#include
using namespace std;
class Base
{
public:
Base(){base = 1; cout
virtual ~Base(){cout
virtual void say(){cout
private:
int base;
static int count;
};...
分类:
编程语言 时间:
2014-05-07 06:59:24
阅读次数:
302
递归建树,由题知该树是一棵二叉树,且除根节点外其他点的度为0或2。
dp[i][j]表示来到第i个走廊(还未走过这条走廊)还剩下j时间,能拿到最大的画的数量。
dp[i][j]=max(dp[i][j],dp[lson[i]][k]+dp[rson][last_time-k])
#include
#include
using namespace std;
int dp[200][70...
分类:
其他好文 时间:
2014-05-07 05:02:45
阅读次数:
295
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722
思路:数位dp,dp[i][j]表示到第i位,数字和%10为j,然后进行dp,注意完全匹配的情况是要+1,而其他情况是从0 到 9 都要考虑
代码:
#include
#include
#include
#include
using namespace std;
int t;
l...
分类:
其他好文 时间:
2014-05-07 04:55:37
阅读次数:
314
以前的模板和题目
白书例题,基本模板,多个串连接时的处理,二分加分组的处理。
注意n和m的值
n为字符个数
m为最大字符值+1
分组时,分出来的区间是[ ),左闭右开
idx[],的有效只是1-t-1,为t表示自己添加的字符
#include
#include
#include
#include
using namespace std;
const int maxn = ...
分类:
其他好文 时间:
2014-05-07 04:50:29
阅读次数:
250
形态:
实现:/*****************************************
稀疏矩阵的三元组顺序表存储表示
by Rowandjj
2014/5/3
******************************************/
#include
using namespace std;
#define MAXSIZE 12500//非零元个数的最大值
...
分类:
其他好文 时间:
2014-05-07 04:42:40
阅读次数:
387
上次发布一淘HD应用,头一天发布,第二天就上线,私下还在想,是不是苹果采用什么优化的解决方案了,导致审核速度加快了。这两天发布新版,一直碰到Invaild Binary问题,才想明白,原来大家都被这个问题绊住了,导致上传的应用少,所以审核速度变快了。一开始碰到Invaild Binary,网上搜索了下,看到一些资料说Icon问题,可能会导致Invaild Binary,碰巧这次发布修改了Icon问...
分类:
移动开发 时间:
2014-05-07 04:21:15
阅读次数:
508
#include
using namespace std;
//汉罗塔递归求解函数 从a移到c
void move(int m,char a,char c);
void hanoi(int n,char a,char b,char c)
{
if(1==n)
{
move(n,a,c);
return;
}
hanoi(n-1,a,c,b);
move(n,a,c);
hano...
分类:
其他好文 时间:
2014-05-07 03:24:14
阅读次数:
228
人控制方向:
#include
using namespace std;
#define n 8
int * createMaze(){
int i,j;
int * a;
a=new int[n*n];
for(i=0;i<n;i++){
for(j=0;j<n;j++){
*(a+n*i+j)=0;
}
}
*(a+n*0+1)=3;
*(a+n*1+1)=1;...
分类:
其他好文 时间:
2014-05-07 03:10:02
阅读次数:
319