# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
342615 | SeDunion | Bigger segments (IZhO19_segments) | C++17 | 373 ms | 39572 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;
const int N = 5e5 + 55;
ll a[N], p[N];
ll sum(int l, int r) {
return p[r] - p[l - 1];
}
using pll = pair<ll,ll>;
set<pair<ll,pll>> s;
vector<set<pair<ll,pll>>::iterator> del;
void upd(ll pos, pll val) {
//cout << pos << " " << val.first << " " << val.second << " mk" << endl;;
del.clear();
auto it = s.upper_bound({pos, {-1, -1}});
if (s.size() && it != s.begin() && prev(it)->second >= val) return;
//cout << "actually added" << endl;
while (it != s.end() && it->second <= val) {
del.push_back(it);
it++;
}
for (auto it : del) {
s.erase(it);
}
# | 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... |