Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <functional>
- #include <bitset>
- #include <string>
- #include <stack>
- #include <time.h>
- #include <random>
- #include <unordered_set>
- using namespace std;
- #define ll long long
- #define cin in
- #define cout out
- #define pii pair<int, int>
- #define ld long double
- #define u_set unordered_set
- #define uid uniform_int_distribution
- ifstream in("input.txt");
- ofstream out("output.txt");
- int H, W, n, cur_h = 1;
- const int TREE_SZ = 524288, INF = 2e9;
- int tree[TREE_SZ];
- struct line{
- int len, h;
- line() : len(W), h(cur_h++) {}
- };
- //size of 'lines' = cur_h
- vector<line> lines;
- void build(int v, int lb, int rb) {
- if(lb == rb) {
- tree[v] = lines[lb].h;
- return;
- }
- int mid = (lb + rb)/2;
- build(2*v, lb, mid);
- build(2*v+1, mid+1, rb);
- }
- void rebuild() {
- build(1, 0, cur_h-1);
- }
- void del(int v, int lb, int rb, int pos) {
- if(lb == rb && rb == pos) {
- tree[v] = INF;
- return;
- }
- int mid = (lb + rb)/2;
- if(pos <= mid)
- del(2*v, lb, mid, pos);
- else
- del(2*v+1, mid+1, rb, pos);
- tree[v] = min(tree[2*v], tree[2*v+1]);
- }
- void del(int pos) {
- del(1, 0, cur_h-1, pos);
- }
- int get_min(int v, int l, int r, int lb, int rb) {
- if(lb == l && rb == r)
- return tree[v];
- int mid = (lb + rb)/2;
- return min(get_min(2*v, l, min(mid, r), lb, mid),
- get_min(2*v+1, max(mid+1, l), r, mid+1, rb));
- }
- int get_min(int l, int r) {
- return get_min(1, 0, cur_h-1, l, r);
- }
- //finds first num that has more or equal 'len' than 'a' and returns its position in the array
- int bin_search(int a) {
- if(lines.back().len < a)
- return -1;
- int l = -1, r = cur_h - 1;
- while(r - l > 1) {
- int mid = (l+r)/2;
- if(lines[mid].len >= a)
- r = mid;
- else
- l = mid;
- }
- return r;
- }
- void resort() {
- }
- class Compare{
- public:
- bool operator()(const line &a, const line &b) const {
- return a.len < b.len;
- }
- };
- vector<int> queries;
- void input() {
- cin >> H >> W >> n;
- queries.resize(n);
- for(int &x : queries)
- cin >> x;
- }
- int main()
- {
- input();
- int i = 0;
- for(; (1 << i) < 400000; i++) ;
- cout << (1 << i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement