답안 #252948

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
252948 2020-07-26T14:10:40 Z EntityIT 새 집 (APIO18_new_home) C++14
80 / 100
5000 ms 502856 KB
#include <bits/stdc++.h>
using namespace std;

#define ALL(x) (x).begin(), (x).end()
#define SZ(x) static_cast<int>((x).size())

template<class T, size_t D>
struct vec : vector<vec<T, D - 1>> {
  template<class... Args>
  vec(size_t n = 0, Args... args)
      : vector<vec<T, D - 1>>(n, vec<T, D - 1>(args...)) {}
};
template<class T>
struct vec<T, 1> : vector<T> {
  template<class... Args>
  vec(Args... args)
      : vector<T>(args...) {}
};

template<class T>
inline bool Minimize(T& a, const T& b) { return a > b ? a = b, true : false; }
template<class T>
inline bool Maximize(T& a, const T& b) { return a < b ? a = b, true : false; }
inline int Next(int i, int n) { return i == n - 1 ? 0 : i + 1; }
inline int Prev(int i, int n) { return !i ? n - 1 : i - 1; }

mt19937 rng(static_cast<uint32_t>(chrono::steady_clock::now().time_since_epoch().count()));

struct IT {
  int n;
  struct Node {
    array<vec<pair<int, int>, 1>, 2> segments;
    vec<pair<int, int>, 1> queries;
    Node()
        : segments({}),
          queries({}) {}
  };
  vec<Node, 1> nodes;
  IT(int t_n, const vec<pair<int, int>, 2>& queries_time_marks)
      : n(t_n),
        nodes(n << 1) {
    for (int i = 0; i < n; ++i) {
      nodes[i + n].queries = queries_time_marks[i];
    }
    for (int i = n - 1; i; --i) {
      merge(ALL(nodes[i << 1].queries), ALL(nodes[i << 1 | 1].queries), back_inserter(nodes[i].queries));
    }
  }

