# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
721503 | 2023-04-11T03:21:21 Z | GrandTiger1729 | 이상한 기계 (APIO19_strange_device) | C++17 | 5000 ms | 524288 KB |
#include <bits/stdc++.h> using namespace std; const int INF = 1e18 + 10; int main(){ cin.tie(0)->sync_with_stdio(0); int n; cin >> n; long long A, B; cin >> A >> B; if ((__int128_t)1 * A * B / __gcd(A, B + 1) >= INF){ long long ans = 0; for (int i = 0; i < n; i++){ long long l, r; cin >> l >> r; ans += r - l + 1; } cout << ans << '\n'; return 0; } long long D = (__int128_t)1 * A * B / __gcd(A, B + 1); set<long long> st; for (int i = 0; i < n; i++){ long long l, r; cin >> l >> r; for (long long j = l; j <= r; j++) st.insert(j % D); } // cerr << D << '\n'; // for (auto &v: st) // cerr << v << ' '; // cerr << endl; cout << st.size() << '\n'; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 49 ms | 9696 KB | Output is correct |
3 | Correct | 62 ms | 13852 KB | Output is correct |
4 | Correct | 2 ms | 724 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 5 ms | 992 KB | Output is correct |
10 | Correct | 1 ms | 212 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 ms | 212 KB | Output is correct |
13 | Correct | 1 ms | 212 KB | Output is correct |
14 | Correct | 1 ms | 340 KB | Output is correct |
15 | Correct | 36 ms | 5268 KB | Output is correct |
16 | Correct | 20 ms | 5460 KB | Output is correct |
17 | Correct | 53 ms | 5668 KB | Output is correct |
18 | Correct | 1 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Runtime error | 4019 ms | 524288 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 98 ms | 24276 KB | Output is correct |
3 | Correct | 89 ms | 24132 KB | Output is correct |
4 | Correct | 108 ms | 22968 KB | Output is correct |
5 | Execution timed out | 5044 ms | 46944 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 572 ms | 50240 KB | Output is correct |
3 | Incorrect | 338 ms | 3332 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 572 ms | 50240 KB | Output is correct |
3 | Incorrect | 338 ms | 3332 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 572 ms | 50240 KB | Output is correct |
3 | Incorrect | 338 ms | 3332 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Runtime error | 2386 ms | 524288 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 49 ms | 9696 KB | Output is correct |
3 | Correct | 62 ms | 13852 KB | Output is correct |
4 | Correct | 2 ms | 724 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 5 ms | 992 KB | Output is correct |
10 | Correct | 1 ms | 212 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 ms | 212 KB | Output is correct |
13 | Correct | 1 ms | 212 KB | Output is correct |
14 | Correct | 1 ms | 340 KB | Output is correct |
15 | Correct | 36 ms | 5268 KB | Output is correct |
16 | Correct | 20 ms | 5460 KB | Output is correct |
17 | Correct | 53 ms | 5668 KB | Output is correct |
18 | Correct | 1 ms | 212 KB | Output is correct |
19 | Correct | 1 ms | 212 KB | Output is correct |
20 | Runtime error | 4019 ms | 524288 KB | Execution killed with signal 9 |
21 | Halted | 0 ms | 0 KB | - |