- 博客(8)
- 问答 (1)
- 收藏
- 关注
原创 uva 10815
这道题可以map存储字符串,当然使用set更好,因为可以在加入集合时直接进行排序(当然,这道题比较简单,如果是自定义的数据可以重载运算符)。如果使用map就需要另外使用qsort对字符串进行排序。#include #include #include #include #include #include #include using namespace std;const in
2016-07-29 08:35:31 337
转载 sort qsort 用法总结
一篇很好的对于sort、qsort函数用法的总结。原博在这里:http://blog.sina.com.cn/s/blog_6439f26f01012xw3.htmlsort函数的用法做ACM题的时候,排序是一种经常要用到的操作。如果每次都自己写个冒泡之类的O(n^2)排序,不但程序容易超时,而且浪费宝贵的比赛时间,还很有可能写错。STL里面有个sort函数,可以直接对数组排序,复杂度
2016-07-28 23:23:35 342
原创 uva 10878
呵呵,比较容易想到,只要找几个相应的字符对比一下就能发现规律了。不难#include #include #include #include #include using namespace std;const string endline = "___________";string str;bool flag = false;int first, second, res
2016-07-28 23:17:31 326
原创 uva 409 poj 1598
uva 409和poj 1598是同一道题。这道题也算是基础题了,主要有两点需要注意1. A keyword "occurs" in an excuse if and only if it exists in the string in contiguous form and is delimited by the beginning or end of the line or any non
2016-07-28 23:12:06 740
原创 uva 10361
一道水水的题。注意的地方就是对字符串顺序处理时每个s串进行正确的分配,注意好边界问题就可以了。另外就是在进行测试用例之前注意好变量的初始化。code:#include #include #include #include #include using namespace std;int n;char ch;string s[6], strone, strtwo, sec
2016-07-23 23:10:14 318
原创 uva 10010
关于搜索的一道简单题。从一个字符块中搜出指定的单词,单词在字符块中的位置可以是水平,垂直,或者对角线共8个方向中的任意一个。注意:单词的所在的位置一定是一条直线。刚开始我把这道题当做dfs做,结果wa了好多次。#include #include #include #include #include using namespace std;const int maxn = 5
2016-07-23 23:05:24 370
原创 uva 537
一道关于字符串的简单题,主要就是从字符串中找到两个等号的位置后,进行分析便可。另外注意前缀所代表的数值大小(k, M, m)#include #include #include #include #include using namespace std;int kasenum;string str;double power, volt, curr;int pos[3]
2016-07-23 23:00:15 289
原创 uva 401
这几天老板有事出去开会了, 所以有了点时间能够看看别的内容。算法的东西好长时间没打了, 都是在看有关开发和数理统计的内容。于是打算开个新坑。大部分题目是入门经典中的uva 401 这道题比较简单, 在回文字符串的概念上增加了一个镜像对称的概念。code:#include #include #include #include #include using namespa
2016-07-23 22:54:42 343
空空如也
高斯滤波器空间域与频率域
2016-01-24
TA创建的收藏夹 TA关注的收藏夹
TA关注的人