超级线段树
Time Limit: 5000ms
Memory Limit: 65536KB
64-bit integer IO format: %lld Java class name: Main
Prev Submit Status Statistics Discuss Next
Font Size:
+
-
Type:
...
分类:
其他好文 时间:
2015-05-09 20:27:54
阅读次数:
171
#include
#include
using namespace std;
bool find_str(string s1,string s2)
{
if(s1.empty()||s2.empty())
return false;
string::size_type pos=s1.find(s2);
return (pos!=string::npos)?true:false;
}
in...
分类:
其他好文 时间:
2015-05-08 14:54:42
阅读次数:
155
//读一组数到vector对象,计算收尾配对元素的和并输出
#include
#include
int main()
{
std::vector ivec;
int temp, add;
while(std::cin>>temp)
ivec.push_back(temp);
typedef std::vector::size_type vec...
分类:
编程语言 时间:
2015-05-06 13:24:26
阅读次数:
220
#include #include using namespace std;namespace strtool{string trim(const string& str){ string::size_type pos = str.find_first_not_of(' '); if (...
分类:
编程语言 时间:
2015-04-29 19:18:09
阅读次数:
191
#include
#include
using namespace std;
bool is_circle(string src,string des)
{
if(src.empty()||des.empty())
return false;
string temp=src;
temp+=src;
string::size_type pos=0;
pos=temp.find(des)...
分类:
其他好文 时间:
2015-04-23 15:50:07
阅读次数:
131
自我感觉代码写的比较乱,这方面要好好注意一下。总结:1.在使用vector::size_type 类似的类型时,千万要注意循环的条件判断,很容易发生溢出的危险!所以我最后很懒的选择使用int - -。2.下标表示和元素个数表示之间的细微差别。下标之间的变换关系:父节点 parent(i)=(i-1)...
分类:
编程语言 时间:
2015-04-05 17:16:34
阅读次数:
151
给定一个字符串,例如“abaccdeff”则第一次出现的字符就是b;
#include
#include
using namespace std;
void first(const string &input)
{
if(input.empty())
return ;
string::size_type length=input.size();
int *times=new int[l...
分类:
编程语言 时间:
2015-04-03 13:34:49
阅读次数:
136
vector是一种顺序容器。 构造函数: vector(); vector( const vector& c ); vector( size_type num, const TYPE& val = TYPE() ); vector( input_iterator start, inpu...
#include #include #include int main(){ std::string s; // assign(size_type count, CharT ch) s.assign(4, '='); std::cout ilist) s.assign({ 'C', '...
分类:
其他好文 时间:
2015-03-30 20:39:54
阅读次数:
144
Qt下 QString 实现了split()函数,而std::string则没有实现,STL中也没有实现,只能自己写一个了。
#include
#include
using namespace std;
vector split(string strtem,char a)
{
vector strvec;
string::size_type po...