# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
761889 | MinaRagy06 | Sky Walking (IOI19_walk) | C++17 | 707 ms | 391364 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>
using namespace std;
using ll = long long;
#define SZ(x) (int)x.size()
struct bheap {
vector<int> heap, mp;
vector<ll> val;
bheap() {}
bheap(int n) {
val.assign(n, 1e9);
mp.assign(n, -1);
}
void sink(int pos) {
while ((pos << 1) + 1 < SZ(heap)) {
int l = (pos << 1) + 1, r = (pos << 1) + 2;
int smallest = l;
if (r < SZ(heap) && val[heap[r]] < val[heap[l]]) smallest = r;
if (val[heap[smallest]] < val[heap[pos]]){
mp[heap[smallest]] = pos;
mp[heap[pos]] = smallest;
swap(heap[pos], heap[smallest]);
} else {
break;
}
pos = smallest;
}
}
bool swim(int pos) {
int p = (pos - 1) >> 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |