自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(27)
  • 问答 (1)
  • 收藏
  • 关注

原创 Uva11324 The Largest Clique tarjan+dp

The Largest CliqueTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem B: The Largest Cl

2014-04-15 19:20:49 647

原创 zoj3772 Calculate the Function 矩阵除法模板

终于将可逆矩阵的除法模板给

2014-04-08 12:54:57 703

原创 python学习笔记(2)

1.type() 函数返回数据类型2.isinstance(a,b) 返回a,b是否是同一个类型3.python整型相当于Biginter,可以无限长度。4.强制转换:a='520'b=int(a)c=float(a)d=str(b)ps:(1)如果字符串不是由数字组成的,那么不可以强制转换为数字类型。      (2)在python中5.0==5,即floa

2014-02-04 12:29:30 646

原创 Python 学习笔记(1)

0.python中赋值可以这样:1234567>>> x,y,z=3,4,'wer'>>> x3>>> y4>>> z'wer'PS:假设有 x = 1,y = 2,z = 3,请问如何快速将三个

2013-12-19 20:42:57 1076

原创 ZOJ3696-A Simple Tree Problem 线段树

A Simple Tree ProblemTime Limit: 3 Seconds      Memory Limit: 65536 KBGiven a rooted tree, each node has a boolean (0 or 1) labeled on it. Initially, all the labels are 0.We define this ki

2013-10-28 19:52:23 652

原创 2013 ACM/ICPC Asia Regional Chengdu Online HDU 4731 Minimum palindrome(规律)

Minimum palindromeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 93    Accepted Submission(s): 36Problem DescriptionSetting pas

2013-09-14 19:41:11 548

原创 HDU 4587 TWONODES (tarjan) (2013ACM-ICPC南京赛区全国邀请赛)

TWO NODESTime Limit: 24000/12000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 379    Accepted Submission(s): 142Problem DescriptionSuppose that G i

2013-09-09 09:18:26 1587

原创 HDU 4599 Dice (概率dp)

DiceTime Limit:1000MS     Memory Limit:65535KB     64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4599DescriptionGiven a normal dice (with 1, 2, 3, 4, 5, 6 on each face)

2013-09-07 18:48:02 895

原创 poj 3468 A Simple Problem with Integers (Splay树)

A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 48548 Accepted: 14366Case Time Limit: 2000MSDescriptionYou have N

2013-09-06 21:57:20 702

原创 RMQ中的ST算法模板

最近也算是比较系统的整理了一下ST算法。大概把算法的意思写在了下面这张图里然后是贴模板了。/* * 下标从1开始的数组val[1~n]。最大询问区间1~n * initRMQ(n) O(nlogn) * call: getval(a,b) O(1) */int val[M];int Max[20][M]; //max[i][j] 从j开始的,连续2^i个数字的最大值

2013-08-22 15:43:59 775

原创 hdu3487 Play with Chain(Splay)

Play with ChainTime Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2761    Accepted Submission(s): 1136Problem DescriptionYaoYao is

2013-08-20 21:18:48 726

原创 养猪(dp水题)

养猪Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 71 Accepted: 16Description你有一个猪圈,有N头猪,每天你最多可以杀一头猪卖钱,收益就是猪的体重。但是每过一天猪的体重都会下降P[i](当然,如果猪的体重≤0了,利润自然就是0),

2013-08-19 18:25:15 2610

转载 计算几何的模板(大神整理)

计算几何模板目录:1.计算几何 21.1 注意 21.2几何公式 21.3 多边形 41.4多边形切割 71.5 浮点函数 81.6 面积 141.7球面 151.8三角形 181.9三维几何 211.10 凸包 29水平序 29极角序 30卷包裹法 311.11 网格 331.12 圆 341.13 矢量运算求几何模板

2013-08-15 21:26:40 14623 5

原创 HDU 4658 2013 多校联合赛第6场 Integer Partition

Integer PartitionTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 201    Accepted Submission(s): 97Problem DescriptionGiven n, k,

2013-08-10 14:48:04 694

原创 HDU 4655 2013多校联合赛第6场 Cut Pieces

Cut PiecesTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 717    Accepted Submission(s): 297Problem DescriptionSuppose we have a sequence o

2013-08-10 14:20:43 600

原创 POJ 2689 Prime Distance 二次筛选

Prime Distance   Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8409 Accepted: 2273DescriptionThe branch of mathematics called number theory is

2013-08-08 18:50:06 630

原创 HDU 4082 Hou Yi's secret 暴力枚举

Hou Yi's secretTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1898    Accepted Submission(s): 456Problem DescriptionLong long a

2013-08-07 21:55:06 749

原创 HDU 4651 2013多校联合第5场 Partition 数论

PartitionTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 422    Accepted Submission(s): 242Problem DescriptionHow many ways can

2013-08-07 19:59:59 1052

原创 UVA 10891 Game of Sum dp(记忆化搜索)

Problem EGame of SumInput File: e.inOutput: Standard Output This is a two player game. Initially there are n integer numbers in an array and players A and B get chance to take them alterna

2013-08-07 10:08:19 634

原创 UVALive 3635 Pie 二分查找

Problem C - PieTime limit: 1 second My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my f

2013-08-07 09:59:00 662

原创 UVA 11624 Fire bfs水题

Problem B: Fire!Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze.Given J

2013-08-07 09:32:51 741

原创 HDU 4632 2013多校联合第4场 A - Palindrome subsequence

Palindrome subsequenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65535 K (Java/Others)Total Submission(s): 1330    Accepted Submission(s): 547Problem DescriptionIn

2013-08-06 22:19:06 530

原创 HDU 4638 2013多校联合第4场 G-Group

原文地址:http://acm.hdu.edu.cn/showproblem.php?pid=4638GroupTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 747    Accepted Submission(s

2013-08-06 20:33:13 581

原创 2013 杭电多校联合赛 第四场D题 4635 Strongly connected

Problem DescriptionGive a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is still a simple directed graph. Also, after yo

2013-08-03 13:23:19 782

原创 动态规划---求最长公共字符序列

求字符串a,b的最长公共字符序列。输入#退出。#include#includeint main(){ int i,j,c[500][500],lena,lenb;char a[500],b[500]; while(scanf("%s",a)!=EOF&&*a-'#') { scanf("%s",b); lena=strlen(a),lenb=strlen(b);//

2012-12-06 11:02:32 403

原创 动态规划

#includeint max(int x,int y){ if(x>y)return x; else return y;}int mian(){ int f[100][100],dp[100][100],i,n,j,k; scanf("%d",&n); for(i=0;i<n;i++) { for(j=0;j<=i;j++) scanf("%d",&f[i][j]);

2012-12-05 13:35:49 321

转载 (acm协会课程笔记)归并算法

下面是我从网上转载的算法详述。。自己的想法就写在代码中吧……  归并排序是利用递归和分而治之的技术将数据序列划分成为越来越小的半子表,再对半子表排序,最后再用递归步骤将排好序的半子表合并成为越来越大的有序序列,归并排序包括两个步骤,分别为:      1)划分子表      2)合并半子表      首先我们来讨论归并算法,归并算法将一系列数据放到一个向量中,索引范

2012-12-02 21:19:07 680

空空如也

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

TA关注的人

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