# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
983034 | 2024-05-15T07:13:44 Z | vjudge1 | Strange Device (APIO19_strange_device) | C++17 | 222 ms | 15964 KB |
#include<bits/stdc++.h> #define sz size() #define ll long long using namespace std; void out(__int128 a) { string s; while(a) s += char(a % 10 + '0'), a /= 10; reverse(s.begin(), s.end()); cout << s; } void solve() { ll n, A, B, i, j, k; cin >> n >> A >> B; ll l[n + 1], r[n + 1]; for(i = 1; i <= n; ++i) cin >> l[i] >> r[i]; ll g = __gcd(A, B); __int128 x = A, y = B, z = g, x0 = (r[1] - l[1] + 1); x = x * y; if(x0 < x) x = x0; out(x); } signed main() { ios_base::sync_with_stdio(0); cin.tie(0), cout.tie(0); solve(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 3 ms | 604 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 516 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 1 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 222 ms | 15964 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 222 ms | 15964 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 222 ms | 15964 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 23 ms | 2020 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 3 ms | 604 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |