自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(115)
  • 资源 (6)
  • 收藏
  • 关注

转载 关于typedef的用法总结

转载自:http://www.cnblogs.com/csyisong/archive/2009/01/09/1372363.html

2014-04-22 09:41:49 429

转载 python random模块

原文:http://blog.csdn.net/xiaocaiju/article/details/6973175Python中的random模块用于生成随机数。下面介绍一下random模块中最常用的几个函数。random.randomrandom.random()用于生成一个0到1的随机符点数: 0 random.uniform  random.uniform

2014-03-19 00:41:04 618

原创 python--sort,sorted,argsort

1、sort 只是list类型的内建函数,对其他非列表型序列不适用。>>> a = [5,2,1,9,6]>>> a.sort() #默认从小到大>>> a[1, 2, 5, 6, 9] >>> a.sort(reverse=True) #reverse后从大到小>>> a[9, 6, 5, 2, 1]

2014-03-18 22:54:20 1077

原创 python_numpy

python 下numpy包下载地址:http://sourceforge.net/projects/numpy/files/NumPy/不同平台:可以选择win32或者linux(以.tar.gz为后缀),linux下也可以在terminal下:sudo apt-get isntall python-numpy下载简单介绍:NumPy数组是一个存放多维数组对象的容器,称为ndarra

2014-03-14 19:28:29 809

原创 Linux命令ln、cp、硬链接和软链接

1.Linux链接概念Linux链接分两种,一种被称为硬链接(Hard Link),另一种被称为符号链接(Symbolic Link)。【硬连接】硬连接指通过索引节点来进行连接。在Linux的文件系统中,保存在磁盘分区中的文件不管是什么类型都给它分配一个编号,称为索引节点号(Inode Index)。在Linux中,多个文件名指向同一索引节点是存在的。一般这种连接就是硬连接。硬连接

2014-03-11 22:08:50 15458 1

转载 atexit函数和exit函数的理解

原文:http://blog.chinaunix.net/uid-20937170-id-3447901.html工作找完了,老板逼着写各种乱七八糟的本子,偷着写点自己的理解,就当是对自己兴趣爱好的补偿吧。   按照ISO C的规定,一个进程可以登记多达32个函数,这些函数将由exit自动调用,通常这32个函数被称为终止处理程序,并调用atexit函数来登记这些函数。

2014-03-07 15:33:00 715

转载 vim配置及插件安装管理(超级详细)

原文:http://blog.csdn.net/namecyf/article/details/77874791写在前面 Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用的IDE是何等的重要啊, 估计很多人就是卡在这个门槛上了

2014-03-05 12:13:40 653

转载 UNIX环境高级编程-环境配置

UNIX环境高级编程-环境配置、http://blog.csdn.net/segen_jaa/article/details/8093471背景说明:学习《UNIX环境高级编程》,里面的示例程序用到了作者写的模块。把第一个示例代码敲入,结果当头一棒。咦,怎么编不过去。网上找资料发现好人不少,问题终于解决。特此,把我的解

2014-03-05 10:47:55 477

原创 题目105:单词替换

http://ac.jobdu.com/problem.php?cid=1040&pid=1041、str1.find(str2,pos);   若循环查找,pos+str2.size(),查找完,跳过当前这个位置再查找2、str1.replace(pos1,num,str2); 替换位置,替换个数,目标字符串3、出现TE,因为循环查找处问题#include #include #i

2013-03-18 19:44:40 645

原创 题目1466:排列与二进制

http://ac.jobdu.com/problem.php?pid=1466思路:例:(10,5) 10*9*8*7*6=30240,其二进制,末尾5个0,正好等于,10,9,8,7,6的二进制末尾                    0的个数的和。10的二进制,1010,1个0;8,1000,3个0...优化:1、j%2==0  可以变为:( j&1 )==0

2013-03-17 20:59:14 762

原创 题目1496:数列区间

http://ac.jobdu.com/problem.php?pid=1496超时原因:                正常模拟,极端情况下,第k+1次操作对第k次操作的数字实现了全覆盖,则第k次操作对于最终结果全无意义改善:逆向操作,先进行第k次操作,则第k-1次操作时,为0的数字(后续操作没有再覆盖操作)才进行修改           某大牛使用了next数组,每次修改数字后

2013-03-17 16:07:51 885

原创 题目1493:公约数

http://ac.jobdu.com/problem.php?pid=1493思路:       1、求最大公约数,gcd       2、最大公约数,因式分解,(循环除小于bound的素数)       3、k1个因子1,k2个因子2,k3个因子3...       4、ans=(k1+1)(k2+1)(k3+1)....#include #include #inc

2013-03-17 14:57:37 607

转载 1004. Counting Leaves

师兄的代码,学习了孙佰贵的专栏 1004. Counting Leaves (30)  1、组合类型,queue2、bfs遍历3、邻接表4、注意事项:                        ①、先判断层,是否到了下一层。因为可能会到了下一层刚好是叶子,num++,再判断层,保存num,出错                        ②、退出w

