摘要: XiaoA is a lovely boy who likes designing some digital product.One day, he met XiaoB who is XiaoA's little girl friend and told her that his new product had came out.It's a calculator which can do "add"(+) opeartion and "sub"(-) operation between nonnegative numbers.Actually, XiaoA's calculator is v 阅读全文
posted @ 2011-01-01 13:14 role 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Description As we all know, Hongshu was awarded the title “The Outstanding Student of UESTC”(成电杰出学生). Surprisingly, he found that another outstanding student shares the same birthday with him. However, after carefully thinking, he realised that it is not a “small probability event”. Now, he wants to 阅读全文
posted @ 2011-01-01 10:15 role 阅读(166) 评论(0) 推荐(0) 编辑
摘要: I'm HungryDescription The canteen in UESTC is a crazy place. Every day, thousands of people are rushing to the canteen after class. But there is a long line before the each window always, which makes people disappoint and angry. Today, LY will meet a very important person, so he wants to finish the 阅读全文
posted @ 2011-01-01 09:40 role 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 垂心是三角形三条高的交点内心是三角形三条内角平分线的交点即内接圆的圆心 重心是三角形三条中线的交点外心是三角形三条边的垂直平分线的交点 即外接圆的圆心 旁心,是三角形两条外角平分线和一条内角平分线的交点正三角形中,中心和重心,垂心,内心,外心重合! 垂心定理:三角形的三条高交于一点。该点叫做三角形的垂心 内心定理:三角形的三内角平分线交于一点。该点叫做三角形的内心。 旁心定理:三角形一内角平分线和另外两顶点处的外角平分线交于一点。该点叫做三角形的旁心。三角形有三个旁心。 重心定理:三角形的三条中线交于一点,这点到顶点的 离是它到对边中点距离的2倍。该点叫做三角形的重心。 外心定理:三角形的三边 阅读全文
posted @ 2010-12-31 18:27 role 阅读(3282) 评论(0) 推荐(0) 编辑
摘要: 寻找质因子 1:质因子除了2都是偶数,可以先求出2的因子个数,然后再奇数范围内找满足整除的.(不知道为啥,效率有时不高) 2:从两边判断: 如果在=m/2或是=sqrt(m)范围内没有找到能整除的则i是素因子。如果im/2则m也是素数,m/=i; 代码如下: scanf("%d",&n); while(1) { for(i=2;i=sqrt(n);i++) if(n%i==0) {is_p[i]++;break;}//is_p存素因子i,的个数 if(isqrt(n)) {is_p[n]++;break;} n/=i; } 应用:题目如下: Description 对于任意一个整数n 阅读全文
posted @ 2010-12-31 18:26 role 阅读(4922) 评论(0) 推荐(0) 编辑
摘要: 捆绑法:当要求某几个元素必须相邻(挨着)时,先将这几个元素看做一个整体,(比如:原来3个元素,整体考虑之后看成1个元素)然后将这个整体和其它元素进行考虑。这时要注意:一般整体内部各元素如果在前后顺序上有区别的还需进行一定的顺序考虑。插空法:当要求某几个元素必须不相邻(挨着)时,可先将其它元素排好,然后再将要求不相邻的元素根据题目要求插入到已排好的元素的空隙或两端位置。插隔板法:指在解决若干相同元素分组,要求每组至少一个元素时,采用将比分组数目少1的隔板插入到元素中的一种解题策略。题目特点:“若干相同元素分组”、“ 每组至少一个元素”。例1(08-57)一张节目表上原有3个节目,如果保持这3个节 阅读全文
posted @ 2010-12-29 13:14 role 阅读(5076) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2085注意数据存储2010-10-29 18:00:38Accepted20850MS180K259 BG++rll代码 阅读全文
posted @ 2010-10-29 18:03 role 阅读(452) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2087这题主要考察字符串的处理(1)直接字符数组控制,哈哈……我的一次ac了,好高兴……(2) 直接调用库函数strstr()。strstr语法: #include <string.h>char *strstr( const char *str1... 阅读全文
posted @ 2010-10-29 17:37 role 阅读(797) 评论(1) 推荐(0) 编辑
摘要: PE了n次……http://acm.hdu.edu.cn/showproblem.php?pid=20882010-10-29 16:30:56Accepted20880MS180K410 BG++rll代码 阅读全文
posted @ 2010-10-29 16:38 role 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 在图书馆本来想借那本《算法导论》的,谁知我查了半天,书这个校区没有,失望至极,发现本程序设计实践,听不错的。就先弄懂它吧!这本书上面都是zoj,poj的题.之前一直不会用链表,这次补上了!题目:给出L个数从中找出出现次数最多的,将其输出.关键点:对时间没限制,但对内存有限制所以用链表比较快代码:#include<stdio.h>#include<stdlib.h>struc... 阅读全文
posted @ 2010-10-28 22:42 role 阅读(335) 评论(0) 推荐(0) 编辑