# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34867 | szawinis | Deda (COCI17_deda) | C++14 | 333 ms | 9184 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int N = 1 << 18;
pair<int,int> get_range(int i) {
int l = 0, r = N-1;
for(int j = 31 - __builtin_clz(i) - 1; j >= 0; j--) {
int mid = l+r >> 1;
if(i >> j & 1) l = mid+1;
else r = mid;
}
return make_pair(l, r);
}
struct query {
char tp;
int x, a, i;
bool operator<(const query& rhs) { return x < rhs.x; }
};
int n, q, t[2*N], res[N];
query qq[N];
void update(int i, int v) {
for(t[i += N] = v; i > 1; i >>= 1) t[i>>1] = min(t[i], t[i^1]);
}
int qflow(int i, int k) {
int l, r; tie(l, r) = get_range(i);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |