自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

转载 ANDROID drawText实现文字居中

在宽width高height的画布上画一字符串,使字符串水平竖直居中:水平居中很简单,paint.setTextAlign(Align.CENTER);然后drawText的x坐标设置为width / 2即可。

2014-10-29 14:56:13 498

原创 HDOJ1010DFS

#include #include int dx[4]={1,-1,0, 0}; int dy[4]={0, 0,1,-1}; int ii=0,n,m,t,flag; int map[10][10]; char c[10][10]; int abs(int); void dfs(int,int); int main(int argc, char *argv[]) {

2013-11-10 01:09:32 418

原创 poj1703并查集

#include #define maxn 330000 int father[maxn],r[maxn];//r[x]表示该节点相对于根节点的位移量,  int find(int x) { int px; px=father[x];//记录父节点  if(father[x]==x)return father[x]; else father[x]=find(father[x]);

2013-11-10 00:55:05 424

原创 poj 1611The Suspects 并查集

最后输出的时候注意遍历每一个数,求每一个数的祖先,如果和0一样就结果加一 #include #include #define maxn 30000 int father[maxn]; int find (int x) { while(father[x]!=x) { x=father[x]; } return x; } int lianjie(int x,int y)

2013-11-03 12:46:33 496

原创 poj 2524 并查集

很水的题,注意输出格式,冒号后面有一个空格   - - #include #define maxn 50000 int father[maxn] ; int ans; int find (int x) { while(father[x]!=x) { x=father[x]; } return x; } int lianjie(int x,int y) { int r

2013-11-03 12:30:43 499

原创 vijos 1034家族 并查集

经典的并查集,最后确认两个数是不是亲戚的时候要两个数都要再找一次祖先,一样的就yes,不一样就no #include #define maxn 5000 int father[maxn] ; int find (int x) { if(x!=father[x])father[x]=find(father[x]);     return father[x]; } int lian

2013-11-03 12:28:47 562

原创 hdoj1016Prime Ring Problem

经典搜索,打表应该比函数快,因为最大才20 #include #include int sushu[] = {0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0,  1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0,  0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}; void dfs(i

2013-10-28 21:44:33 424

原创 poj2488A Knight's Journey

标准dfs,注意跳出条件 #include #include int xx[8] = {-2, -2, -1, -1, 1, 1, 2, 2}; int yy[8] = {-1, 1, -2, 2, -2, 2, -1, 1}; int map[26][26]; char movex[30]; int movey[30]={1}; int m,p,q; void dfs(int x,i

2013-10-27 22:06:39 345

原创 新博客

来人看一下啊!

2013-10-24 16:16:50 360

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除