Submission #933709

#TimeUsernameProblemLanguageResultExecution timeMemory
933709irmuunStrange Device (APIO19_strange_device)C++17
5 / 100
248 ms15964 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n,a,b; cin>>n>>a>>b; ll l[n+5],r[n+5]; ll g=a/gcd((b+1)%a,a),MX=1e18+1; if(MX/b>=g){ g=g*b; } else{ g=MX; } for(ll i=1;i<=n;i++){ cin>>l[i]>>r[i]; } if(n==1){ cout<<min(r[1]-l[1]+1,g); } }
#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...