A
A
alexus912016-12-05 16:42:25
C++ / C#
alexus91, 2016-12-05 16:42:25

What libraries, built-in functions and containers can be used in Olympiad programming?

I write in C++. I already use the vector, set, map, queue libraries. From algorithm I use sort, nth_element.
What other "chips" are there that help in the Olympiad programming, besides these? Maybe the containers are already implemented like a Cartesian tree, or built-in parsing ... what I don't know yet? )))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlexF, 2016-12-07
@AleexF

I will answer as one of the participants of the Olympiad Programming.
In general, there are many nuances. Libraries that I need the most and that I use:

#include <algorithm>
#include <iostream>
#include <memory.h>
#include <iterator>
#include <cassert>
#include <fstream>
#include <cstdlib>
#include <vector>
#include <cstdio>
#include <string>
#include <queue>
#include <deque>
#include <cmath>
#include <ctime>
#include <stack>
#include <set>
#include <map>

I do not recommend using the library #include <bits/stdc++.h>. there are old compilers (ver < 5.0) that don't include it, but it's worth keeping in mind. This library includes everything described above and even more! Of the containers there are:
queue <TYPENAME>- Queue ( More ) Able to recognize the first element of the queue, add to the end, remove from the beginning for O (1).
deque <TYPENAME>- Modification of the queue ( More details ( cppstudio.com/post/8469 )) The same, but it can add and remove from both ends.
stack <TYPENAME>- Container. ( More ) Able to add an element to the beginning and get it from the beginning.
priority_queue <TYPENAME>- Modification of the queue (I did not find a suitable description). Like set, only sorts the elements in ascending order.

D
Denis Zagaevsky, 2016-12-06
@zagayevskiy

It is so useful to know everything that is in the standard library. Open www.cplusplus.com/reference/stl and watch all containers, algorithms, etc. At least even just superficially, what it is and what properties it has. Someday pops up in my head at the right time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question