# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826088 | dxz05 | Toys (CEOI18_toy) | C++17 | 1990 ms | 31212 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.
#pragma GCC optimize("Ofast,O3,unroll-loops")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
set<pair<int, int>> dp[1500];
void add_segment(int l, int r, set<pair<int, int>> &s){
s.emplace(l, r);
auto it = s.find(make_pair(l, r));
if (next(it) != s.end()){
auto nit = next(it);
if (nit->first <= r + 1){
l = min(l, nit->first);
r = max(r, nit->second);
s.erase(nit);
s.erase(it);
s.emplace(l, r);
it = s.find(make_pair(l, r));
}
}
if (it != s.begin()){
auto pit = prev(it);
if (pit->second >= l - 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... |