Hi everyone.
I think we can spread the science over Codeforces community, by sharing our knowledge
and experiences
in our blog and in that way we learn and let others learn also :D.
I will start with something simple and I hope it will help you Codeforces members :D.
Did you know that [C++] got StringTokenizer
like [Java], it's implemented as a function in STL <cstring>
called strtok(char * str, char * delimiters)
for more information.
Thanks HitmanBBa for this idea, I think it's worth trying :).
I just learnt this, I hope it will help you :)
for_each
2.Better with c++11(Compile it with -std=c++11,submit it with G++11 4.9.2)
Sorry for such a stupid mistake '^_^
P.S: for_each work on both
c++11
andc++98
, and I think ACM judges usingc++98
.Both in my regional and the WF we had C++11
or you can simply do this:
copy(v.begin(),v.end(),ostream_iterator(cout," "));
C++ container compare operator overloads.
>,>=,<=,!=
are similar. UPD: Also works withlist
.what does v3<v1 mean?
as i understand it is like string comparing, is this true ?
Yes.We call that lexicographic order.
Check this for more information.