Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class B
- {
- public: virtual void f() {};
- };
- class D : public B
- {
- public: void f() override {};
- };
- void Func() {
- B* tmp = new D();
- tmp->f();
- }
- number -> email
- import re
- import os
- import sys
- str = '\+7([0-9]{3,3})[0-9]{7,7}'
- email = ''
- def GetDirs(path):
- def GetFiles(path):
- def Dfs(current_path, email, str):
- files = GetFiles(current_path);
- for file_name in files:
- s = open(file_name).read()
- while re.replace(str, s, email):
- pass
- folders = GetDirs(current_path)
- for folder in folders:
- new_path = current_path
- find . -print0 -name '*html' | xargs -0 -n1 sed -i 's/regex/email/g'
- uint8_t reverse(uint8_t in) {
- for (size_t i = 0; i < 4; ++i) {
- if ((in >> i) ^ (in >> (7 - i)) & 1) {
- in ^= 1 << i;
- in ^= 1 << (7 - i);
- }
- }
- return in;
- }
- rb-tree - std::set, std::map
- std::queue<int> q;
- q.push(x);
- q.pop();
- q.front();
- list/vector/set/map/deques
- std::array<T, N>
- make_heap(st, en)
- priority_queue<>
- unordered_set<T>, unordered_map<T, T>
- SegmentTree
- FenwickTree
- Trie
- SuffixArray
- SqrtDecomp
- HeavyLightDecomp
- template<T>
- class Queue { // RAII
- private:
- std::conditional_value c;
- std::queue<T&&> q;
- std::mutex m;
- public:
- void Push(T&& x) {
- {
- std::lock_guard<std::mutex> guard(m);
- q.push(std::move(x));
- }
- c.notify_one();
- }
- T Pop() {
- std::lock_guard<std::mutex> guard(m);
- if (q.empty() )
- {
- c.wait([this] { return !q.empty(); });
- }
- T value = std::move(q.front());
- q.pop();
- return value;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement