Submission #136658

#TimeUsernameProblemLanguageResultExecution timeMemory
136658KLPPStrange Device (APIO19_strange_device)C++14
0 / 100
2512 ms17304 KiB
#include<bits/stdc++.h> using namespace std; typedef long long int lld; #define rep(i,a,b) for(int i=a;i<b;i++) #define trav(a,v) for(auto a:v) lld GCD(lld x, lld y){ if(y==0)return x; return GCD(y,x%y); } int main(){ lld n,A,B; cin>>n>>A>>B; lld l[n]; lld r[n]; rep(i,0,n)cin>>l[i]>>r[i]; lld D=GCD(A,B+1); cout<<min(r[0]-l[0]+1,D*B)<<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...