Submission #927685

#TimeUsernameProblemLanguageResultExecution timeMemory
927685AiperiiiStrange Device (APIO19_strange_device)C++14
10 / 100
5060 ms524288 KiB
#include <bits/stdc++.h> #define int long long #define ff first #define ss second #define all(x) x.begin(),x.end() #define pb push_back using namespace std; signed main(){ int n,a,b; cin>>n>>a>>b; set <pair <int,int> > st; for(int i=0;i<n;i++){ int l,r; cin>>l>>r; for(int j=l;j<=r;j++){ st.insert({(j+j/b)%a,j%b}); } } cout<<st.size()<<"\n"; }
#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...