답안 #730437

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
730437 2023-04-25T21:40:23 Z MilosMilutinovic Diversity (CEOI21_diversity) C++14
100 / 100
5269 ms 10548 KB
/**
 *    author:  wxhtzdy
 *    created: 25.04.2023 21:06:35
**/
#include <bits/stdc++.h>

using namespace std;

int readint() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  return x;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);  
  int n = readint();
  int q = readint();
  //cin >> n >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    //cin >> a[i];
    a[i] = readint();
  }
  vector<int> l(q), r(q);
  for (int i = 0; i < q; i++) {
    //cin >> l[i] >> r[i];
    l[i] = readint();
    r[i] = readint();
    --l[i]; --r[i];
  }
  const int BLOCK = 542;
  vector<int> order(q);
  iota(order.begin(), order.end(), 0);
  sort(order.begin(), order.end(), [&](int i, int j) {
    if (l[i] / BLOCK != l[j] / BLOCK) {
      return l[i] < l[j];
    } else {
      return r[i] < r[j];
    }
  });
  const int MAX = 3.0001e5;
  vector<int> cnt(MAX);
  vector<int> f(MAX);
  vector<int> b;
  vector<bool> was(MAX);
  function<void(int)> Add = [&](int x) {
    f[cnt[x]]--;
    cnt[x]++;
    f[cnt[x]]++;
    if (f[cnt[x]] > 0) {
      b.push_back(cnt[x]);
    }
  };
  function<void(int)> Remove = [&](int x) {
    f[cnt[x]]--;
    cnt[x]--;
    f[cnt[x]]++;
    if (cnt[x] > 0) {
      b.push_back(cnt[x]);
    }
  };
  auto Solve = [&](int p, int len, int c, int n) {
    long long res = 0;
    // p ^ 2 - p + (p + len) ^ 2 - (p - len) + ... + (p + (c - 1) * len) ^ 2 - (p + (c - 1) * len)
    // - p - (p - len) - (p + (c - 1) * len) 

    res += c * 1LL * p * p;
    res += 2 * ((c - 1) * 1LL * c / 2) * len * p;
    res += ((c - 1) * 1LL * c * (2 * (c - 1) + 1) / 6) * len * len; 
    res -= c * 1LL * p;
    res -= ((c - 1) * 1LL * c / 2) * len;
    
    n = n - p + 1;
    c++;
    // (n - c * len) ^ 2 + (n - c * len) + ... + (n - len) ^ 2 + (n - len) + n ^ 2 + n
    res += c * 1LL * n * n;
    res -= 2 * ((c - 1) * 1LL * c / 2) * len * n;
    res += ((c - 1) * 1LL * c * (2 * (c - 1) + 1) / 6) * len * len;
    res += n * 1LL * c;
    res -= ((c - 1) * 1LL * c / 2) * len;
    res -= (n * 1LL * n + n);

    return res / 2;
  };
  int L = 0, R = -1;
  vector<long long> ans(q);
  for (int i : order) {
    while (L < l[i]) {
      Remove(a[L++]);
    }
    while (L > l[i]) {
      Add(a[--L]);
    }
    while (R < r[i]) {
      Add(a[++R]);
    }
    while (R > r[i]) {
      Remove(a[R--]);
    }
    vector<int> new_b;
    int s = 0;
    for (int x : b) {
      if (x > 0 && !was[x] && f[x] > 0) {
        s += f[x];
        new_b.push_back(x); 
        was[x] = true;
      }
    }
    for (int x : b) {
      if (x > 0 && f[x] > 0) {
        was[x] = false;  
      }
    }
    swap(new_b, b);
    sort(b.begin(), b.end());
    ans[i] = s * 1LL * (r[i] - l[i] + 1) * 1LL * (r[i] - l[i] + 2) / 2;
    int curl = l[i], curr = r[i];
    bool fl = false;
    for (int j = 0; j < (int) b.size(); j++) {
      int x = f[b[j]] / 2;
      int y = x;
      if (f[b[j]] & 1) {
        if (!fl) {
          x += 1;            
        } else { 
          y += 1;
        }
        fl = !fl;
      }
      ans[i] -= Solve(curl - l[i] + 1, b[j], x, r[i] - l[i] + 1);
      ans[i] -= Solve(r[i] - curr + 1, b[j], y, r[i] - l[i] + 1);
      curl += x * b[j];
      curr -= y * b[j];
    }
  } 
  for (int i = 0; i < q; i++) {
    //cout << ans[i] << '\n';
    printf("%lld\n", ans[i]);
  }
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 1 ms 2644 KB Output is correct
3 Correct 1 ms 2644 KB Output is correct
4 Correct 1 ms 2644 KB Output is correct
5 Correct 1 ms 2644 KB Output is correct
6 Correct 1 ms 2644 KB Output is correct
7 Correct 1 ms 2644 KB Output is correct
8 Correct 2 ms 2644 KB Output is correct
9 Correct 1 ms 2644 KB Output is correct
10 Correct 1 ms 2644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 1 ms 2644 KB Output is correct
3 Correct 3 ms 2772 KB Output is correct
4 Correct 4 ms 3664 KB Output is correct
5 Correct 9 ms 4556 KB Output is correct
6 Correct 12 ms 6056 KB Output is correct
7 Correct 11 ms 5980 KB Output is correct
8 Correct 11 ms 5960 KB Output is correct
9 Correct 12 ms 5960 KB Output is correct
10 Correct 11 ms 5960 KB Output is correct
11 Correct 13 ms 6068 KB Output is correct
12 Correct 13 ms 5960 KB Output is correct
13 Correct 12 ms 6028 KB Output is correct
14 Correct 11 ms 5960 KB Output is correct
15 Correct 12 ms 6028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 1 ms 2644 KB Output is correct
3 Correct 3 ms 2772 KB Output is correct
4 Correct 4 ms 3664 KB Output is correct
5 Correct 9 ms 4556 KB Output is correct
6 Correct 12 ms 6056 KB Output is correct
7 Correct 11 ms 5980 KB Output is correct
8 Correct 11 ms 5960 KB Output is correct
9 Correct 12 ms 5960 KB Output is correct
10 Correct 11 ms 5960 KB Output is correct
11 Correct 13 ms 6068 KB Output is correct
12 Correct 13 ms 5960 KB Output is correct
13 Correct 12 ms 6028 KB Output is correct
14 Correct 11 ms 5960 KB Output is correct
15 Correct 12 ms 6028 KB Output is correct
16 Correct 1 ms 2644 KB Output is correct
17 Correct 1 ms 2676 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 5 ms 3664 KB Output is correct
20 Correct 9 ms 4556 KB Output is correct
21 Correct 12 ms 6052 KB Output is correct
22 Correct 12 ms 5960 KB Output is correct
23 Correct 17 ms 5972 KB Output is correct
24 Correct 14 ms 6088 KB Output is correct
25 Correct 13 ms 5968 KB Output is correct
26 Correct 14 ms 5976 KB Output is correct
27 Correct 14 ms 5960 KB Output is correct
28 Correct 13 ms 5992 KB Output is correct
29 Correct 13 ms 6032 KB Output is correct
30 Correct 12 ms 5972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 1 ms 2644 KB Output is correct
3 Correct 3 ms 2772 KB Output is correct
4 Correct 4 ms 3664 KB Output is correct
5 Correct 9 ms 4556 KB Output is correct
6 Correct 12 ms 6056 KB Output is correct
7 Correct 11 ms 5980 KB Output is correct
8 Correct 11 ms 5960 KB Output is correct
9 Correct 12 ms 5960 KB Output is correct
10 Correct 11 ms 5960 KB Output is correct
11 Correct 13 ms 6068 KB Output is correct
12 Correct 13 ms 5960 KB Output is correct
13 Correct 12 ms 6028 KB Output is correct
14 Correct 11 ms 5960 KB Output is correct
15 Correct 12 ms 6028 KB Output is correct
16 Correct 1 ms 2644 KB Output is correct
17 Correct 1 ms 2676 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 5 ms 3664 KB Output is correct
20 Correct 9 ms 4556 KB Output is correct
21 Correct 12 ms 6052 KB Output is correct
22 Correct 12 ms 5960 KB Output is correct
23 Correct 17 ms 5972 KB Output is correct
24 Correct 14 ms 6088 KB Output is correct
25 Correct 13 ms 5968 KB Output is correct
26 Correct 14 ms 5976 KB Output is correct
27 Correct 14 ms 5960 KB Output is correct
28 Correct 13 ms 5992 KB Output is correct
29 Correct 13 ms 6032 KB Output is correct
30 Correct 12 ms 5972 KB Output is correct
31 Correct 1 ms 2644 KB Output is correct
32 Correct 1 ms 2644 KB Output is correct
33 Correct 1 ms 2644 KB Output is correct
34 Correct 3 ms 2772 KB Output is correct
35 Correct 2 ms 2772 KB Output is correct
36 Correct 2 ms 2772 KB Output is correct
37 Correct 4 ms 3284 KB Output is correct
38 Correct 4 ms 3284 KB Output is correct
39 Correct 6 ms 3664 KB Output is correct
40 Correct 12 ms 4568 KB Output is correct
41 Correct 17 ms 6008 KB Output is correct
42 Correct 17 ms 5976 KB Output is correct
43 Correct 17 ms 5976 KB Output is correct
44 Correct 16 ms 6076 KB Output is correct
45 Correct 15 ms 5960 KB Output is correct
46 Correct 16 ms 6068 KB Output is correct
47 Correct 16 ms 5976 KB Output is correct
48 Correct 17 ms 5960 KB Output is correct
49 Correct 18 ms 5960 KB Output is correct
50 Correct 16 ms 5976 KB Output is correct
51 Correct 16 ms 6056 KB Output is correct
52 Correct 16 ms 6044 KB Output is correct
53 Correct 15 ms 5976 KB Output is correct
54 Correct 15 ms 5992 KB Output is correct
55 Correct 15 ms 6036 KB Output is correct
56 Correct 15 ms 5960 KB Output is correct
57 Correct 15 ms 5960 KB Output is correct
58 Correct 15 ms 6088 KB Output is correct
59 Correct 15 ms 5976 KB Output is correct
60 Correct 15 ms 5960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 1 ms 2644 KB Output is correct
3 Correct 1 ms 2644 KB Output is correct
4 Correct 1 ms 2644 KB Output is correct
5 Correct 1 ms 2644 KB Output is correct
6 Correct 1 ms 2644 KB Output is correct
7 Correct 1 ms 2644 KB Output is correct
8 Correct 2 ms 2644 KB Output is correct
9 Correct 1 ms 2644 KB Output is correct
10 Correct 1 ms 2644 KB Output is correct
11 Correct 2 ms 2644 KB Output is correct
12 Correct 1 ms 2644 KB Output is correct
13 Correct 3 ms 2772 KB Output is correct
14 Correct 4 ms 3664 KB Output is correct
15 Correct 9 ms 4556 KB Output is correct
16 Correct 12 ms 6056 KB Output is correct
17 Correct 11 ms 5980 KB Output is correct
18 Correct 11 ms 5960 KB Output is correct
19 Correct 12 ms 5960 KB Output is correct
20 Correct 11 ms 5960 KB Output is correct
21 Correct 13 ms 6068 KB Output is correct
22 Correct 13 ms 5960 KB Output is correct
23 Correct 12 ms 6028 KB Output is correct
24 Correct 11 ms 5960 KB Output is correct
25 Correct 12 ms 6028 KB Output is correct
26 Correct 1 ms 2644 KB Output is correct
27 Correct 1 ms 2676 KB Output is correct
28 Correct 2 ms 2772 KB Output is correct
29 Correct 5 ms 3664 KB Output is correct
30 Correct 9 ms 4556 KB Output is correct
31 Correct 12 ms 6052 KB Output is correct
32 Correct 12 ms 5960 KB Output is correct
33 Correct 17 ms 5972 KB Output is correct
34 Correct 14 ms 6088 KB Output is correct
35 Correct 13 ms 5968 KB Output is correct
36 Correct 14 ms 5976 KB Output is correct
37 Correct 14 ms 5960 KB Output is correct
38 Correct 13 ms 5992 KB Output is correct
39 Correct 13 ms 6032 KB Output is correct
40 Correct 12 ms 5972 KB Output is correct
41 Correct 1 ms 2644 KB Output is correct
42 Correct 1 ms 2644 KB Output is correct
43 Correct 1 ms 2644 KB Output is correct
44 Correct 3 ms 2772 KB Output is correct
45 Correct 2 ms 2772 KB Output is correct
46 Correct 2 ms 2772 KB Output is correct
47 Correct 4 ms 3284 KB Output is correct
48 Correct 4 ms 3284 KB Output is correct
49 Correct 6 ms 3664 KB Output is correct
50 Correct 12 ms 4568 KB Output is correct
51 Correct 17 ms 6008 KB Output is correct
52 Correct 17 ms 5976 KB Output is correct
53 Correct 17 ms 5976 KB Output is correct
54 Correct 16 ms 6076 KB Output is correct
55 Correct 15 ms 5960 KB Output is correct
56 Correct 16 ms 6068 KB Output is correct
57 Correct 16 ms 5976 KB Output is correct
58 Correct 17 ms 5960 KB Output is correct
59 Correct 18 ms 5960 KB Output is correct
60 Correct 16 ms 5976 KB Output is correct
61 Correct 16 ms 6056 KB Output is correct
62 Correct 16 ms 6044 KB Output is correct
63 Correct 15 ms 5976 KB Output is correct
64 Correct 15 ms 5992 KB Output is correct
65 Correct 15 ms 6036 KB Output is correct
66 Correct 15 ms 5960 KB Output is correct
67 Correct 15 ms 5960 KB Output is correct
68 Correct 15 ms 6088 KB Output is correct
69 Correct 15 ms 5976 KB Output is correct
70 Correct 15 ms 5960 KB Output is correct
71 Correct 4 ms 3284 KB Output is correct
72 Correct 4 ms 3284 KB Output is correct
73 Correct 4 ms 3284 KB Output is correct
74 Correct 4 ms 3284 KB Output is correct
75 Correct 4 ms 3284 KB Output is correct
76 Correct 5 ms 3664 KB Output is correct
77 Correct 6 ms 3688 KB Output is correct
78 Correct 6 ms 3664 KB Output is correct
79 Correct 6 ms 3676 KB Output is correct
80 Correct 6 ms 3664 KB Output is correct
81 Correct 11 ms 4556 KB Output is correct
82 Correct 10 ms 4556 KB Output is correct
83 Correct 10 ms 4556 KB Output is correct
84 Correct 10 ms 4556 KB Output is correct
85 Correct 10 ms 4556 KB Output is correct
86 Correct 12 ms 4560 KB Output is correct
87 Correct 12 ms 4564 KB Output is correct
88 Correct 12 ms 4564 KB Output is correct
89 Correct 13 ms 4652 KB Output is correct
90 Correct 11 ms 4708 KB Output is correct
91 Correct 18 ms 5960 KB Output is correct
92 Correct 18 ms 5952 KB Output is correct
93 Correct 18 ms 5960 KB Output is correct
94 Correct 18 ms 6068 KB Output is correct
95 Correct 17 ms 6040 KB Output is correct
96 Correct 22 ms 5960 KB Output is correct
97 Correct 21 ms 5976 KB Output is correct
98 Correct 20 ms 5972 KB Output is correct
99 Correct 22 ms 5972 KB Output is correct
100 Correct 20 ms 6000 KB Output is correct
101 Correct 21 ms 6016 KB Output is correct
102 Correct 20 ms 6076 KB Output is correct
103 Correct 20 ms 5972 KB Output is correct
104 Correct 20 ms 5952 KB Output is correct
105 Correct 20 ms 6068 KB Output is correct
106 Correct 21 ms 6044 KB Output is correct
107 Correct 21 ms 5972 KB Output is correct
108 Correct 24 ms 5980 KB Output is correct
109 Correct 22 ms 5960 KB Output is correct
110 Correct 23 ms 5960 KB Output is correct
111 Correct 20 ms 5960 KB Output is correct
112 Correct 20 ms 6032 KB Output is correct
113 Correct 21 ms 6012 KB Output is correct
114 Correct 22 ms 6028 KB Output is correct
115 Correct 21 ms 6024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 1 ms 2644 KB Output is correct
3 Correct 1 ms 2644 KB Output is correct
4 Correct 1 ms 2644 KB Output is correct
5 Correct 1 ms 2644 KB Output is correct
6 Correct 1 ms 2644 KB Output is correct
7 Correct 1 ms 2644 KB Output is correct
8 Correct 2 ms 2644 KB Output is correct
9 Correct 1 ms 2644 KB Output is correct
10 Correct 1 ms 2644 KB Output is correct
11 Correct 2 ms 2644 KB Output is correct
12 Correct 1 ms 2644 KB Output is correct
13 Correct 3 ms 2772 KB Output is correct
14 Correct 4 ms 3664 KB Output is correct
15 Correct 9 ms 4556 KB Output is correct
16 Correct 12 ms 6056 KB Output is correct
17 Correct 11 ms 5980 KB Output is correct
18 Correct 11 ms 5960 KB Output is correct
19 Correct 12 ms 5960 KB Output is correct
20 Correct 11 ms 5960 KB Output is correct
21 Correct 13 ms 6068 KB Output is correct
22 Correct 13 ms 5960 KB Output is correct
23 Correct 12 ms 6028 KB Output is correct
24 Correct 11 ms 5960 KB Output is correct
25 Correct 12 ms 6028 KB Output is correct
26 Correct 1 ms 2644 KB Output is correct
27 Correct 1 ms 2676 KB Output is correct
28 Correct 2 ms 2772 KB Output is correct
29 Correct 5 ms 3664 KB Output is correct
30 Correct 9 ms 4556 KB Output is correct
31 Correct 12 ms 6052 KB Output is correct
32 Correct 12 ms 5960 KB Output is correct
33 Correct 17 ms 5972 KB Output is correct
34 Correct 14 ms 6088 KB Output is correct
35 Correct 13 ms 5968 KB Output is correct
36 Correct 14 ms 5976 KB Output is correct
37 Correct 14 ms 5960 KB Output is correct
38 Correct 13 ms 5992 KB Output is correct
39 Correct 13 ms 6032 KB Output is correct
40 Correct 12 ms 5972 KB Output is correct
41 Correct 1 ms 2644 KB Output is correct
42 Correct 1 ms 2644 KB Output is correct
43 Correct 1 ms 2644 KB Output is correct
44 Correct 3 ms 2772 KB Output is correct
45 Correct 2 ms 2772 KB Output is correct
46 Correct 2 ms 2772 KB Output is correct
47 Correct 4 ms 3284 KB Output is correct
48 Correct 4 ms 3284 KB Output is correct
49 Correct 6 ms 3664 KB Output is correct
50 Correct 12 ms 4568 KB Output is correct
51 Correct 17 ms 6008 KB Output is correct
52 Correct 17 ms 5976 KB Output is correct
53 Correct 17 ms 5976 KB Output is correct
54 Correct 16 ms 6076 KB Output is correct
55 Correct 15 ms 5960 KB Output is correct
56 Correct 16 ms 6068 KB Output is correct
57 Correct 16 ms 5976 KB Output is correct
58 Correct 17 ms 5960 KB Output is correct
59 Correct 18 ms 5960 KB Output is correct
60 Correct 16 ms 5976 KB Output is correct
61 Correct 16 ms 6056 KB Output is correct
62 Correct 16 ms 6044 KB Output is correct
63 Correct 15 ms 5976 KB Output is correct
64 Correct 15 ms 5992 KB Output is correct
65 Correct 15 ms 6036 KB Output is correct
66 Correct 15 ms 5960 KB Output is correct
67 Correct 15 ms 5960 KB Output is correct
68 Correct 15 ms 6088 KB Output is correct
69 Correct 15 ms 5976 KB Output is correct
70 Correct 15 ms 5960 KB Output is correct
71 Correct 4 ms 3284 KB Output is correct
72 Correct 4 ms 3284 KB Output is correct
73 Correct 4 ms 3284 KB Output is correct
74 Correct 4 ms 3284 KB Output is correct
75 Correct 4 ms 3284 KB Output is correct
76 Correct 5 ms 3664 KB Output is correct
77 Correct 6 ms 3688 KB Output is correct
78 Correct 6 ms 3664 KB Output is correct
79 Correct 6 ms 3676 KB Output is correct
80 Correct 6 ms 3664 KB Output is correct
81 Correct 11 ms 4556 KB Output is correct
82 Correct 10 ms 4556 KB Output is correct
83 Correct 10 ms 4556 KB Output is correct
84 Correct 10 ms 4556 KB Output is correct
85 Correct 10 ms 4556 KB Output is correct
86 Correct 12 ms 4560 KB Output is correct
87 Correct 12 ms 4564 KB Output is correct
88 Correct 12 ms 4564 KB Output is correct
89 Correct 13 ms 4652 KB Output is correct
90 Correct 11 ms 4708 KB Output is correct
91 Correct 18 ms 5960 KB Output is correct
92 Correct 18 ms 5952 KB Output is correct
93 Correct 18 ms 5960 KB Output is correct
94 Correct 18 ms 6068 KB Output is correct
95 Correct 17 ms 6040 KB Output is correct
96 Correct 22 ms 5960 KB Output is correct
97 Correct 21 ms 5976 KB Output is correct
98 Correct 20 ms 5972 KB Output is correct
99 Correct 22 ms 5972 KB Output is correct
100 Correct 20 ms 6000 KB Output is correct
101 Correct 21 ms 6016 KB Output is correct
102 Correct 20 ms 6076 KB Output is correct
103 Correct 20 ms 5972 KB Output is correct
104 Correct 20 ms 5952 KB Output is correct
105 Correct 20 ms 6068 KB Output is correct
106 Correct 21 ms 6044 KB Output is correct
107 Correct 21 ms 5972 KB Output is correct
108 Correct 24 ms 5980 KB Output is correct
109 Correct 22 ms 5960 KB Output is correct
110 Correct 23 ms 5960 KB Output is correct
111 Correct 20 ms 5960 KB Output is correct
112 Correct 20 ms 6032 KB Output is correct
113 Correct 21 ms 6012 KB Output is correct
114 Correct 22 ms 6028 KB Output is correct
115 Correct 21 ms 6024 KB Output is correct
116 Correct 379 ms 4248 KB Output is correct
117 Correct 397 ms 4236 KB Output is correct
118 Correct 597 ms 4640 KB Output is correct
119 Correct 595 ms 4760 KB Output is correct
120 Correct 483 ms 4816 KB Output is correct
121 Correct 956 ms 5176 KB Output is correct
122 Correct 809 ms 5200 KB Output is correct
123 Correct 2416 ms 6272 KB Output is correct
124 Correct 2056 ms 6360 KB Output is correct
125 Correct 2073 ms 6236 KB Output is correct
126 Correct 4640 ms 8080 KB Output is correct
127 Correct 4630 ms 8200 KB Output is correct
128 Correct 4587 ms 8156 KB Output is correct
129 Correct 4706 ms 8084 KB Output is correct
130 Correct 4562 ms 8180 KB Output is correct
131 Correct 4947 ms 8220 KB Output is correct
132 Correct 4826 ms 9844 KB Output is correct
133 Correct 4868 ms 9836 KB Output is correct
134 Correct 4941 ms 9868 KB Output is correct
135 Correct 4915 ms 9932 KB Output is correct
136 Correct 4951 ms 9880 KB Output is correct
137 Correct 4877 ms 9848 KB Output is correct
138 Correct 4890 ms 9868 KB Output is correct
139 Correct 4975 ms 9932 KB Output is correct
140 Correct 4920 ms 10024 KB Output is correct
141 Correct 4605 ms 9936 KB Output is correct
142 Correct 4706 ms 9996 KB Output is correct
143 Correct 4569 ms 9960 KB Output is correct
144 Correct 4583 ms 9948 KB Output is correct
145 Correct 4561 ms 9860 KB Output is correct
146 Correct 3923 ms 10104 KB Output is correct
147 Correct 3911 ms 10100 KB Output is correct
148 Correct 3921 ms 10196 KB Output is correct
149 Correct 3903 ms 10124 KB Output is correct
150 Correct 3954 ms 10148 KB Output is correct
151 Correct 4037 ms 10172 KB Output is correct
152 Correct 3995 ms 10132 KB Output is correct
153 Correct 4073 ms 10128 KB Output is correct
154 Correct 4035 ms 10296 KB Output is correct
155 Correct 4016 ms 10268 KB Output is correct
156 Correct 5261 ms 9216 KB Output is correct
157 Correct 5269 ms 9224 KB Output is correct
158 Correct 5245 ms 9388 KB Output is correct
159 Correct 5258 ms 9208 KB Output is correct
160 Correct 5267 ms 9212 KB Output is correct
161 Correct 4886 ms 10412 KB Output is correct
162 Correct 4879 ms 10428 KB Output is correct
163 Correct 4869 ms 10436 KB Output is correct
164 Correct 4849 ms 10416 KB Output is correct
165 Correct 4878 ms 10400 KB Output is correct
166 Correct 4805 ms 10300 KB Output is correct
167 Correct 4762 ms 10292 KB Output is correct
168 Correct 4787 ms 10340 KB Output is correct
169 Correct 4782 ms 10536 KB Output is correct
170 Correct 4787 ms 10512 KB Output is correct
171 Correct 4447 ms 10416 KB Output is correct
172 Correct 4478 ms 10404 KB Output is correct
173 Correct 4397 ms 10424 KB Output is correct
174 Correct 4432 ms 10516 KB Output is correct
175 Correct 4459 ms 10548 KB Output is correct