답안 #387320

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
387320 2021-04-08T09:08:11 Z rama_pang 푸드 코트 (JOI21_foodcourt) C++17
100 / 100
566 ms 42220 KB
#include <bits/stdc++.h>
using namespace std;

using lint = long long;
const lint inf = 1e18;

// Build Segment Tree over queries
// We need to simulate operations fast
// Can be done with matrix-like multiplication
// O(N + Q log Q).
//
// Matrix Multiplication:
// [a, b] [e] = [min(a + e, b + f)]
// [c, d] [f] = [min(c + e, d + f)]
//
// Identity:
// [0, inf] [head]
// [inf, 0] [tail]
//
// Push Back
// [0, inf] [head]
// [inf, K] [tail]
//
// Pop Front
// [K,   0] [head]
// [inf, 0] [tail]

struct Matrix {
  array<array<lint, 2>, 2> M;

  Matrix(lint K = 0) {
    if (K == 0) { // Identity
      M[0] = {0, inf};
      M[1] = {inf, 0};
    } else if (K > 0) { // Push Back
      M[0] = {0, inf};
      M[1] = {inf, K};
    } else if (K < 0) { // Pop Front
      M[0] = {-K,  0};
      M[1] = {inf, 0};
    }
  }

  pair<lint, lint> Get(lint head, lint tail) { // Multiply by (head, tail)
    return pair(min(M[0][0] + head, M[0][1] + tail), min(M[1][0] + head, M[1][1] + tail));
  }

  friend Matrix operator*(const Matrix &a, const Matrix &b) {
    Matrix c;
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        c.M[i][j] = min(a.M[i][0] + b.M[0][j], a.M[i][1] + b.M[1][j]);
      }
    }
    return c;
  }
};

class SegTree {
 public:
  int sz;
  vector<Matrix> tree;

  SegTree(int n) {
    sz = 1; while (sz < n) sz *= 2;
    tree.assign(2 * sz, Matrix(0));
  }

  void Modify(int p, int K) {
    tree[p += sz] = Matrix(K);
    for (p /= 2; p > 0; p /= 2) {
      tree[p] = tree[p * 2 + 1] * tree[p * 2];
    }
  }

  pair<lint, lint> Query(int l, int r) { // (head, tail)
    Matrix L(0), R(0);
    for (l += sz, r += sz + 1; l < r; l /= 2, r /= 2) {
      if (l & 1) L = tree[l++] * L;
      if (r & 1) R = R * tree[--r];
    }
    return (R * L).Get(0, 0);
  }

