Submission #733161

#TimeUsernameProblemLanguageResultExecution timeMemory
733161minhcoolStrange Device (APIO19_strange_device)C++17
10 / 100
5095 ms524288 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define pb push_back #define mp make_pair typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int N = 3e5 + 5; const int oo = 1e18 + 7, mod = 1e9 + 7; int n, a, b; set<ii> se; void process(){ cin >> n >> a >> b; for(int i = 1; i <= n; i++){ int l, r; cin >> l >> r; for(int j = l; j <= r; j++) se.insert({(j + j/b) % a, j%b}); } cout << se.size() << "\n"; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); process(); }
#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...