2013-03-15 21:19:48 669

原创 1053. Path of Equal Weight

http://pat.zju.edu.cn/contests/pat-a-practise/1053链表的操作,dfs遍历#include #include #include #include #include using namespace std;struct Node { int weight; vector next; //节点的孩子向量,保存nod

2013-03-15 19:44:13 669

原创 hdu_1062:Text Reverse

http://acm.hdu.edu.cn/showproblem.php?pid=1062#include #includeint main(){ int n,i,j,flag; char str[1000]; while (scanf("%d",&n)!=EOF) { getchar(); while (n--) { gets(str); fla

2013-03-12 11:28:25 518

原创 hdu_1020:Encoding

http://acm.hdu.edu.cn/showproblem.php?pid=1020#include #includechar str[10005]; //输入的字符串int a[26]; //标记26个字母的个数 int main() { int n,i,flag;

2013-03-12 10:35:46 530

原创 hdu_1201:18岁生日

http://acm.hdu.edu.cn/showproblem.php?pid=1201#include int isyear(int x){ if ( (x%400==0)||(x%100!=0&&x%4==0) ) { return 1; } else return 0;}int dayofmonth[13][2]={ 0,0, 31,

2013-03-12 09:48:55 556

原创 1051.Pop Sequence

http://pat.zju.edu.cn/contests/pat-a-practise/1051#include #include #include using namespace std;stack ans;int a[1005],b[1005];int main(){ int m,n,k,i; while (scanf("%d%d%d",&m,&n,&k)!=EO

2013-03-11 10:51:55 519

原创 zju2010:ZOJ问题

http://ac.jobdu.com/problem.php?pid=10062010年浙江大学计算机及软件工程研究生机试真题#include char str[1005];int main(){ int a,b,c,z,j,i; //a:z前面o的个数,b:zj间o的个数,c:j后面o的个数 while (scanf("%s",s

2013-03-11 09:47:36 445

原创 九度题目1099:后缀子串排序

http://ac.jobdu.com/problem.php?pid=10992010年上海交通大学计算机研究生机试真题1、每轮测试都要清空容器2、substr的使用#include #include #include #include using namespace std;vector ans;int main(){ string s,tmp;

2013-03-10 17:52:51 512

原创 九度题目1097:取中值

http://ac.jobdu.com/problem.php?pid=10971、不用真的拿出来,合并,再找中间下标的值2、注意下标计算,相对起始坐标。而并不一定是相对1开始的#include int a[1000005];int b[1000005];int main(){freopen("D:\\1.txt","r",stdin); int t,n,m,i,j;

2013-03-10 17:10:40 631

原创 zju2011 Median

http://ac.jobdu.com/problem.php?pid=1004#include int a[1100005],b[1100005];int main(){ int n,m,i,j,num,mid,ans; while (scanf("%d",&n)!=EOF) { for (i=0;i<n;i++) { scanf("%d",&a[i]);

2013-03-10 16:06:13 445

原创 九度题目36:二叉搜索树(判断是否是相同二叉搜索树)

http://ac.jobdu.com/problem.php?cid=1040&pid=352010浙江大学计算机机试试题1、两个二叉树相同:插入建树,先序遍历+中序遍历=一个字符串                              比较两次得到的字符串,若相同才是相同二叉搜索树 2、两次遍历时,通过指针操作相应字符串,指针每次重定向到相应字符串的首地址

2013-03-09 21:45:34 588

原创 1042. Shuffling Machine

http://pat.zju.edu.cn/contests/pat-a-practise/1042#include int card[55]; //有序牌int order[55]; //特定顺序int tmp[55]; //暂存中间变换结果 ch

2013-03-09 20:29:43 559

原创 题目96:拦截导弹

http://ac.jobdu.com/problem.php?cid=1040&pid=95最长递增子序列:                  f(1)=1;                  f(i) = max { 1 , f(j)+1 | aj 最长递增不减序列:                  f(1)=1;                  f(i) =

2013-03-09 16:26:10 547

原创 题目94:不容易系列之一

http://ac.jobdu.com/problem.php?cid=1040&pid=93错排公式:f(n) = (n-1) * f(n-1) + (n-1) * f(n-2)  #include long long a[21];int main(){ a[1]=0; a[2]=1; int i,n; for (i=3;i<=20;i++) /

2013-03-09 15:31:06 426

原创 题目93:N阶楼梯上楼问题

http://ac.jobdu.com/problem.php?cid=1040&pid=92基础动态规划题思考最后一步,要么上一阶,要么上两阶,所以f(n)=f(n-1)+f(n-2)#include long long a[90];int main(){ int n,i; while (scanf("%d",&n)!=EOF) { a[1]=1;

2013-03-09 15:19:03 651

原创 题目1167:数组排序

http://ac.jobdu.com/problem.php?pid=11672009年北京航空航天大学计算机研究生机试真题#include #include #include using namespace std;struct E { int no; int data; int order;}buf[10005];bool cmp1(E A,E B){

