# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
819968 | Alan | Strange Device (APIO19_strange_device) | C++17 | 1548 ms | 100212 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 ll inf = 1e18;
void add (set<pair<ll, ll>>& st, ll l, ll r) {
auto it = st.lower_bound({l, 0}), tmp = it;
if (it != st.begin() && (--tmp)->second >= l) {
l = tmp->first;
st.erase(tmp);
}
while (it != st.end()) {
if (r >= it->first) {
r = max(r, it->second);
it = st.erase(it);
} else break;
}
st.insert({l, r});
}
int main () {
ll n, a, b;
cin >> n >> a >> b;
ll mod;
if (a / gcd(a, b+1) > inf / b) mod = inf;
else mod = a / gcd(a, b+1) * b;
set<pair<ll, ll>> st;
while (n--) {
ll l, 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... |
# | 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... |