  int BinarySearch(lint pos) {
    int r = 1;
    lint head = 0, tail = 0;
    while (r < sz) {
      if (pos < tree[r * 2].Get(head, tail).second) {
        r = r * 2;
      } else {
        tie(head, tail) = tree[r * 2].Get(head, tail);
        r = r * 2 + 1;
      }
    }
    tie(head, tail) = tree[r].Get(head, tail);
    assert(pos < tail);
    return r - sz;
  }
};

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

  int N, M, Q;
  cin >> N >> M >> Q;

  vector<int> ans(Q + 1, -1);
  vector<int> color(Q + 1, -1);
  vector<vector<array<lint, 3>>> Query(N + 1);

  for (int q = 1; q <= Q; q++) {
    int T;
    cin >> T;
    if (T == 1) {
      lint L, R, K;
      cin >> L >> R >> color[q] >> K;
      Query[L - 1].push_back({0, q, K});
      Query[R].push_back({0, q, 0});
    } else if (T == 2) {
      lint L, R, K;
      cin >> L >> R >> K;
      Query[L - 1].push_back({0, q, -K});
      Query[R].push_back({0, q, 0});
    } else if (T == 3) {
      lint A, B;
      cin >> A >> B;
      Query[A - 1].push_back({1, q, B});
    }
  }

  SegTree seg(Q + 1);
  for (int S = 0; S < N; S++) { // Current shop
    for (auto [t, q, k] : Query[S]) {
      if (t == 0) {
        seg.Modify(q, k);
      } else if (t == 1) {
        auto [head, tail] = seg.Query(0, q);
        lint ans_pos = head + k - 1;
        ans[q] = ans_pos >= tail ? 0 : color[seg.BinarySearch(ans_pos)];
      }
    }
  }

  for (int q = 1; q <= Q; q++) {
    if (ans[q] != -1) {
      cout << ans[q] << '\n';
    }
  }
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 620 KB Output is correct
2 Correct 3 ms 620 KB Output is correct
3 Correct 3 ms 620 KB Output is correct
4 Correct 3 ms 620 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 4 ms 668 KB Output is correct
8 Correct 3 ms 620 KB Output is correct
9 Correct 3 ms 620 KB Output is correct
10 Correct 3 ms 620 KB Output is correct
11 Correct 3 ms 620 KB Output is correct
12 Correct 3 ms 620 KB Output is correct
13 Correct 2 ms 620 KB Output is correct
14 Correct 2 ms 748 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 3 ms 748 KB Output is correct
17 Correct 3 ms 620 KB Output is correct
18 Correct 4 ms 620 KB Output is correct
19 Correct 3 ms 620 KB Output is correct
20 Correct 3 ms 748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 620 KB Output is correct
2 Correct 3 ms 620 KB Output is correct
3 Correct 3 ms 620 KB Output is correct
4 Correct 3 ms 620 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 4 ms 668 KB Output is correct
8 Correct 3 ms 620 KB Output is correct
9 Correct 3 ms 620 KB Output is correct
10 Correct 3 ms 620 KB Output is correct
11 Correct 3 ms 620 KB Output is correct
12 Correct 3 ms 620 KB Output is correct
13 Correct 2 ms 620 KB Output is correct
14 Correct 2 ms 748 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 3 ms 748 KB Output is correct
17 Correct 3 ms 620 KB Output is correct
18 Correct 4 ms 620 KB Output is correct
19 Correct 3 ms 620 KB Output is correct
20 Correct 3 ms 748 KB Output is correct
21 Correct 4 ms 620 KB Output is correct
22 Correct 4 ms 748 KB Output is correct
23 Correct 3 ms 620 KB Output is correct
24 Correct 3 ms 748 KB Output is correct
25 Correct 2 ms 620 KB Output is correct
26 Correct 3 ms 620 KB Output is correct
27 Correct 3 ms 748 KB Output is correct
28 Correct 3 ms 748 KB Output is correct
29 Correct 3 ms 672 KB Output is correct
30 Correct 4 ms 672 KB Output is correct
31 Correct 4 ms 748 KB Output is correct
32 Correct 3 ms 748 KB Output is correct
33 Correct 3 ms 748 KB Output is correct
34 Correct 3 ms 748 KB Output is correct
35 Correct 3 ms 748 KB Output is correct
36 Correct 3 ms 788 KB Output is correct
37 Correct 3 ms 620 KB Output is correct
38 Correct 3 ms 748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 93 ms 10564 KB Output is correct
2 Correct 100 ms 10892 KB Output is correct
3 Correct 95 ms 10660 KB Output is correct
4 Correct 93 ms 10604 KB Output is correct
5 Correct 97 ms 10860 KB Output is correct
6 Correct 112 ms 10880 KB Output is correct
7 Correct 44 ms 8020 KB Output is correct
8 Correct 53 ms 7980 KB Output is correct
9 Correct 95 ms 10860 KB Output is correct
10 Correct 112 ms 10860 KB Output is correct
11 Correct 102 ms 10804 KB Output is correct
12 Correct 104 ms 10900 KB Output is correct
13 Correct 81 ms 9900 KB Output is correct
14 Correct 94 ms 10804 KB Output is correct
15 Correct 111 ms 10604 KB Output is correct
16 Correct 119 ms 11108 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 473 ms 37144 KB Output is correct
2 Correct 360 ms 33512 KB Output is correct
3 Correct 516 ms 39020 KB Output is correct
4 Correct 384 ms 34656 KB Output is correct
5 Correct 366 ms 33900 KB Output is correct
6 Correct 524 ms 40428 KB Output is correct
7 Correct 199 ms 29304 KB Output is correct
8 Correct 217 ms 29232 KB Output is correct
9 Correct 479 ms 38124 KB Output is correct
10 Correct 472 ms 38124 KB Output is correct
11 Correct 520 ms 40300 KB Output is correct
12 Correct 515 ms 40300 KB Output is correct
13 Correct 499 ms 40300 KB Output is correct
14 Correct 525 ms 40300 KB Output is correct
15 Correct 518 ms 40204 KB Output is correct
16 Correct 521 ms 40300 KB Output is correct
17 Correct 514 ms 40172 KB Output is correct
18 Correct 531 ms 40312 KB Output is correct
19 Correct 528 ms 40100 KB Output is correct
20 Correct 521 ms 40172 KB Output is correct
21 Correct 523 ms 40172 KB Output is correct
22 Correct 518 ms 40084 KB Output is correct
23 Correct 523 ms 40300 KB Output is correct
24 Correct 517 ms 40172 KB Output is correct
25 Correct 411 ms 39532 KB Output is correct
26 Correct 411 ms 41452 KB Output is correct
27 Correct 452 ms 41472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 620 KB Output is correct
2 Correct 3 ms 620 KB Output is correct
3 Correct 3 ms 620 KB Output is correct
4 Correct 3 ms 620 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 4 ms 668 KB Output is correct
8 Correct 3 ms 620 KB Output is correct
9 Correct 3 ms 620 KB Output is correct
10 Correct 3 ms 620 KB Output is correct
11 Correct 3 ms 620 KB Output is correct
12 Correct 3 ms 620 KB Output is correct
13 Correct 2 ms 620 KB Output is correct
14 Correct 2 ms 748 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 3 ms 748 KB Output is correct
17 Correct 3 ms 620 KB Output is correct
18 Correct 4 ms 620 KB Output is correct
19 Correct 3 ms 620 KB Output is correct
20 Correct 3 ms 748 KB Output is correct
21 Correct 93 ms 10564 KB Output is correct
22 Correct 100 ms 10892 KB Output is correct
23 Correct 95 ms 10660 KB Output is correct
24 Correct 93 ms 10604 KB Output is correct
25 Correct 97 ms 10860 KB Output is correct
26 Correct 112 ms 10880 KB Output is correct
27 Correct 44 ms 8020 KB Output is correct
28 Correct 53 ms 7980 KB Output is correct
29 Correct 95 ms 10860 KB Output is correct
30 Correct 112 ms 10860 KB Output is correct
31 Correct 102 ms 10804 KB Output is correct
32 Correct 104 ms 10900 KB Output is correct
33 Correct 81 ms 9900 KB Output is correct
34 Correct 94 ms 10804 KB Output is correct
35 Correct 111 ms 10604 KB Output is correct
36 Correct 119 ms 11108 KB Output is correct
37 Correct 79 ms 10092 KB Output is correct
38 Correct 80 ms 9876 KB Output is correct
39 Correct 40 ms 7764 KB Output is correct
40 Correct 49 ms 8076 KB Output is correct
41 Correct 102 ms 10860 KB Output is correct
42 Correct 97 ms 10988 KB Output is correct
43 Correct 100 ms 10988 KB Output is correct
44 Correct 96 ms 10988 KB Output is correct
45 Correct 99 ms 10860 KB Output is correct
46 Correct 97 ms 10988 KB Output is correct
47 Correct 60 ms 9880 KB Output is correct
48 Correct 79 ms 11372 KB Output is correct
49 Correct 67 ms 9196 KB Output is correct
50 Correct 80 ms 10240 KB Output is correct
51 Correct 97 ms 10988 KB Output is correct
52 Correct 98 ms 10988 KB Output is correct
53 Correct 75 ms 9836 KB Output is correct
54 Correct 96 ms 10988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 9708 KB Output is correct
2 Correct 90 ms 10220 KB Output is correct
3 Correct 93 ms 10476 KB Output is correct
4 Correct 65 ms 9068 KB Output is correct
5 Correct 81 ms 9708 KB Output is correct
6 Correct 100 ms 10348 KB Output is correct
7 Correct 48 ms 7712 KB Output is correct
8 Correct 48 ms 7696 KB Output is correct
9 Correct 65 ms 9692 KB Output is correct
10 Correct 59 ms 9324 KB Output is correct
11 Correct 81 ms 9708 KB Output is correct
12 Correct 84 ms 9836 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 620 KB Output is correct
2 Correct 3 ms 620 KB Output is correct
3 Correct 3 ms 620 KB Output is correct
4 Correct 3 ms 620 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 4 ms 668 KB Output is correct
8 Correct 3 ms 620 KB Output is correct
9 Correct 3 ms 620 KB Output is correct
10 Correct 3 ms 620 KB Output is correct
11 Correct 3 ms 620 KB Output is correct
12 Correct 3 ms 620 KB Output is correct
13 Correct 2 ms 620 KB Output is correct
14 Correct 2 ms 748 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 3 ms 748 KB Output is correct
17 Correct 3 ms 620 KB Output is correct
18 Correct 4 ms 620 KB Output is correct
19 Correct 3 ms 620 KB Output is correct
20 Correct 3 ms 748 KB Output is correct
21 Correct 4 ms 620 KB Output is correct
22 Correct 4 ms 748 KB Output is correct
23 Correct 3 ms 620 KB Output is correct
24 Correct 3 ms 748 KB Output is correct
25 Correct 2 ms 620 KB Output is correct
26 Correct 3 ms 620 KB Output is correct
27 Correct 3 ms 748 KB Output is correct
28 Correct 3 ms 748 KB Output is correct
29 Correct 3 ms 672 KB Output is correct
30 Correct 4 ms 672 KB Output is correct
31 Correct 4 ms 748 KB Output is correct
32 Correct 3 ms 748 KB Output is correct
33 Correct 3 ms 748 KB Output is correct
34 Correct 3 ms 748 KB Output is correct
35 Correct 3 ms 748 KB Output is correct
36 Correct 3 ms 788 KB Output is correct
37 Correct 3 ms 620 KB Output is correct
38 Correct 3 ms 748 KB Output is correct
39 Correct 93 ms 10564 KB Output is correct
40 Correct 100 ms 10892 KB Output is correct
41 Correct 95 ms 10660 KB Output is correct
42 Correct 93 ms 10604 KB Output is correct
43 Correct 97 ms 10860 KB Output is correct
44 Correct 112 ms 10880 KB Output is correct
45 Correct 44 ms 8020 KB Output is correct
46 Correct 53 ms 7980 KB Output is correct
47 Correct 95 ms 10860 KB Output is correct
48 Correct 112 ms 10860 KB Output is correct
49 Correct 102 ms 10804 KB Output is correct
50 Correct 104 ms 10900 KB Output is correct
51 Correct 81 ms 9900 KB Output is correct
52 Correct 94 ms 10804 KB Output is correct
53 Correct 111 ms 10604 KB Output is correct
54 Correct 119 ms 11108 KB Output is correct
55 Correct 79 ms 10092 KB Output is correct
56 Correct 80 ms 9876 KB Output is correct
57 Correct 40 ms 7764 KB Output is correct
58 Correct 49 ms 8076 KB Output is correct
59 Correct 102 ms 10860 KB Output is correct
60 Correct 97 ms 10988 KB Output is correct
61 Correct 100 ms 10988 KB Output is correct
62 Correct 96 ms 10988 KB Output is correct
63 Correct 99 ms 10860 KB Output is correct
64 Correct 97 ms 10988 KB Output is correct
65 Correct 60 ms 9880 KB Output is correct
66 Correct 79 ms 11372 KB Output is correct
67 Correct 67 ms 9196 KB Output is correct
68 Correct 80 ms 10240 KB Output is correct
69 Correct 97 ms 10988 KB Output is correct
70 Correct 98 ms 10988 KB Output is correct
71 Correct 75 ms 9836 KB Output is correct
72 Correct 96 ms 10988 KB Output is correct
73 Correct 88 ms 9708 KB Output is correct
74 Correct 90 ms 10220 KB Output is correct
75 Correct 93 ms 10476 KB Output is correct
76 Correct 65 ms 9068 KB Output is correct
77 Correct 81 ms 9708 KB Output is correct
78 Correct 100 ms 10348 KB Output is correct
79 Correct 48 ms 7712 KB Output is correct
80 Correct 48 ms 7696 KB Output is correct
81 Correct 65 ms 9692 KB Output is correct
82 Correct 59 ms 9324 KB Output is correct
83 Correct 81 ms 9708 KB Output is correct
84 Correct 84 ms 9836 KB Output is correct
85 Correct 87 ms 9580 KB Output is correct
86 Correct 106 ms 10220 KB Output is correct
87 Correct 87 ms 9708 KB Output is correct
88 Correct 99 ms 10348 KB Output is correct
89 Correct 67 ms 8556 KB Output is correct
90 Correct 100 ms 10476 KB Output is correct
91 Correct 79 ms 9196 KB Output is correct
92 Correct 82 ms 8940 KB Output is correct
93 Correct 102 ms 10348 KB Output is correct
94 Correct 105 ms 10476 KB Output is correct
95 Correct 95 ms 10220 KB Output is correct
96 Correct 100 ms 10348 KB Output is correct
97 Correct 99 ms 10348 KB Output is correct
98 Correct 88 ms 9376 KB Output is correct
99 Correct 62 ms 9300 KB Output is correct
100 Correct 70 ms 9452 KB Output is correct
101 Correct 86 ms 10860 KB Output is correct
102 Correct 94 ms 10732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 620 KB Output is correct
2 Correct 3 ms 620 KB Output is correct
3 Correct 3 ms 620 KB Output is correct
4 Correct 3 ms 620 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 4 ms 668 KB Output is correct
8 Correct 3 ms 620 KB Output is correct
9 Correct 3 ms 620 KB Output is correct
10 Correct 3 ms 620 KB Output is correct
11 Correct 3 ms 620 KB Output is correct
12 Correct 3 ms 620 KB Output is correct
13 Correct 2 ms 620 KB Output is correct
14 Correct 2 ms 748 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 3 ms 748 KB Output is correct
17 Correct 3 ms 620 KB Output is correct
18 Correct 4 ms 620 KB Output is correct
19 Correct 3 ms 620 KB Output is correct
20 Correct 3 ms 748 KB Output is correct
21 Correct 4 ms 620 KB Output is correct
22 Correct 4 ms 748 KB Output is correct
23 Correct 3 ms 620 KB Output is correct
24 Correct 3 ms 748 KB Output is correct
25 Correct 2 ms 620 KB Output is correct
26 Correct 3 ms 620 KB Output is correct
27 Correct 3 ms 748 KB Output is correct
28 Correct 3 ms 748 KB Output is correct
29 Correct 3 ms 672 KB Output is correct
30 Correct 4 ms 672 KB Output is correct
31 Correct 4 ms 748 KB Output is correct
32 Correct 3 ms 748 KB Output is correct
33 Correct 3 ms 748 KB Output is correct
34 Correct 3 ms 748 KB Output is correct
35 Correct 3 ms 748 KB Output is correct
36 Correct 3 ms 788 KB Output is correct
37 Correct 3 ms 620 KB Output is correct
38 Correct 3 ms 748 KB Output is correct
39 Correct 93 ms 10564 KB Output is correct
40 Correct 100 ms 10892 KB Output is correct
41 Correct 95 ms 10660 KB Output is correct
42 Correct 93 ms 10604 KB Output is correct
43 Correct 97 ms 10860 KB Output is correct
44 Correct 112 ms 10880 KB Output is correct
45 Correct 44 ms 8020 KB Output is correct
46 Correct 53 ms 7980 KB Output is correct
47 Correct 95 ms 10860 KB Output is correct
48 Correct 112 ms 10860 KB Output is correct
49 Correct 102 ms 10804 KB Output is correct
50 Correct 104 ms 10900 KB Output is correct
51 Correct 81 ms 9900 KB Output is correct
52 Correct 94 ms 10804 KB Output is correct
53 Correct 111 ms 10604 KB Output is correct
54 Correct 119 ms 11108 KB Output is correct
55 Correct 473 ms 37144 KB Output is correct
56 Correct 360 ms 33512 KB Output is correct
57 Correct 516 ms 39020 KB Output is correct
58 Correct 384 ms 34656 KB Output is correct
59 Correct 366 ms 33900 KB Output is correct
60 Correct 524 ms 40428 KB Output is correct
61 Correct 199 ms 29304 KB Output is correct
62 Correct 217 ms 29232 KB Output is correct
63 Correct 479 ms 38124 KB Output is correct
64 Correct 472 ms 38124 KB Output is correct
65 Correct 520 ms 40300 KB Output is correct
66 Correct 515 ms 40300 KB Output is correct
67 Correct 499 ms 40300 KB Output is correct
68 Correct 525 ms 40300 KB Output is correct
69 Correct 518 ms 40204 KB Output is correct
70 Correct 521 ms 40300 KB Output is correct
71 Correct 514 ms 40172 KB Output is correct
72 Correct 531 ms 40312 KB Output is correct
73 Correct 528 ms 40100 KB Output is correct
74 Correct 521 ms 40172 KB Output is correct
75 Correct 523 ms 40172 KB Output is correct
76 Correct 518 ms 40084 KB Output is correct
77 Correct 523 ms 40300 KB Output is correct
78 Correct 517 ms 40172 KB Output is correct
79 Correct 411 ms 39532 KB Output is correct
80 Correct 411 ms 41452 KB Output is correct
81 Correct 452 ms 41472 KB Output is correct
82 Correct 79 ms 10092 KB Output is correct
83 Correct 80 ms 9876 KB Output is correct
84 Correct 40 ms 7764 KB Output is correct
85 Correct 49 ms 8076 KB Output is correct
86 Correct 102 ms 10860 KB Output is correct
87 Correct 97 ms 10988 KB Output is correct
88 Correct 100 ms 10988 KB Output is correct
89 Correct 96 ms 10988 KB Output is correct
90 Correct 99 ms 10860 KB Output is correct
91 Correct 97 ms 10988 KB Output is correct
92 Correct 60 ms 9880 KB Output is correct
93 Correct 79 ms 11372 KB Output is correct
94 Correct 67 ms 9196 KB Output is correct
95 Correct 80 ms 10240 KB Output is correct
96 Correct 97 ms 10988 KB Output is correct
97 Correct 98 ms 10988 KB Output is correct
98 Correct 75 ms 9836 KB Output is correct
99 Correct 96 ms 10988 KB Output is correct
100 Correct 88 ms 9708 KB Output is correct
101 Correct 90 ms 10220 KB Output is correct
102 Correct 93 ms 10476 KB Output is correct
103 Correct 65 ms 9068 KB Output is correct
104 Correct 81 ms 9708 KB Output is correct
105 Correct 100 ms 10348 KB Output is correct
106 Correct 48 ms 7712 KB Output is correct
107 Correct 48 ms 7696 KB Output is correct
108 Correct 65 ms 9692 KB Output is correct
109 Correct 59 ms 9324 KB Output is correct
110 Correct 81 ms 9708 KB Output is correct
111 Correct 84 ms 9836 KB Output is correct
112 Correct 87 ms 9580 KB Output is correct
113 Correct 106 ms 10220 KB Output is correct
114 Correct 87 ms 9708 KB Output is correct
115 Correct 99 ms 10348 KB Output is correct
116 Correct 67 ms 8556 KB Output is correct
117 Correct 100 ms 10476 KB Output is correct
118 Correct 79 ms 9196 KB Output is correct
119 Correct 82 ms 8940 KB Output is correct
120 Correct 102 ms 10348 KB Output is correct
121 Correct 105 ms 10476 KB Output is correct
122 Correct 95 ms 10220 KB Output is correct
123 Correct 100 ms 10348 KB Output is correct
124 Correct 99 ms 10348 KB Output is correct
125 Correct 88 ms 9376 KB Output is correct
126 Correct 62 ms 9300 KB Output is correct
127 Correct 70 ms 9452 KB Output is correct
128 Correct 86 ms 10860 KB Output is correct
129 Correct 94 ms 10732 KB Output is correct
130 Correct 508 ms 39024 KB Output is correct
131 Correct 358 ms 33388 KB Output is correct
132 Correct 498 ms 39276 KB Output is correct
133 Correct 510 ms 38892 KB Output is correct
134 Correct 448 ms 37100 KB Output is correct
135 Correct 536 ms 39860 KB Output is correct
136 Correct 484 ms 38124 KB Output is correct
137 Correct 470 ms 38196 KB Output is correct
138 Correct 543 ms 40044 KB Output is correct
139 Correct 518 ms 40044 KB Output is correct
140 Correct 509 ms 40044 KB Output is correct
141 Correct 564 ms 40220 KB Output is correct
142 Correct 539 ms 40044 KB Output is correct
143 Correct 524 ms 40172 KB Output is correct
144 Correct 516 ms 40364 KB Output is correct
145 Correct 524 ms 40300 KB Output is correct
146 Correct 520 ms 40300 KB Output is correct
147 Correct 566 ms 40296 KB Output is correct
148 Correct 532 ms 40300 KB Output is correct
149 Correct 518 ms 40300 KB Output is correct
150 Correct 273 ms 36152 KB Output is correct
151 Correct 419 ms 42092 KB Output is correct
152 Correct 420 ms 42220 KB Output is correct
153 Correct 452 ms 41580 KB Output is correct