2013-03-09 12:58:59 646

原创 题目1165:字符串匹配

http://ac.jobdu.com/problem.php?pid=11652008年北京航空航天大学计算机研究生机试真题#include #include #include #include using namespace std;string a[1005],A[1005]; //a保存输入的字符串,A保存转换为大写后的字符串string tmp,pre

2013-03-09 10:41:39 728

原创 题目1174:查找第K小数

http://ac.jobdu.com/problem.php?pid=11742010年北京邮电大学网院研究生机试真题#include #include #include using namespace std;int a[1005];int main(){ int n,i,k; while (scanf("%d",&n)!=EOF) { for (i=0;i<

2013-03-08 23:14:53 500

原创 九度题目1175:打牌

http://ac.jobdu.com/problem.php?pid=11752010年北京邮电大学网院研究生机试真题#include #include char a[105],b[105];int count[10]; //统计a中出现牌的个数,1几张,2几张int main(){//freopen("D:\\1.txt","r",stdin); i

2013-03-08 23:07:56 704

原创 hdu1575:Tr A_矩阵的幂&二分求幂

http://acm.hdu.edu.cn/showproblem.php?pid=1575二维矩阵做参数,写在结构体里,优化;#include #include struct Matrix { int m[12][12];}a,b,c;int n,m,i,j,k;Matrix deal(Matrix a,Matrix b) //基本的矩阵乘法

2013-03-08 22:13:29 551

原创 题目1203:IP地址

http://ac.jobdu.com/problem.php?pid=12032006年华中科技大学计算机保研机试真题全部判断完毕再输出#include #include int main(){ freopen("D:\\1.txt","r",stdin); int x,n,i; char ch; while (scanf("%d",&n)!=EOF) { wh

2013-03-08 16:59:45 640

原创 题目1199:找位置

http://ac.jobdu.com/problem.php?pid=11992005年华中科技大学计算机保研机试真题1、注意一些细节,逗号的处理;换行的处理;第一次检测到与之后检测到相同字符的不同处理2、#include #include int main(){ //freopen("D:\\1.txt","r",stdin); int i,j; char s

2013-03-08 16:39:52 627

原创 九度题目1182:统计单词

http://ac.jobdu.com/problem.php?pid=11822002年华中科技大学计算机研究生机试真题将输入一行字符串转为单个输入单词,每次输出个数,若最后一个字符是.则结束本行输入熟悉双重while循环的输入方式#include #include char str[1000];int main(){freopen("D:\\1.txt","r",

2013-03-08 15:40:09 509

原创 九度题目1184:二叉树遍历

http://ac.jobdu.com/problem.php?pid=11842002年华中科技大学计算机研究生机试真题ABC##DE#G##F###先序建树:a ,左孩子b。                  b,左孩子c,                  c,左孩子空,右孩子空,退回b                  b,右孩子d

2013-03-08 15:22:58 941

原创 九度&题目1180:对称矩阵

http://ac.jobdu.com/problem.php?pid=11802000年华中科技大学计算机研究生机试真题#include #include #include #include using namespace std;int a[105][105];int main(){freopen("D:\\1.txt","r",stdin); int n

2013-03-08 14:39:41 633

原创 九度题目1179:阶乘

http://ac.jobdu.com/problem.php?pid=11792000年华中科技大学计算机研究生机试真题不涉及大数,所以简单阶乘就好,结果保存在long long 型数据#include #include #include #include using namespace std;long long JIEC(long long x){ if

2013-03-08 14:30:44 539

原创 九度&1195:最长&最短文本

http://ac.jobdu.com/problem.php?pid=1195#include #include #include #include using namespace std;struct E { char a[1005]; int len;}buf[1000];int main(){// freopen("D:\\1.txt","r

2013-03-08 14:19:05 813

原创 zju2011保研:Twin Prime Conjecture

http://acm.hdu.edu.cn/showproblem.php?pid=3792浙大计算机研究生保研复试上机考试-2011年1、素数筛法2、一次得到所有n以下的孪生素数数目保存在数组里,否则,每次输入n,在判断会超时#include #include int prime[100000];bool mark[100000];int p[100000];in

2013-03-06 13:35:11 593

数据挖掘概念与技术 韩家炜

现在最清晰的一个版本,对于数据挖掘介绍很详细,可以说是入门经典书籍,不多说了,这方面研究生都是人手一本

2013-10-12

高质量编程

如果你想成为一名优秀的程序员,一定要遵循严谨、统一的编程风格,例如命名、代码缩进、错误处理。本书对你绝对非常大的帮助

2013-04-05

电路分析习题解答 高等教育出版社

郑州大学电路分析,高等教育出版社出版的教材,本书是习题解答

2010-12-09

《UNIX操作系统设计》

《UNIX操作系统设计》,机械工业出版社,陈宝玉作品,是学习unix的经典入门翻译作品 pdf 格式

2010-07-26

空空如也

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

TA关注的人

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