  void InsertSegment(int be, int en, bool slope, pair<int, int> val) {
    for (be += n, en += n; be < en; be >>= 1, en >>= 1) {
      if (be & 1) {
        nodes[be++].segments[slope].emplace_back(val);
      }
      if (en & 1) {
        nodes[--en].segments[slope].emplace_back(val);
      }
    }
  }
};

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);

  constexpr int kMaxX = 2e8;

  int n_stores, n_types, n_queries; cin >> n_stores >> n_types >> n_queries;

  vec<int, 1> time_marks; time_marks.reserve((n_stores << 1) + n_queries);

  vec<tuple<int, int, int, bool>, 1> changes; changes.reserve(n_stores << 1);
  while (n_stores--) {
    int x, type, l, r; cin >> x >> type >> l >> r; x <<= 1; --type;
    changes.emplace_back(l, x, type, true);
    changes.emplace_back(r + 1, x, type, false);
    time_marks.emplace_back(l);
    time_marks.emplace_back(r + 1);
  }
  sort(ALL(changes));

  vec<pair<int, int>, 1> queries(n_queries);
  for (auto& i : queries) {
    cin >> i.first >> i.second; i.first <<= 1;
    time_marks.emplace_back(i.second);
  }

  sort(ALL(time_marks));
  time_marks.erase(unique(ALL(time_marks)), time_marks.end());

  vec<int, 1> answers(n_queries);
  vec<int, 1> ord_queries(n_queries); iota(ALL(ord_queries), 0);
  sort(ALL(ord_queries), [&](int i, int j) { return queries[i].second < queries[j].second; });
  ord_queries.emplace_back(-1);
  array<vec<map<int, int>, 1>, 2> begin_times_types{vec<map<int, int>, 1>(n_types), vec<map<int, int>, 1>(n_types)};
  array<vec<tuple<int, int, int, int>, 1>, 2> segments;
  for (auto& i_query : ord_queries) {
    static auto it_changes = changes.begin();
    static int n_open_types = 0;
    static vec<map<int, int>, 1> n_occurrences_xs_types(n_types);

    for (; it_changes != changes.end() && (!~i_query || get<0>(*it_changes) <= queries[i_query].second); ++it_changes) {
      int cur_time, x, type; bool insertion; tie(cur_time, x, type, insertion) = *it_changes;
      n_open_types -= !!SZ(n_occurrences_xs_types[type]);
      cur_time = static_cast<int>(lower_bound(ALL(time_marks), cur_time) - time_marks.begin());

      auto Insert = [&](int a, int b) {
        if (!a) {
          begin_times_types[true][type][2] = cur_time;
        } else if (b > kMaxX) {
          begin_times_types[false][type][a] = cur_time;
        } else {
          begin_times_types[false][type][a] = begin_times_types[true][type][(a + b) >> 1] = cur_time;
        }
      };
      auto Erase = [&](int a, int b) {
        if (!a) {
          segments[true].emplace_back(2, b, begin_times_types[true][type][2], cur_time);
          if (get<2>(segments[true].back()) == get<3>(segments[true].back())) {
            segments[true].pop_back();
          }
          begin_times_types[true][type].erase(2);
        } else if (b > kMaxX) {
          segments[false].emplace_back(a, kMaxX, begin_times_types[false][type][a], cur_time);
          if (get<2>(segments[false].back()) == get<3>(segments[false].back())) {
            segments[false].pop_back();
          }
          begin_times_types[false][type].erase(a);
        } else {
          segments[false].emplace_back(a, (a + b) >> 1, begin_times_types[false][type][a], cur_time);
          if (get<2>(segments[false].back()) == get<3>(segments[false].back())) {
            segments[false].pop_back();
          }
          begin_times_types[false][type].erase(a);
          segments[true].emplace_back((a + b) >> 1, b, begin_times_types[true][type][(a + b) >> 1], cur_time);
          if (get<2>(segments[true].back()) == get<3>(segments[true].back())) {
            segments[true].pop_back();
          }
          begin_times_types[true][type].erase((a + b) >> 1);
        }
      };

			auto it = n_occurrences_xs_types[type].find(x);
      if (insertion) {
        if (it == n_occurrences_xs_types[type].end()) {
					it = n_occurrences_xs_types[type].emplace(x, 1).first;
          if (it == n_occurrences_xs_types[type].begin() && next(it) == n_occurrences_xs_types[type].end()) {
            Insert(0, x); Insert(x, kMaxX + 2);
          } else if (it == n_occurrences_xs_types[type].begin()) {
            Erase(0, next(it)->first);
            Insert(0, x); Insert(x, next(it)->first);
          } else if (next(it) == n_occurrences_xs_types[type].end()) {
            Erase(prev(it)->first, kMaxX + 2);
            Insert(prev(it)->first, x); Insert(x, kMaxX + 2);
          } else {
            Erase(prev(it)->first, next(it)->first);
            Insert(prev(it)->first, x); Insert(x, next(it)->first);
          }
        } else {
					++it->second;
				}
      } else {
        if (it->second == 1) {
          if (it == n_occurrences_xs_types[type].begin() && next(it) == n_occurrences_xs_types[type].end()) {
            Erase(0, x); Erase(x, kMaxX + 2);
          } else if (it == n_occurrences_xs_types[type].begin()) {
            Erase(0, x); Erase(x, next(it)->first);
            Insert(0, next(it)->first);
          } else if (next(it) == n_occurrences_xs_types[type].end()) {
            Erase(prev(it)->first, x); Erase(x, kMaxX + 2);
            Insert(prev(it)->first, kMaxX + 2);
          } else {
            Erase(prev(it)->first, x); Erase(x, next(it)->first);
            Insert(prev(it)->first, next(it)->first);
          }
          n_occurrences_xs_types[type].erase(it);
        } else {
					--it->second;
				}
      }
      n_open_types += !!SZ(n_occurrences_xs_types[type]);
    }

    if (n_open_types != n_types && ~i_query) {
      answers[i_query] = -1;
    }
  }

  vec<pair<int, int>, 2> queries_time_marks(SZ(time_marks));
  for (int i = 0; i < n_queries; ++i) {
    if (answers[i]) {
      continue;
    }
    queries_time_marks[static_cast<int>(lower_bound(ALL(time_marks), queries[i].second) - time_marks.begin())].emplace_back(queries[i].first, i);
  }
  for (auto& queries_time_mark : queries_time_marks) {
    sort(ALL(queries_time_mark));
  }

  cerr << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";

  IT it(SZ(time_marks), queries_time_marks);

  sort(ALL(segments[true]));
  for (auto& segment : segments[true]) {
    int l_x, r_x, be_time, en_time; tie(l_x, r_x, be_time, en_time) = segment;
    it.InsertSegment(be_time, en_time, true, make_pair(l_x, r_x));
  }

  cerr << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";

  sort(ALL(segments[false]), [&](auto i, auto j) { return get<1>(i) > get<1>(j); });
  for (auto& segment : segments[false]) {
    int l_x, r_x, be_time, en_time; tie(l_x, r_x, be_time, en_time) = segment;
    it.InsertSegment(be_time, en_time, false, make_pair(l_x, r_x));
  }

  cerr << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";

  for (int i = 1; i < SZ(it.nodes); ++i) {
    int max_x = 0;
    auto it_segments = it.nodes[i].segments[true].begin();
    for (auto& query : it.nodes[i].queries) {
      for (; it_segments != it.nodes[i].segments[true].end() && it_segments->first <= query.first; ++it_segments) {
        Maximize(max_x, it_segments->second);
      }
      Maximize(answers[query.second], max_x - query.first);
    }

    int min_x = kMaxX;
    it_segments = it.nodes[i].segments[false].begin();
    reverse(ALL(it.nodes[i].queries));
    for (auto& query : it.nodes[i].queries) {
      for (; it_segments != it.nodes[i].segments[false].end() && it_segments->second >= query.first; ++it_segments) {
        Minimize(min_x, it_segments->first);
      }
      Maximize(answers[query.second], query.first - min_x);
    }
  }

  cerr << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";

  for (auto& answer : answers) {
    cout << (~answer ? answer >> 1 : -1) << '\n';
  }

  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 2 ms 512 KB Output is correct
