Submission #985571

#TimeUsernameProblemLanguageResultExecution timeMemory
985571crafticatStrange Device (APIO19_strange_device)C++17
10 / 100
5064 ms524288 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; int main() { ll n, a, b; cin >> n >> a >> b; set<pii> elm; for (int i = 0; i < n; ++i) { ll x, y; cin >> x >> y; for (ll j = x; j <= y; ++j) { elm.insert({(j + j / b) % a,j % b}); } } cout << elm.size(); 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...