Submission #1010143

#TimeUsernameProblemLanguageResultExecution timeMemory
1010143RandomUserStrange Device (APIO19_strange_device)C++17
10 / 100
5035 ms524288 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; int main() { ll n, A, B; cin >> n >> A >> B; set<pair<ll, ll> > st; for(int i=0; i<n; i++) { ll L, R; cin >> L >> R; for(auto j=L; j<=R; j++) { st.insert(make_pair( (j + j / B) % A, j % B )); } } cout << st.size() << '\n'; 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...