Submission #216986

#TimeUsernameProblemLanguageResultExecution timeMemory
216986sevlllStrange Device (APIO19_strange_device)C++14
0 / 100
5079 ms524292 KiB
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> #include <chrono> #include <random> #include <queue> #include <bitset> #define pb push_back #define int long long #define str string using namespace std; const int M = 1e9 + 7; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, a, b; cin >> n >> a >> b; vector<pair<int, int>> pr(n); for (int i = 0; i < n; i++) cin >> pr[i].first >> pr[i].second; set<int> ses; for (auto p : pr) { int l = p.first, r = p.second; for (int x = l; x <= r; x++) { ses.insert(x % (a*b)); } } cout << ses.size(); }
#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...