摘要: 2014-06-04 19:47:37题意&思路:基本的单词检索,排序和标记#include #include #include #include using namespace std;const int maxn = 1000;struct Word{ char s[25]; cha... 阅读全文
posted @ 2014-06-04 21:22 Naturain 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0401:43:18题意&思路:手动冒泡排序。#include #include using namespace std;int main(){ int Case,n,s[55],cnt; scanf("%d",&Case); while(Case--){ ... 阅读全文
posted @ 2014-06-04 01:44 Naturain 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0401:40:03题意&思路:变相的冒泡排序,交换的方式比较奇特。思路是逐个找剩余元素中的最大值,并把它转到第一,再转到剩余元素的最后一个,如:51234,把5转到最后;再如15234,把5转到第一,51234再转到最后。#include #include #include usi... 阅读全文
posted @ 2014-06-04 01:42 Naturain 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0300:03:22题意&思路:计算距离&检索,不多说。#include #include #include using namespace std;const int maxn = 5000;const double INF = 1000000;const double eps =... 阅读全文
posted @ 2014-06-03 00:05 Naturain 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0300:01:44题意&思路:随便敲个排序上去即可,这里手敲复习了一下快排。#include #include #include #include #include using namespace std;const int maxn = 10000;void quick_sort... 阅读全文
posted @ 2014-06-03 00:03 Naturain 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0300:00:35题意&思路:简单题。#include #include #include #include using namespace std;struct Country{ char name[80];};Country cou[2005];bool cmp(Coun... 阅读全文
posted @ 2014-06-03 00:01 Naturain 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0216:46:25题意&思路:简单的单次遍历检索。(以后要求输出空格的时候,直接从样例中取。。。这次傻X地PE两次)#include #include #include #include using namespace std;const int maxn = 1000;int m... 阅读全文
posted @ 2014-06-02 16:48 Naturain 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0202:03:12总结:A题题意理解有误,耽误了点时间- -!,B题不难,但思路整理花了太多时间,还runtime error了一次,囧!后来就半小时看C了,想来是个简单题,结束后才AA:(写的好挫TAT)#include #include #include using names... 阅读全文
posted @ 2014-06-02 02:12 Naturain 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0202:02:03题意&思路:判断是否溢出,用double类型即可。#include #include #include #include using namespace std;const int maxn = 1000;const int maxint = 2147483647... 阅读全文
posted @ 2014-06-02 02:03 Naturain 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0120:00:48题意 & 思路:大数加,不废话。#include #include #include #include using namespace std;const int maxn = 1000;struct bign{ int len,s[maxn + 5]; ... 阅读全文
posted @ 2014-06-01 20:01 Naturain 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0118:03:30题意 & 思路:大数乘,这里采用的小白书里的bign结构体#include #include #include #include using namespace std;const int maxn = 1000;struct bign{ int len,s... 阅读全文
posted @ 2014-06-01 18:04 Naturain 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 首先要说明的是ACM题目中涉及的基本是初级高精度,直接模拟手算一般不会超时(也可用java),关于高精度的研究还有很多,介绍一个Huge cal库:http://www.emath.ac.cn/hugecalc/关于字符串,主要增加一些acm入门知识。以分知识点的形式给出:1:scanf %c 有其... 阅读全文
posted @ 2014-06-01 00:52 Naturain 阅读(411) 评论(0) 推荐(0) 编辑
摘要: 引用:http://blog.csdn.net/chhuach2005/article/details/21168179具体我就不转了,大数乘法一般直接模拟手算,至于分治法、FFT算法、傅里叶高效算法......除非效率有要求、数据很大才会用到。 阅读全文
posted @ 2014-06-01 00:34 Naturain 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 2014-06-0100:08:41题意 & 思路:循环匹配、替换字符串。呵呵,又是一道典型的字符串处理,scanf %c A之,一开始理解为按单词匹配,后在才发现不是这样(fs : ba g rs : hind the g)。#include #include #include using nam... 阅读全文
posted @ 2014-06-01 00:10 Naturain 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 2014-05-3121:42:46题意 & 思路:小数据匹配前缀,直接strncmp()函数写之,1编A,(如果每条数据长而数据量大,考虑KMP)#include #include #include using namespace std;int main(){ int cnt = 0,nu... 阅读全文
posted @ 2014-05-31 21:44 Naturain 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 偶然发现数字与几何的关系,以后会继续补充(碎碎念) 阅读全文
posted @ 2014-05-31 21:14 Naturain 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 2014-05-3119:41:32题意 & 思路:有点密码学的味道(只是有点。。。呵呵),其实完全可以出的难一点,加入更多解密环节,这题就是单纯的给出ASCII码的二进制形式,让你输出字符。从这个题目里还能洞察到细节,看懂解码方法的时间有待推敲,如果我们能熟悉记住各个字母所对应的数字、ASCII码... 阅读全文
posted @ 2014-05-31 19:43 Naturain 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 2014-05-3119:38:36题意 & 思路:以scanf(%c)的方式吃单词(虽然getline也可以,但scanf %c不容易出错),因为要输出不同的单词,而文章中的单词可能重复,那就空间换时间。#include #include #include #include #include us... 阅读全文
posted @ 2014-05-31 19:41 Naturain 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 2014-05-3017:10:28题意:找匹配单词,简单题。本来想用C++ string和istringstream,WA了- -,果断用朴素算法。#include #include #include using namespace std;void Lowcase(char *p){ in... 阅读全文
posted @ 2014-05-30 17:12 Naturain 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 灵感来自2014携程赛的第一题。这个题目的关键在于如何建立合适的模型对三类状态进行刻画。这道题目巧妙地在并查集中运用了带权向量来表示(推算)同根元素之间的关系。把并查集中的元素属性从原先的属于根拓展到属于根和相互关系。建模思想:因为总共有三类状态,相互关系有三种,用rank【k】表示k与其最祖先节点... 阅读全文
posted @ 2014-05-29 17:39 Naturain 阅读(139) 评论(0) 推荐(0) 编辑