Submission #124398

#TimeUsernameProblemLanguageResultExecution timeMemory
124398MtaylorStrange Device (APIO19_strange_device)C++14
0 / 100
3997 ms524292 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl ; #define mp make_pair #define pb push_back #define f first #define s second #define all(v) (v).begin(),(v).end() const int MOD = 1000000007; const int N = 1000005; const double PI =4*atan(1); const double eps = 1e-7; ll n; ll a,b; set<pair<ll,ll> > ss; int main(){ ios::sync_with_stdio(0); //freopen("easy.txt","r",stdin); cin >> n >> a >> b; for(int i=0;i<n;i++){ ll x,y; cin >> x >> y; for(ll t=x;t<=y;t++){ ss.insert(mp((t+t/a)%a,t%b)); } } cout << ss.size() << 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...