Submission #979814

#TimeUsernameProblemLanguageResultExecution timeMemory
979814kaynStrange Device (APIO19_strange_device)C++14
0 / 100
5091 ms524288 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; set<pll> s; for(int i=1; i<=n; i++){ cin >> l >> r; for(int t=l; t<=r; t++){ s.insert({(t+t/b)%a, t%b}); } } cout << s.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...