Submission #1095123

# Submission time Handle Problem Language Result Execution time Memory
1095123 2024-10-01T10:24:05 Z vjudge1 Strange Device (APIO19_strange_device) C++17
10 / 100
5000 ms 524288 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <set>
#warning That's not the baby, that's my baby

#define debug(x) #x << " = " << x << '\n'
using ll = long long;

const int INF = 1e9;

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  #ifdef LOCAL
freopen("input.txt", "r", stdin);
  #endif

  int n;
  ll A, B;
  std::cin >> n >> A >> B;

  std::set<std::pair<ll, ll>> st;

  for (int i = 0; i < n; i++) {
    ll l, r;
    std::cin >> l >> r;
    for (ll j = l; j <= r; j++) {
      st.insert({(j + j / B) % A, j % B});
    }
  }

  std::cout << (int) st.size();

  return 0;
}

Compilation message

strange_device.cpp:6:2: warning: #warning That's not the baby, that's my baby [-Wcpp]
    6 | #warning That's not the baby, that's my baby
      |  ^~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 31 ms 12748 KB Output is correct
3 Correct 47 ms 18196 KB Output is correct
4 Correct 2 ms 860 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 5 ms 1116 KB Output is correct
10 Correct 0 ms 452 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 29 ms 7000 KB Output is correct
16 Correct 21 ms 7036 KB Output is correct
17 Correct 39 ms 10336 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1926 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 92 ms 32416 KB Output is correct
3 Correct 109 ms 32228 KB Output is correct
4 Correct 78 ms 30548 KB Output is correct
5 Execution timed out 5065 ms 62548 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 435 ms 100180 KB Output is correct
3 Runtime error 1457 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 435 ms 100180 KB Output is correct
3 Runtime error 1457 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 435 ms 100180 KB Output is correct
3 Runtime error 1457 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1084 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 31 ms 12748 KB Output is correct
3 Correct 47 ms 18196 KB Output is correct
4 Correct 2 ms 860 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 5 ms 1116 KB Output is correct
10 Correct 0 ms 452 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 29 ms 7000 KB Output is correct
16 Correct 21 ms 7036 KB Output is correct
17 Correct 39 ms 10336 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Runtime error 1926 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -