Submission #1031685

#TimeUsernameProblemLanguageResultExecution timeMemory
1031685stdfloatStrange Device (APIO19_strange_device)C++17
0 / 100
1915 ms524288 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, A, B; cin >> n >> A >> B; set<pair<int, int>> s; while (n--) { int l, r; cin >> l >> r; for (int i = l; i <= r; i++) s.insert({(i + (i / B)) % A, i % B}); } cout << (int)s.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...