# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
748338 | 2023-05-26T06:59:02 Z | Sharky | Strange Device (APIO19_strange_device) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int n, A, B, ans = 0; cin >> n >> A >> B; map<int, bool> mp; int mul = 3E18; if (3E18 / A >= B) mul = A * B; for (int i = 0; i < n; i++) { int l, r; cin >> l >> r; for (int j = l; j <= r; j++) mp[j % mul] = 1; } for (bool x : seen) ans += x; cout << ans << '\n'; return 0; }