Pagini recente » Diferente pentru blog/problema-saptamanii-segmente intre reviziile 4 si 1 | Diferente pentru blog/cpp11 intre reviziile 52 si 40 | Diferente pentru blog/cpp11 intre reviziile 52 si 29 | Diferente pentru blog/count-distinct intre reviziile 2 si 3 | Diferente pentru blog/cpp11 intre reviziile 47 si 52
Diferente pentru
blog/cpp11 intre reviziile
#47 si
#52
Nu exista diferente intre titluri.
Diferente intre continut:
vector<pair<int, int>> dirs = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
==
Note that since $C++11$ you no longer need to introduce a space between closing right angle brackets $(>>)$.
Note that in $C++11$ you no longer need to introduce a space between closing right angle brackets $(>>)$.
h3. 4. unordered_set, unordered_map
cout << "Anna is " << age["anna"] << " years old." << endl;
==
Using STL vectors, pairs or user defined objects as keys is a little trickier because you also need to provide the hash function.
Using STL vectors, pairs or user defined objects as keys is a little trickier because you also need to provide a hash function.
== code(cpp) |
#include <unordered_set>
(Often, a cleaner alternative to using lambda functions for sorting is to define a class holding all the data for each entry and to implement the $<$ operator.)
_Please let us know in the comments section what other $C++11$ features do you use for programming contests. Code snippets illustrating your favorite tricks would be beneficial for us all._
_Let us know in the comments section what are the $C++11$ features that you use for programming contests. Code snippets illustrating your favorite tricks are welcome._
Diferente intre securitate:
Diferente intre topic forum: