Advertisement
newb_ie

Untitled

Oct 11th, 2021
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2. using namespace std;
  3.  
  4. vector<pair<int,int>> rand_vector() {
  5. int n = rand() % 1000000 + 10;
  6. vector<pair<int,int>> query;
  7. for (int i = 0; i < n; ++i) {
  8. int type = rand() % 3;
  9. type += (type == 0);
  10. int x = rand() % 100;
  11. query.push_back(make_pair(type,x));
  12. }
  13. return query;
  14. }
  15.  
  16. int main () {
  17. ios::sync_with_stdio(false);
  18. cin.tie(nullptr);
  19. cout.tie(nullptr);
  20. // Problem Link : https://codeforces.com/problemset/problem/22/A
  21. //first
  22. //~ int n;
  23. //~ cin >> n;
  24. //~ vector<int> a;
  25. //~ for (int i = 0; i < n; ++i) {
  26. //~ int in;
  27. //~ cin >> in;
  28. //~ a.push_back(in);
  29. //~ }
  30. //~ sort (a.begin(),a.end()); //nlogn
  31. //~ auto it = upper_bound(a.begin(),a.end(),a[0]); //log2(n)
  32. //~ if (it == a.end()) {
  33. //~ cout << "NO\n";
  34. //~ } else {
  35. //~ cout << *it << '\n';
  36. //~ }
  37. //comp = nlogn
  38. //second
  39. //~ int n;
  40. //~ cin >> n;
  41. //~ vector<int> v;
  42. //~ for (int i = 0; i < n; ++i) {
  43. //~ int in;
  44. //~ cin >> in;
  45. //~ v.push_back(in);
  46. //~ }
  47. //~ sort (v.begin(),v.end()); //nlogn
  48. //~ int min_now = v[0];
  49. //~ for (int i = 1; i < n; ++i) {
  50. //~ if (v[i] > min_now) {
  51. //~ min_now = v[i];
  52. //~ break;
  53. //~ }
  54. //~ }
  55. //~ //o(n)
  56. //~ //comp = nlogn
  57. //~ if (min_now == v[0]) {
  58. //~ //update hoy nai
  59. //~ cout << "NO\n";
  60. //~ } else {
  61. //~ cout << min_now << '\n';
  62. //~ }
  63. //~ int n;
  64. //~ cin >> n;
  65. //~ set<int> st;
  66. //~ for (int i = 0; i < n; ++i) {
  67. //~ int in;
  68. //~ cin >> in;
  69. //~ st.insert(in);
  70. //~ }
  71. //~ auto it = st.begin();
  72. //~ it++;
  73. //~ if (it == st.end()) {
  74. //~ cout << "NO\n";
  75. //~ } else {
  76. //~ cout << *it << '\n';
  77. //~ }
  78. //~ int n;
  79. //~ cin >> n;
  80. //~ set<int> st;
  81. //~ for (int i = 0; i < n; ++i) {
  82. //~ int in;
  83. //~ cin >> in;
  84. //~ st.insert(in);
  85. //~ }
  86. //~ int x = *st.begin();
  87. //~ auto it = st.upper_bound(x); //if upper_bound of x is preesnt then returns a valid iterator otherwise returns st.end()
  88. //~ if (it == st.end()) {
  89. //~ cout << "NO\n";
  90. //~ } else {
  91. //~ cout << *it << '\n';
  92. //~ }
  93. //~ int level;
  94. //~ cin >> level;
  95. //~ int p;
  96. //~ cin >> p;
  97. //~ set<int> st;
  98. //~ for (int i = 0; i < p; ++i) {
  99. //~ int in;
  100. //~ cin >> in;
  101. //~ st.insert(in);
  102. //~ }
  103. //~ int q;
  104. //~ cin >> q;
  105. //~ for (int i = 0; i < q; ++i) {
  106. //~ int in;
  107. //~ cin >> in;
  108. //~ st.insert(in);
  109. //~ }
  110. //~ int size = st.size();
  111. //~ if (level == size) {
  112. //~ cout << "I become the guy.\n";
  113. //~ } else {
  114. //~ cout << "Oh, my keyboard!\n";
  115. //~ }
  116. vector<pair<int,int>> query = rand_vector();
  117. for (int i = 0; i < (int) query.size(); ++i) {
  118. int type = query[i].first,x = query[i].second;
  119. }
  120. }
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement