# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129728 | pr3pony | Strange Device (APIO19_strange_device) | C++14 | 1257 ms | 63660 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;
typedef long long ll;
const ll inf = 1e18;
typedef pair<ll,ll> pll;
#define R first
#define L second
set<pll> s;
void add(pll p)
{
for (auto it = s.lower_bound({p.L,-1}); it != end(s) && it->L <= p.R; s.erase(it++)) {
p.L = min(p.L, it->L);
p.R = max(p.R, it->R);
}
s.insert(p);
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
ll A,B,ans=0;
cin >> n >> A >> B;
A /= __gcd(A,B+1);
if (A > inf / B) {
while (n--) {
ll l,r;
cin >> l >> r;
ans += r - 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |