本文版权归点A点C和博客园共有,欢迎转载,但必须保留此段声明,并给出原文连接,谢谢合作!!!

2013年11月9日

Codeforces Beat Round#57(Div.2)

摘要: A. Tabletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSimon has a rectangular table consisting ofnrows andmcolumns. Simon numbered the rows of the table from top to bottom starting from one and the columns — from left to right starting from one. 阅读全文

posted @ 2013-11-09 22:07 点A点C 阅读(197) 评论(0) 推荐(0) 编辑

hdu4472-Count

摘要: CountTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1092Accepted Submission(s): 717Problem DescriptionProf. Tigris is the head of an archaeological team who is currently in charge of an excavation in a site of ancient relics.This site contains rel 阅读全文

posted @ 2013-11-09 21:52 点A点C 阅读(292) 评论(0) 推荐(0) 编辑

2013年11月8日

Codeforces Beta Round #55 (Div. 2)

摘要: B题#include #include#includeusing namespace std;int main(){int n,a,sum=0,min=101;scanf("%d",&n);while(n--){scanf("%d",&a);sum+=a;if(a%2==1&&a#include#include #include using namespace std;int main(){ char s1[105]; char s2[105]; int zimu[27]; char out[105]; int n; wh 阅读全文

posted @ 2013-11-08 10:54 点A点C 阅读(282) 评论(0) 推荐(0) 编辑

2013年10月13日

优化素数表

摘要: 所谓有素数筛选法,就是从2(最小的素数)开始往上进行筛选,把所有质数的整倍数都剔除掉,最后剩下来的就是素数了。当然这不是最好最快的方法,占用的空间也不小,不过这种方法简单易行,运行效率也不是太低——比起最普通的用函数判断每个数那也是天壤之别了,所以还是非常常用的。有一处优化:筛选i的倍数时,可以直接从i^2开始筛选,因为比i^2小的倍数已经被比i小的素数给筛选掉了,因为这样,外层循环也可以只累加到sqrt(n)即可。另外一个Re_storage函数将素数表进行转存,便于某些情况下的访问,prime_count保存素数的个数。C++ CODE:#define MAXNUM 10000bool p 阅读全文

posted @ 2013-10-13 17:25 点A点C 阅读(344) 评论(0) 推荐(0) 编辑

2013年10月10日

Codeforces Beta Round #49 (Div. 2)-D. Physical Education

摘要: D. Physical Educationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is a school PE teacher. Unlike other PE teachers, Vasya doesn't like it when the students stand in line according to their height. Instead, he demands that the childre 阅读全文

posted @ 2013-10-10 20:53 点A点C 阅读(257) 评论(0) 推荐(0) 编辑

Codeforces Beta Round #49 (Div. 2)-C. Little Frog

摘要: C. Little Frogtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there arenmounds on the swamp, located on one line. The distance between the neighb 阅读全文

posted @ 2013-10-10 20:44 点A点C 阅读(334) 评论(0) 推荐(0) 编辑

2013年9月22日

一些不知道的函数

摘要: 1.ceil(x)返回不小于x的最小整数值。2.floor(x)返回不大于x的最大整数值。3.round(x)返回x的四舍五入整数值。4.svec1.swap(svec2);把两个容器内的元素互换5.acos(x)求余弦值x对应的角,结果为弧度需乘以180/PI (acos(b) / PI *180);6.函数名: strstr函数原型:extern char *strstr(char *str1, char *str2);功能:从字符串str1中查找是否有字符串str2,如果有,从str1中的str2位置起,返回str1中str2起始位置的指针,如果没有,返回null。返回值:返回该位置的指 阅读全文

posted @ 2013-09-22 21:57 点A点C 阅读(205) 评论(0) 推荐(1) 编辑

kmp算法详解

摘要: 刚看到位兄弟也贴了份KMP算法说明,但本人觉得说的不是很详细,当初我在看这个算法的时候也看的头晕昏昏的,我贴的这份也是网上找的。且听详细分解:KMP字符串模式匹配详解来自CSDN A_B_C_ABC网友KMP字符串模式匹配通俗点说就是一种在一个字符串中定位另一个串的高效算法。简单匹配算法的时间复杂度为O(m*n);KMP匹配算法。可以证明它的时间复杂度为O(m+n).。一.简单匹配算法先来看一个简单匹配算法的函数:int Index_BF ( char S [ ], char T [ ], int pos ){/*若串S中从第pos(S的下标0≤posS[0]!= S[1],S[1] != S 阅读全文

posted @ 2013-09-22 17:31 点A点C 阅读(500) 评论(0) 推荐(1) 编辑

2013年8月22日

STL之accumulate用法小结

摘要: 转自:http://hi.baidu.com/liziyun537/item/84fa271bf73cdf0be75c3660函数原型如下:#include TYPE accumulate( iterator start, iterator end, TYPE val );TYPE accumulate( iterator start, iterator end, TYPE val, BinaryFunction f );第一个原型用来计算变量val和容器中某个区间[start,end)元素之和。比如求某个数组所有元素之和:accumulate(&a[0],&a[n],0); 阅读全文

posted @ 2013-08-22 14:33 点A点C 阅读(725) 评论(0) 推荐(0) 编辑

STL——list学习笔记

摘要: STL中list的使用 (转)转自:http://blog.163.com/lee_020/blog/static/12475560201227105822183/STL中的list就是一双向链表,可高效地进行插入删除元素。现总结一下它的操作。文中所用到两个list对象c1,c2分别有元素c1(10,20,30)c2(40,50,60)。还有一个list::iterator citer用来指向c1或c2元素。list对象的声明构造():A. listc0;//空链表B. listc1(3);//建一个含三个默认值是0的元素的链表C. listc2(5,2);//建一个含五个元素的链表,值都是2 阅读全文

posted @ 2013-08-22 14:30 点A点C 阅读(259) 评论(0) 推荐(0) 编辑

导航