# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1174773 | Muhammet | Strange Device (APIO19_strange_device) | C++17 | 275 ms | 16992 KiB |
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define SZ(s) (int)s.size()
#define ff first
#define ss second
const int N = 3e5 + 5;
ll INF = LLONG_MAX;
int main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
ll n, a, b;
cin >> n >> a >> b;
ll ans = 0, s = 0;
vector <pair <ll, ll>> v;
ll x = (a / __gcd(a, b+1LL));
ll k = 0;
if(x <= INF / b) k = (x * b);
for(int i = 1; i <= n; i++) {
ll l, r;
cin >> l >> r;
s += (r - l + 1);
l %= k, r %= k;
if(l <= r) {
v.push_back({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... |