# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
658191 | bebra | Garaža (COCI17_garaza) | C++17 | 1465 ms | 41840 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;
#define dbg(x) cerr << #x << ": " << x << endl;
struct Segment {
int l;
int r;
int value;
Segment(int _l = 0, int _r = 0, int _value = 0)
: l(_l), r(_r), value(_value) {}
long long len() const {
return r - l + 1;
}
};
void merge(vector<Segment>& segs) {
vector<Segment> new_segs;
int n = segs.size();
for (int i = 0; i < n; ++i) {
int j = i;
int l = segs[i].l;
int r = segs[i].r;
while (j + 1 < n && segs[i].value == segs[j + 1].value) {
++j;
r = segs[j].r;
}
# | 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... |