제출 #130301

#제출 시각아이디문제언어결과실행 시간메모리
130301osaaateiasavtnl이상한 기계 (APIO19_strange_device)C++14
10 / 100
5057 ms524292 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int n, A, B, D, M; int get(int n) { return min(n, D); } int lcm(int a, int b) { return (a / __gcd(a, b)) * b; } signed main() { #ifdef HOME freopen("input.txt", "r", stdin); #else ios_base::sync_with_stdio(0); cin.tie(0); #endif cin >> n >> A >> B; D = A / __gcd(A, B + 1); int M = B * D; set <int> ms; while (n--) { int l, r; cin >> l >> r; for (int i = l; i <= r; ++i) { ms.insert(i % M); } } cout << ms.size() << '\n'; }
#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...