6 Correct 3 ms 896 KB Output is correct
7 Correct 2 ms 768 KB Output is correct
8 Correct 3 ms 768 KB Output is correct
9 Correct 2 ms 768 KB Output is correct
10 Correct 4 ms 896 KB Output is correct
11 Correct 2 ms 768 KB Output is correct
12 Correct 3 ms 896 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
14 Correct 2 ms 768 KB Output is correct
15 Correct 3 ms 896 KB Output is correct
16 Correct 2 ms 896 KB Output is correct
17 Correct 2 ms 896 KB Output is correct
18 Correct 2 ms 896 KB Output is correct
19 Correct 2 ms 768 KB Output is correct
20 Correct 2 ms 896 KB Output is correct
21 Correct 1 ms 640 KB Output is correct
22 Correct 2 ms 768 KB Output is correct
23 Correct 2 ms 768 KB Output is correct
24 Correct 2 ms 896 KB Output is correct
25 Correct 2 ms 896 KB Output is correct
26 Correct 3 ms 768 KB Output is correct
27 Correct 1 ms 512 KB Output is correct
28 Correct 2 ms 768 KB Output is correct
29 Correct 2 ms 768 KB Output is correct
30 Correct 2 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 2 ms 512 KB Output is correct
6 Correct 3 ms 896 KB Output is correct
7 Correct 2 ms 768 KB Output is correct
8 Correct 3 ms 768 KB Output is correct
9 Correct 2 ms 768 KB Output is correct
10 Correct 4 ms 896 KB Output is correct
11 Correct 2 ms 768 KB Output is correct
12 Correct 3 ms 896 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
14 Correct 2 ms 768 KB Output is correct
15 Correct 3 ms 896 KB Output is correct
16 Correct 2 ms 896 KB Output is correct
17 Correct 2 ms 896 KB Output is correct
18 Correct 2 ms 896 KB Output is correct
19 Correct 2 ms 768 KB Output is correct
20 Correct 2 ms 896 KB Output is correct
21 Correct 1 ms 640 KB Output is correct
22 Correct 2 ms 768 KB Output is correct
23 Correct 2 ms 768 KB Output is correct
24 Correct 2 ms 896 KB Output is correct
25 Correct 2 ms 896 KB Output is correct
26 Correct 3 ms 768 KB Output is correct
27 Correct 1 ms 512 KB Output is correct
28 Correct 2 ms 768 KB Output is correct
29 Correct 2 ms 768 KB Output is correct
30 Correct 2 ms 640 KB Output is correct
31 Correct 988 ms 116608 KB Output is correct
32 Correct 66 ms 7436 KB Output is correct
33 Correct 922 ms 113068 KB Output is correct
34 Correct 876 ms 110816 KB Output is correct
35 Correct 1012 ms 117672 KB Output is correct
36 Correct 1231 ms 117984 KB Output is correct
37 Correct 723 ms 104416 KB Output is correct
38 Correct 839 ms 105064 KB Output is correct
39 Correct 568 ms 91564 KB Output is correct
40 Correct 588 ms 94824 KB Output is correct
41 Correct 597 ms 88268 KB Output is correct
42 Correct 560 ms 80372 KB Output is correct
43 Correct 62 ms 7068 KB Output is correct
44 Correct 581 ms 87112 KB Output is correct
45 Correct 557 ms 82292 KB Output is correct
46 Correct 459 ms 73592 KB Output is correct
47 Correct 286 ms 62836 KB Output is correct
48 Correct 357 ms 65268 KB Output is correct
49 Correct 429 ms 70796 KB Output is correct
50 Correct 465 ms 75376 KB Output is correct
51 Correct 445 ms 69876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1530 ms 293796 KB Output is correct
2 Correct 1335 ms 289504 KB Output is correct
3 Correct 1228 ms 333152 KB Output is correct
4 Correct 1450 ms 300044 KB Output is correct
5 Correct 1592 ms 289372 KB Output is correct
6 Correct 1296 ms 289632 KB Output is correct
7 Correct 1302 ms 333340 KB Output is correct
8 Correct 1420 ms 299860 KB Output is correct
9 Correct 1666 ms 290108 KB Output is correct
10 Correct 1663 ms 290144 KB Output is correct
11 Correct 1247 ms 288368 KB Output is correct
12 Correct 1511 ms 289632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4508 ms 423296 KB Output is correct
2 Correct 305 ms 39140 KB Output is correct
3 Correct 4704 ms 450472 KB Output is correct
4 Correct 1672 ms 322740 KB Output is correct
5 Correct 3095 ms 349404 KB Output is correct
6 Correct 2629 ms 341208 KB Output is correct
7 Correct 4469 ms 476776 KB Output is correct
8 Correct 4916 ms 464972 KB Output is correct
9 Correct 1801 ms 358504 KB Output is correct
10 Correct 3222 ms 421480 KB Output is correct
11 Correct 4506 ms 459028 KB Output is correct
12 Correct 4826 ms 451204 KB Output is correct
13 Correct 2382 ms 371216 KB Output is correct
14 Correct 2223 ms 400592 KB Output is correct
15 Correct 2688 ms 424880 KB Output is correct
16 Correct 3053 ms 427236 KB Output is correct
17 Correct 2658 ms 400816 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 2 ms 512 KB Output is correct
6 Correct 3 ms 896 KB Output is correct
7 Correct 2 ms 768 KB Output is correct
8 Correct 3 ms 768 KB Output is correct
9 Correct 2 ms 768 KB Output is correct
10 Correct 4 ms 896 KB Output is correct
11 Correct 2 ms 768 KB Output is correct
12 Correct 3 ms 896 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
14 Correct 2 ms 768 KB Output is correct
15 Correct 3 ms 896 KB Output is correct
16 Correct 2 ms 896 KB Output is correct
17 Correct 2 ms 896 KB Output is correct
18 Correct 2 ms 896 KB Output is correct
19 Correct 2 ms 768 KB Output is correct
20 Correct 2 ms 896 KB Output is correct
21 Correct 1 ms 640 KB Output is correct
22 Correct 2 ms 768 KB Output is correct
23 Correct 2 ms 768 KB Output is correct
24 Correct 2 ms 896 KB Output is correct
25 Correct 2 ms 896 KB Output is correct
26 Correct 3 ms 768 KB Output is correct
27 Correct 1 ms 512 KB Output is correct
28 Correct 2 ms 768 KB Output is correct
29 Correct 2 ms 768 KB Output is correct
30 Correct 2 ms 640 KB Output is correct
31 Correct 988 ms 116608 KB Output is correct
32 Correct 66 ms 7436 KB Output is correct
33 Correct 922 ms 113068 KB Output is correct
34 Correct 876 ms 110816 KB Output is correct
35 Correct 1012 ms 117672 KB Output is correct
36 Correct 1231 ms 117984 KB Output is correct
37 Correct 723 ms 104416 KB Output is correct
38 Correct 839 ms 105064 KB Output is correct
39 Correct 568 ms 91564 KB Output is correct
40 Correct 588 ms 94824 KB Output is correct
41 Correct 597 ms 88268 KB Output is correct
42 Correct 560 ms 80372 KB Output is correct
43 Correct 62 ms 7068 KB Output is correct
44 Correct 581 ms 87112 KB Output is correct
45 Correct 557 ms 82292 KB Output is correct
46 Correct 459 ms 73592 KB Output is correct
47 Correct 286 ms 62836 KB Output is correct
48 Correct 357 ms 65268 KB Output is correct
49 Correct 429 ms 70796 KB Output is correct
50 Correct 465 ms 75376 KB Output is correct
51 Correct 445 ms 69876 KB Output is correct
52 Correct 374 ms 70656 KB Output is correct
53 Correct 362 ms 69860 KB Output is correct
54 Correct 604 ms 82808 KB Output is correct
55 Correct 620 ms 86968 KB Output is correct
56 Correct 515 ms 86976 KB Output is correct
57 Correct 629 ms 88260 KB Output is correct
58 Correct 673 ms 82160 KB Output is correct
59 Correct 621 ms 79860 KB Output is correct
60 Correct 591 ms 83088 KB Output is correct
61 Correct 94 ms 21644 KB Output is correct
62 Correct 470 ms 74420 KB Output is correct
63 Correct 576 ms 82676 KB Output is correct
64 Correct 605 ms 87792 KB Output is correct
65 Correct 615 ms 93808 KB Output is correct
66 Correct 673 ms 91992 KB Output is correct
67 Correct 165 ms 17520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 2 ms 512 KB Output is correct
6 Correct 3 ms 896 KB Output is correct
7 Correct 2 ms 768 KB Output is correct
8 Correct 3 ms 768 KB Output is correct
9 Correct 2 ms 768 KB Output is correct
10 Correct 4 ms 896 KB Output is correct
11 Correct 2 ms 768 KB Output is correct
12 Correct 3 ms 896 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
14 Correct 2 ms 768 KB Output is correct
15 Correct 3 ms 896 KB Output is correct
16 Correct 2 ms 896 KB Output is correct
17 Correct 2 ms 896 KB Output is correct
18 Correct 2 ms 896 KB Output is correct
19 Correct 2 ms 768 KB Output is correct
20 Correct 2 ms 896 KB Output is correct
21 Correct 1 ms 640 KB Output is correct
22 Correct 2 ms 768 KB Output is correct
23 Correct 2 ms 768 KB Output is correct
24 Correct 2 ms 896 KB Output is correct
25 Correct 2 ms 896 KB Output is correct
26 Correct 3 ms 768 KB Output is correct
27 Correct 1 ms 512 KB Output is correct
28 Correct 2 ms 768 KB Output is correct
29 Correct 2 ms 768 KB Output is correct
30 Correct 2 ms 640 KB Output is correct
31 Correct 988 ms 116608 KB Output is correct
32 Correct 66 ms 7436 KB Output is correct
33 Correct 922 ms 113068 KB Output is correct
34 Correct 876 ms 110816 KB Output is correct
35 Correct 1012 ms 117672 KB Output is correct
36 Correct 1231 ms 117984 KB Output is correct
37 Correct 723 ms 104416 KB Output is correct
38 Correct 839 ms 105064 KB Output is correct
39 Correct 568 ms 91564 KB Output is correct
40 Correct 588 ms 94824 KB Output is correct
41 Correct 597 ms 88268 KB Output is correct
42 Correct 560 ms 80372 KB Output is correct
43 Correct 62 ms 7068 KB Output is correct
44 Correct 581 ms 87112 KB Output is correct
45 Correct 557 ms 82292 KB Output is correct
46 Correct 459 ms 73592 KB Output is correct
47 Correct 286 ms 62836 KB Output is correct
48 Correct 357 ms 65268 KB Output is correct
49 Correct 429 ms 70796 KB Output is correct
50 Correct 465 ms 75376 KB Output is correct
51 Correct 445 ms 69876 KB Output is correct
52 Correct 1530 ms 293796 KB Output is correct
53 Correct 1335 ms 289504 KB Output is correct
54 Correct 1228 ms 333152 KB Output is correct
55 Correct 1450 ms 300044 KB Output is correct
56 Correct 1592 ms 289372 KB Output is correct
57 Correct 1296 ms 289632 KB Output is correct
58 Correct 1302 ms 333340 KB Output is correct
59 Correct 1420 ms 299860 KB Output is correct
60 Correct 1666 ms 290108 KB Output is correct
61 Correct 1663 ms 290144 KB Output is correct
62 Correct 1247 ms 288368 KB Output is correct
63 Correct 1511 ms 289632 KB Output is correct
64 Correct 4508 ms 423296 KB Output is correct
65 Correct 305 ms 39140 KB Output is correct
66 Correct 4704 ms 450472 KB Output is correct
67 Correct 1672 ms 322740 KB Output is correct
68 Correct 3095 ms 349404 KB Output is correct
69 Correct 2629 ms 341208 KB Output is correct
70 Correct 4469 ms 476776 KB Output is correct
71 Correct 4916 ms 464972 KB Output is correct
72 Correct 1801 ms 358504 KB Output is correct
73 Correct 3222 ms 421480 KB Output is correct
74 Correct 4506 ms 459028 KB Output is correct
75 Correct 4826 ms 451204 KB Output is correct
76 Correct 2382 ms 371216 KB Output is correct
77 Correct 2223 ms 400592 KB Output is correct
78 Correct 2688 ms 424880 KB Output is correct
79 Correct 3053 ms 427236 KB Output is correct
80 Correct 2658 ms 400816 KB Output is correct
81 Correct 374 ms 70656 KB Output is correct
82 Correct 362 ms 69860 KB Output is correct
83 Correct 604 ms 82808 KB Output is correct
84 Correct 620 ms 86968 KB Output is correct
85 Correct 515 ms 86976 KB Output is correct
86 Correct 629 ms 88260 KB Output is correct
87 Correct 673 ms 82160 KB Output is correct
88 Correct 621 ms 79860 KB Output is correct
89 Correct 591 ms 83088 KB Output is correct
90 Correct 94 ms 21644 KB Output is correct
91 Correct 470 ms 74420 KB Output is correct
92 Correct 576 ms 82676 KB Output is correct
93 Correct 605 ms 87792 KB Output is correct
94 Correct 615 ms 93808 KB Output is correct
95 Correct 673 ms 91992 KB Output is correct
96 Correct 165 ms 17520 KB Output is correct
97 Correct 2734 ms 369508 KB Output is correct
98 Correct 346 ms 41624 KB Output is correct
99 Execution timed out 5071 ms 502856 KB Time limit exceeded
100 Halted 0 ms 0 KB -