Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- vector<pair<int,int>> rand_vector() {
- int n = rand() % 1000000 + 10;
- vector<pair<int,int>> query;
- for (int i = 0; i < n; ++i) {
- int type = rand() % 3;
- type += (type == 0);
- int x = rand() % 100;
- query.push_back(make_pair(type,x));
- }
- return query;
- }
- int main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- // Problem Link : https://codeforces.com/problemset/problem/22/A
- //first
- //~ int n;
- //~ cin >> n;
- //~ vector<int> a;
- //~ for (int i = 0; i < n; ++i) {
- //~ int in;
- //~ cin >> in;
- //~ a.push_back(in);
- //~ }
- //~ sort (a.begin(),a.end()); //nlogn
- //~ auto it = upper_bound(a.begin(),a.end(),a[0]); //log2(n)
- //~ if (it == a.end()) {
- //~ cout << "NO\n";
- //~ } else {
- //~ cout << *it << '\n';
- //~ }
- //comp = nlogn
- //second
- //~ int n;
- //~ cin >> n;
- //~ vector<int> v;
- //~ for (int i = 0; i < n; ++i) {
- //~ int in;
- //~ cin >> in;
- //~ v.push_back(in);
- //~ }
- //~ sort (v.begin(),v.end()); //nlogn
- //~ int min_now = v[0];
- //~ for (int i = 1; i < n; ++i) {
- //~ if (v[i] > min_now) {
- //~ min_now = v[i];
- //~ break;
- //~ }
- //~ }
- //~ //o(n)
- //~ //comp = nlogn
- //~ if (min_now == v[0]) {
- //~ //update hoy nai
- //~ cout << "NO\n";
- //~ } else {
- //~ cout << min_now << '\n';
- //~ }
- //~ int n;
- //~ cin >> n;
- //~ set<int> st;
- //~ for (int i = 0; i < n; ++i) {
- //~ int in;
- //~ cin >> in;
- //~ st.insert(in);
- //~ }
- //~ auto it = st.begin();
- //~ it++;
- //~ if (it == st.end()) {
- //~ cout << "NO\n";
- //~ } else {
- //~ cout << *it << '\n';
- //~ }
- //~ int n;
- //~ cin >> n;
- //~ set<int> st;
- //~ for (int i = 0; i < n; ++i) {
- //~ int in;
- //~ cin >> in;
- //~ st.insert(in);
- //~ }
- //~ int x = *st.begin();
- //~ auto it = st.upper_bound(x); //if upper_bound of x is preesnt then returns a valid iterator otherwise returns st.end()
- //~ if (it == st.end()) {
- //~ cout << "NO\n";
- //~ } else {
- //~ cout << *it << '\n';
- //~ }
- //~ int level;
- //~ cin >> level;
- //~ int p;
- //~ cin >> p;
- //~ set<int> st;
- //~ for (int i = 0; i < p; ++i) {
- //~ int in;
- //~ cin >> in;
- //~ st.insert(in);
- //~ }
- //~ int q;
- //~ cin >> q;
- //~ for (int i = 0; i < q; ++i) {
- //~ int in;
- //~ cin >> in;
- //~ st.insert(in);
- //~ }
- //~ int size = st.size();
- //~ if (level == size) {
- //~ cout << "I become the guy.\n";
- //~ } else {
- //~ cout << "Oh, my keyboard!\n";
- //~ }
- vector<pair<int,int>> query = rand_vector();
- for (int i = 0; i < (int) query.size(); ++i) {
- int type = query[i].first,x = query[i].second;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement