Jul 21, 2024
#include<bits/stdc++.h>
: Includes all standard libraries, avoiding individual includesusing namespace std;
: To avoid using std::
prefix repeatedlyvoid print() { cout << "Raj"; }
int sum(int a, int b) { return a + b; }
first
and second
vector<int> v;
v.push_back(1);
or v.emplace_back(2);
vector<int> v(5, 100);
vector<int> v2 = v1;
v[0]
or v.at(0)
vector<int>::iterator it = v.begin();
auto
keyword for simplified iterator declarationspush(element)
, pop()
, top()
, size()
, empty()
, swap()
push(element)
, pop()
, front()
, back()
, size()
, empty()
, swap()
greater<int>
)s.insert(1);
find
, count
m[key] = value;
, m.emplace(key, value);
m.find(key)
, m.erase(key)
, lower_bound
, upper_bound
sort(start_iterator, end_iterator)
bool comparator(const dataType& a, const dataType& b)
__builtin_popcount(x)
counts set bitsnext_permutation(start, end)
max_element(start, end)
and min_element(start, end)
Sponsor Reminder