解题报告
题意:
略。
思路:
map应用。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
mapMap;
int main()
{
string str1,str2,str;
int i,j;
while...
分类:
其他好文 时间:
2014-08-09 21:34:19
阅读次数:
277
解题报告
题目传送门
题意:
给一个字符串,要求,对于这个字符串空隔为k取字符对(k=0,1,2,3,4...)要求在相同的空隔取对过程汇总,整个字符串中没有一个相同字符对如:
ZGBZ:
间隔为0的字符对有: ZG、GB、BZ,三个均不相同
间隔为1的字符对有: ZG、 GZ,均不相同
间隔为2的字符对有: ZZ 仅有一个,不必比较。
这种字符串定义为...
分类:
其他好文 时间:
2014-08-09 21:33:09
阅读次数:
190
public member function
std::vector::front
reference front();
const_reference front() const;
Access first element
访问第一个元素
Returns a reference to the first element in the vector....
分类:
其他好文 时间:
2014-08-09 18:45:48
阅读次数:
243
说到底就是一个大数乘幂运算,小数点后零。明白大数乘幂算法直接搞。 这里就有几个问题: 1.幂位数小可以用二进制容器表示(取模更好,但我是为了练习STL) 2.n位大数用string表示,外加一个int型表示小数点位置 3.字符串×字符串用小学竖式乘法算法就行,注意补零。位数多时两个str...
分类:
其他好文 时间:
2014-08-09 18:30:08
阅读次数:
340
很简单的一个,就是总超时。问题出在我使用的短平快,简单直接的方式已经不灵了。 这种情况我总结以下原因: 1.尽量用STL模板容器,qsort()等内置,他们优化得很好 2.不用的话需要了解哈希算法。 本题用了快排与哈希,自己写也行(麻烦),不写的话用qsort与STL map,否则超时。...
分类:
其他好文 时间:
2014-08-09 18:16:48
阅读次数:
229
Train Problem I
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 20521 Accepted Submission(s): 7712
Problem Description
As the ne...
分类:
其他好文 时间:
2014-08-09 15:56:18
阅读次数:
222
Rails
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 24762
Accepted: 9715
Description
There is a famous railway station in PopPush City. Country there is...
分类:
其他好文 时间:
2014-08-09 13:30:17
阅读次数:
286
对STL的优先队列,map,set的小总结,望指正。...
分类:
其他好文 时间:
2014-08-09 11:44:57
阅读次数:
269
//5种迭代器,为了激活重载机制,定义的5个类型。每种迭代器就是一个类型。
struct input_iterator_tag{};
struct output_iterator_tag{};
struct forward_iterator_tag : public input_iterator_tag{};
struct bidirectional_iterator_tag:public fo...
分类:
其他好文 时间:
2014-08-09 11:43:17
阅读次数:
275