Advertisement
999ms

Untitled

Oct 19th, 2020
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. class B
  2. {
  3. public: virtual void f() {};
  4. };
  5.  
  6. class D : public B
  7. {
  8. public: void f() override {};
  9. };
  10.  
  11. void Func() {
  12. B* tmp = new D();
  13. tmp->f();
  14. }
  15.  
  16.  
  17.  
  18.  
  19. number -> email
  20.  
  21.  
  22. import re
  23. import os
  24. import sys
  25.  
  26. str = '\+7([0-9]{3,3})[0-9]{7,7}'
  27. email = ''
  28.  
  29. def GetDirs(path):
  30.  
  31.  
  32. def GetFiles(path):
  33.  
  34.  
  35. def Dfs(current_path, email, str):
  36. files = GetFiles(current_path);
  37. for file_name in files:
  38. s = open(file_name).read()
  39. while re.replace(str, s, email):
  40. pass
  41. folders = GetDirs(current_path)
  42. for folder in folders:
  43. new_path = current_path
  44.  
  45.  
  46. find . -print0 -name '*html' | xargs -0 -n1 sed -i 's/regex/email/g'
  47.  
  48. uint8_t reverse(uint8_t in) {
  49. for (size_t i = 0; i < 4; ++i) {
  50. if ((in >> i) ^ (in >> (7 - i)) & 1) {
  51. in ^= 1 << i;
  52. in ^= 1 << (7 - i);
  53. }
  54. }
  55. return in;
  56. }
  57.  
  58.  
  59. rb-tree - std::set, std::map
  60. std::queue<int> q;
  61. q.push(x);
  62. q.pop();
  63. q.front();
  64.  
  65. list/vector/set/map/deques
  66. std::array<T, N>
  67. make_heap(st, en)
  68. priority_queue<>
  69.  
  70. unordered_set<T>, unordered_map<T, T>
  71.  
  72.  
  73.  
  74. SegmentTree
  75. FenwickTree
  76. Trie
  77. SuffixArray
  78. SqrtDecomp
  79. HeavyLightDecomp
  80.  
  81.  
  82. template<T>
  83. class Queue { // RAII
  84. private:
  85. std::conditional_value c;
  86. std::queue<T&&> q;
  87. std::mutex m;
  88.  
  89. public:
  90. void Push(T&& x) {
  91. {
  92. std::lock_guard<std::mutex> guard(m);
  93. q.push(std::move(x));
  94. }
  95. c.notify_one();
  96. }
  97.  
  98. T Pop() {
  99. std::lock_guard<std::mutex> guard(m);
  100. if (q.empty() )
  101. {
  102. c.wait([this] { return !q.empty(); });
  103. }
  104. T value = std::move(q.front());
  105. q.pop();
  106. return value;
  107. }
  108.  
  109.  
  110. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement