# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835368 | dimashhh | Strange Device (APIO19_strange_device) | C++17 | 386 ms | 69752 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 int N = 1e6 + 1,MOD = 1e9 + 7;
ll n,l[N],r[N],a,b,ans;
__int128_t A,B,cyc,inf;
vector<pair<ll,ll>> all;
void test(){
cin >> n >> a >> b;
A = a;
B = b;
for(int i = 1;i <= n;i++){
cin >> l[i] >> r[i];
}
if(n == 1){
ll x = a / gcd(a,b + 1),val = r[1] - l[1] + 1;
if(x >= (val + b - 1) / val){
cout << (x % MOD * (b % MOD)) % MOD;
return;
}
cout << val % MOD;
return;
}
cyc = A * B / (gcd(a,b + 1));
inf = r[n];
ll _ = a * b / (gcd(a,b + 1));
Compilation message (stderr)
# | 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... |