Submission #979809

#TimeUsernameProblemLanguageResultExecution timeMemory
979809kaynStrange Device (APIO19_strange_device)C++14
0 / 100
937 ms37512 KiB
#include<bits/stdc++.h> #define ll long long #define pb push_back #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define run ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; ll n, a, b, l, r, ans; int main(){ cin >> n >> a >> b; ll kpk=a*b/__gcd(a, b); for(int i=1; i<=n; i++){ cin >> l >> r; ans=min(r-l+1, kpk); } cout << ans << endl; return 0; }
#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...