Submission #835368

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8353682023-08-23 13:52:07dimashhhStrange Device (APIO19_strange_device)C++17
100 / 100
386 ms69752 KiB
#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));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

strange_device.cpp: In function 'void test()':
strange_device.cpp:48:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |     for(int i = 0;i < all.size();i++){
      |                   ~~^~~~~~~~~~~~
strange_device.cpp:50:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |         for(int j = i + 1;j < all.size();j++){
      |                           ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...