답안 #842612

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
842612 2023-09-03T06:14:47 Z flashmt 봉쇄 시간 (IOI23_closing) C++17
63 / 100
1000 ms 24400 KB
#include "closing.h"
#ifdef LOCAL
#include "Debug.h"
#else
#define debug(...) 42
#endif
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long oo = (1LL << 62) - 10;

int n;
vector<pair<int, int>> a[N];
vector<int> idPath, idTree;

vector<long long> bfs(int s)
{
  vector<long long> dist(n, -1);
  queue<int> q;
  dist[s] = 0;
  q.push(s);
  while (!empty(q))
  {
    int x = q.front();
    q.pop();
    for (auto [y, w] : a[x])
      if (dist[y] < 0)
      {
        dist[y] = dist[x] + w;
        q.push(y);
      }
  }
  return dist;
}

int isLinear()
{
  for (int i = 0; i + 1 < n; i++)
  {
    int isGood = 0;
    for (auto [j, _] : a[i])
      if (j == i + 1)
        isGood = 1;
    if (!isGood)
      return 0;
  }
  return 1;
}

int solveLinear(int n, int A, int B, long long budget, vector<long long> distA, vector<long long> distB)
{
  vector<long long> sumA(n), sumB(n), sumAB(n);
  for (int i = A; i <= B; i++)
  {
    sumA[i] = distA[i];
    sumAB[i] = max(distA[i], distB[i]);
    if (i)
    {
      sumA[i] += sumA[i - 1];
      sumAB[i] += sumAB[i - 1];
    }
  }
  for (int i = B - 1; i >= A; i--)
    sumB[i] = sumB[i + 1] + distB[i];

  vector<pair<long long, int>> ext;
  for (int i = 0; i < n; i++)
    if (i < A) ext.push_back({distA[i], i});
    else if (i > B) ext.push_back({distB[i], i});

  vector<long long> costFor(n, oo);
  costFor[0] = 0;
  sort(begin(ext), end(ext));
  for (int i = 0; i < size(ext); i++)
    costFor[i + 1] = costFor[i] + ext[i].first;

  int ans = 0, distAB = distA[B];
  for (int l = A; l <= B; l++)
    for (int r = A; r <= B; r++)
    {
      long long cost = 0;
      int curAns = l - A + 1 + B - r + 1;
      if (l < r) cost = sumA[l] + sumB[r];
      else
      {
        cost = sumAB[l];
        if (r)
        {
          cost -= sumAB[r - 1];
          cost += sumA[r - 1];
        }
        if (l + 1 < n)
          cost += sumB[l + 1];
      }

      if (cost > budget)
        continue;

      if (l < B && r > A)
      {
        int u = upper_bound(begin(costFor), end(costFor), budget - cost) - begin(costFor);
        curAns += u - 1;
      }
      else
      {
        long long rem = budget - cost;
        int both = 0;
        for (int i = 0; i < size(ext); i++)
        {
          auto [extCost, id] = ext[i];
          while (both && extCost > distAB)
          {
            rem -= distAB;
            if (rem < 0)
              break;
            curAns++;
            both--;
          }

          rem -= extCost;
          if (rem < 0)
            break;
          curAns++;
          if (id < A && r == A) both++;
          else if (id > B && l == B) both++;
        }

        if (rem >= 0)
          curAns += min(1LL * both, rem / distAB);
      }

      ans = max(ans, curAns);
    }

  return ans;
}

int findPath(int x, int goal, int par, vector<int> &path)
{
  path.push_back(x);
  if (x == goal)
    return 1;
  for (auto [y, _] : a[x])
    if (y != par)
    {
      if (findPath(y, goal, x, path))
        return 1;
    }
  path.pop_back();
  return 0;
}

void dfs(int x)
{
  for (auto [y, _] : a[x])
    if (idTree[y] < 0)
    {
      idTree[y] = idTree[x];
      dfs(y);
    }
}

int max_score(int N, int A, int B, long long budget, vector<int> U, vector<int> V, vector<int> W)
{
  n = N;
  for (int i = 0; i < n; i++)
    a[i].clear();
  for (int i = 0; i < size(U); i++)
  {
    a[U[i]].push_back({V[i], W[i]});
    a[V[i]].push_back({U[i], W[i]});
  }

  auto distA = bfs(A);
  auto distB = bfs(B);
  auto distAB = distA[B];

  if (distAB > budget * 2)
  {
    vector<long long> allDists = distA;
    for (auto d : distB)
      allDists.push_back(d);
    sort(begin(allDists), end(allDists));
    int ans = 0;
    for (auto d : allDists)
      if (d <= budget)
      {
        ans++;
        budget -= d;
      }
    return ans;
  }

  if (isLinear())
    return solveLinear(n, A, B, budget, distA, distB);

  // O(n^3)
  vector<int> path;
  findPath(A, B, -1, path);
  idPath.assign(n, -1);
  idTree.assign(n, -1);
  int len = size(path);
  for (int i = 0; i < len; i++)
    idPath[path[i]] = idTree[path[i]] = i;
  for (int x : path)
    dfs(x);

  int ans = 0;
  for (int l = 0; l < len; l++)
    for (int r = 0; r < len; r++)
    {
      long long curCost = 0;
      int curAns = 0;
      vector<pair<long long, long long>> options;
      for (int i = 0; i < n; i++)
      {
        if (idTree[i] > l && idTree[i] < r)
          continue;

        if (idTree[i] < r) // A
        {
          if (idPath[i] < 0) options.push_back({distA[i], oo});
          else curCost += distA[i], curAns++;
        }
        else if (idTree[i] > l) // B
        {
          if (idPath[i] < 0) options.push_back({distB[i], oo});
          else curCost += distB[i], curAns++;
        }
        else // AB
        {
          if (idPath[i] < 0)
          {
            auto minDist = min(distA[i], distB[i]), maxDist = max(distA[i], distB[i]);
            options.push_back({minDist, maxDist});
          }
          else curCost += max(distA[i], distB[i]), curAns += 2;
        }
      }

      if (curCost > budget)
        continue;

      long long rem = budget - curCost;
      int cnt = n * 2 - curAns;
      vector<long long> f(cnt + 1, oo);
      f[0] = 0;
      for (auto [x, y] : options)
      {
        for (int i = cnt; i; i--)
        {
          f[i] = min(f[i], f[i - 1] + x);
          if (i >= 2 && y < oo)
            f[i] = min(f[i], f[i - 2] + y);
        }
      }

      for (int i = 0; i <= cnt; i++)
        if (f[i] <= rem)
          ans = max(ans, curAns + i);
    }

  return ans;
}

Compilation message

closing.cpp: In function 'int solveLinear(int, int, int, long long int, std::vector<long long int>, std::vector<long long int>)':
closing.cpp:74:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |   for (int i = 0; i < size(ext); i++)
      |                   ~~^~~~~~~~~~~
closing.cpp:108:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  108 |         for (int i = 0; i < size(ext); i++)
      |                         ~~^~~~~~~~~~~
closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:168:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  168 |   for (int i = 0; i < size(U); i++)
      |                   ~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 103 ms 23380 KB Output is correct
2 Correct 106 ms 24400 KB Output is correct
3 Correct 64 ms 7608 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 1 ms 4956 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4956 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 1 ms 4956 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4956 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4952 KB Output is correct
14 Correct 1 ms 4956 KB Output is correct
15 Correct 1 ms 4956 KB Output is correct
16 Correct 1 ms 5152 KB Output is correct
17 Correct 1 ms 4956 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 2 ms 4956 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 3 ms 4956 KB Output is correct
22 Correct 1 ms 4956 KB Output is correct
23 Correct 2 ms 4956 KB Output is correct
24 Correct 2 ms 4956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 1 ms 4956 KB Output is correct
3 Correct 1 ms 4952 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4956 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4952 KB Output is correct
14 Correct 1 ms 4956 KB Output is correct
15 Correct 1 ms 4956 KB Output is correct
16 Correct 1 ms 5152 KB Output is correct
17 Correct 1 ms 4956 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 2 ms 4956 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 3 ms 4956 KB Output is correct
22 Correct 1 ms 4956 KB Output is correct
23 Correct 2 ms 4956 KB Output is correct
24 Correct 2 ms 4956 KB Output is correct
25 Correct 3 ms 4956 KB Output is correct
26 Correct 2 ms 5464 KB Output is correct
27 Correct 2 ms 5464 KB Output is correct
28 Correct 71 ms 5688 KB Output is correct
29 Correct 52 ms 5468 KB Output is correct
30 Correct 4 ms 5464 KB Output is correct
31 Correct 39 ms 5468 KB Output is correct
32 Correct 43 ms 5464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 1 ms 4956 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 2 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4956 KB Output is correct
14 Correct 1 ms 4956 KB Output is correct
15 Correct 2 ms 4956 KB Output is correct
16 Correct 1 ms 4956 KB Output is correct
17 Correct 1 ms 4952 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 5040 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 1 ms 4956 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 1 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 1 ms 4956 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4956 KB Output is correct
14 Correct 1 ms 4952 KB Output is correct
15 Correct 1 ms 4956 KB Output is correct
16 Correct 1 ms 4956 KB Output is correct
17 Correct 1 ms 5152 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4956 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 2 ms 4956 KB Output is correct
22 Correct 1 ms 4956 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 1 ms 4956 KB Output is correct
25 Correct 1 ms 4956 KB Output is correct
26 Correct 1 ms 4956 KB Output is correct
27 Correct 2 ms 4956 KB Output is correct
28 Correct 1 ms 4956 KB Output is correct
29 Correct 1 ms 4952 KB Output is correct
30 Correct 1 ms 4956 KB Output is correct
31 Correct 1 ms 5040 KB Output is correct
32 Correct 1 ms 4956 KB Output is correct
33 Correct 1 ms 4956 KB Output is correct
34 Correct 1 ms 4956 KB Output is correct
35 Correct 1 ms 4956 KB Output is correct
36 Correct 1 ms 4952 KB Output is correct
37 Correct 1 ms 4956 KB Output is correct
38 Correct 2 ms 4956 KB Output is correct
39 Correct 2 ms 4956 KB Output is correct
40 Correct 4 ms 5140 KB Output is correct
41 Correct 1 ms 4956 KB Output is correct
42 Correct 1 ms 4956 KB Output is correct
43 Correct 5 ms 4956 KB Output is correct
44 Correct 5 ms 4956 KB Output is correct
45 Correct 3 ms 5292 KB Output is correct
46 Correct 7 ms 4956 KB Output is correct
47 Correct 3 ms 4956 KB Output is correct
48 Correct 1 ms 4956 KB Output is correct
49 Correct 1 ms 4956 KB Output is correct
50 Correct 1 ms 4956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 1 ms 4956 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4956 KB Output is correct
14 Correct 1 ms 4952 KB Output is correct
15 Correct 1 ms 4956 KB Output is correct
16 Correct 1 ms 4956 KB Output is correct
17 Correct 1 ms 5152 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4956 KB Output is correct
20 Correct 2 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 3 ms 4956 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 2 ms 4956 KB Output is correct
25 Correct 2 ms 4956 KB Output is correct
26 Correct 1 ms 4956 KB Output is correct
27 Correct 1 ms 4956 KB Output is correct
28 Correct 2 ms 4956 KB Output is correct
29 Correct 1 ms 4956 KB Output is correct
30 Correct 1 ms 4956 KB Output is correct
31 Correct 1 ms 4956 KB Output is correct
32 Correct 1 ms 4956 KB Output is correct
33 Correct 1 ms 4956 KB Output is correct
34 Correct 2 ms 4956 KB Output is correct
35 Correct 1 ms 4956 KB Output is correct
36 Correct 1 ms 4952 KB Output is correct
37 Correct 1 ms 4956 KB Output is correct
38 Correct 1 ms 5040 KB Output is correct
39 Correct 1 ms 4956 KB Output is correct
40 Correct 1 ms 4956 KB Output is correct
41 Correct 1 ms 4956 KB Output is correct
42 Correct 1 ms 4956 KB Output is correct
43 Correct 1 ms 4952 KB Output is correct
44 Correct 1 ms 4956 KB Output is correct
45 Correct 2 ms 4956 KB Output is correct
46 Correct 2 ms 4956 KB Output is correct
47 Correct 4 ms 5140 KB Output is correct
48 Correct 1 ms 4956 KB Output is correct
49 Correct 1 ms 4956 KB Output is correct
50 Correct 5 ms 4956 KB Output is correct
51 Correct 5 ms 4956 KB Output is correct
52 Correct 3 ms 5292 KB Output is correct
53 Correct 7 ms 4956 KB Output is correct
54 Correct 3 ms 4956 KB Output is correct
55 Correct 1 ms 4956 KB Output is correct
56 Correct 1 ms 4956 KB Output is correct
57 Correct 1 ms 4956 KB Output is correct
58 Correct 2 ms 4956 KB Output is correct
59 Correct 6 ms 5152 KB Output is correct
60 Correct 1 ms 4956 KB Output is correct
61 Correct 84 ms 5132 KB Output is correct
62 Correct 88 ms 4956 KB Output is correct
63 Correct 4 ms 4952 KB Output is correct
64 Correct 49 ms 4956 KB Output is correct
65 Correct 680 ms 5168 KB Output is correct
66 Correct 4 ms 4956 KB Output is correct
67 Correct 3 ms 4956 KB Output is correct
68 Correct 790 ms 5200 KB Output is correct
69 Execution timed out 1034 ms 4952 KB Time limit exceeded
70 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 1 ms 4956 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4956 KB Output is correct
14 Correct 1 ms 4952 KB Output is correct
15 Correct 1 ms 4956 KB Output is correct
16 Correct 1 ms 4956 KB Output is correct
17 Correct 1 ms 5152 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4956 KB Output is correct
20 Correct 2 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 3 ms 4956 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 2 ms 4956 KB Output is correct
25 Correct 2 ms 4956 KB Output is correct
26 Correct 3 ms 4956 KB Output is correct
27 Correct 2 ms 5464 KB Output is correct
28 Correct 2 ms 5464 KB Output is correct
29 Correct 71 ms 5688 KB Output is correct
30 Correct 52 ms 5468 KB Output is correct
31 Correct 4 ms 5464 KB Output is correct
32 Correct 39 ms 5468 KB Output is correct
33 Correct 43 ms 5464 KB Output is correct
34 Correct 1 ms 4956 KB Output is correct
35 Correct 1 ms 4956 KB Output is correct
36 Correct 2 ms 4956 KB Output is correct
37 Correct 1 ms 4956 KB Output is correct
38 Correct 1 ms 4956 KB Output is correct
39 Correct 1 ms 4956 KB Output is correct
40 Correct 1 ms 4956 KB Output is correct
41 Correct 1 ms 4956 KB Output is correct
42 Correct 2 ms 4956 KB Output is correct
43 Correct 1 ms 4956 KB Output is correct
44 Correct 1 ms 4952 KB Output is correct
45 Correct 1 ms 4956 KB Output is correct
46 Correct 1 ms 5040 KB Output is correct
47 Correct 1 ms 4956 KB Output is correct
48 Correct 1 ms 4956 KB Output is correct
49 Correct 1 ms 4956 KB Output is correct
50 Correct 1 ms 4956 KB Output is correct
51 Correct 1 ms 4952 KB Output is correct
52 Correct 1 ms 4956 KB Output is correct
53 Correct 2 ms 4956 KB Output is correct
54 Correct 2 ms 4956 KB Output is correct
55 Correct 4 ms 5140 KB Output is correct
56 Correct 1 ms 4956 KB Output is correct
57 Correct 1 ms 4956 KB Output is correct
58 Correct 5 ms 4956 KB Output is correct
59 Correct 5 ms 4956 KB Output is correct
60 Correct 3 ms 5292 KB Output is correct
61 Correct 7 ms 4956 KB Output is correct
62 Correct 3 ms 4956 KB Output is correct
63 Correct 1 ms 4956 KB Output is correct
64 Correct 1 ms 4956 KB Output is correct
65 Correct 1 ms 4956 KB Output is correct
66 Correct 2 ms 4956 KB Output is correct
67 Correct 6 ms 5152 KB Output is correct
68 Correct 1 ms 4956 KB Output is correct
69 Correct 84 ms 5132 KB Output is correct
70 Correct 88 ms 4956 KB Output is correct
71 Correct 4 ms 4952 KB Output is correct
72 Correct 49 ms 4956 KB Output is correct
73 Correct 680 ms 5168 KB Output is correct
74 Correct 4 ms 4956 KB Output is correct
75 Correct 3 ms 4956 KB Output is correct
76 Correct 790 ms 5200 KB Output is correct
77 Execution timed out 1034 ms 4952 KB Time limit exceeded
78 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Correct 1 ms 4956 KB Output is correct
4 Correct 1 ms 4952 KB Output is correct
5 Correct 1 ms 4952 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 1 ms 4956 KB Output is correct
8 Correct 1 ms 4956 KB Output is correct
9 Correct 1 ms 4956 KB Output is correct
10 Correct 1 ms 4956 KB Output is correct
11 Correct 1 ms 4956 KB Output is correct
12 Correct 1 ms 4956 KB Output is correct
13 Correct 1 ms 4956 KB Output is correct
14 Correct 1 ms 4952 KB Output is correct
15 Correct 1 ms 4956 KB Output is correct
16 Correct 1 ms 4956 KB Output is correct
17 Correct 1 ms 5152 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4956 KB Output is correct
20 Correct 2 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 3 ms 4956 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 2 ms 4956 KB Output is correct
25 Correct 2 ms 4956 KB Output is correct
26 Correct 3 ms 4956 KB Output is correct
27 Correct 2 ms 5464 KB Output is correct
28 Correct 2 ms 5464 KB Output is correct
29 Correct 71 ms 5688 KB Output is correct
30 Correct 52 ms 5468 KB Output is correct
31 Correct 4 ms 5464 KB Output is correct
32 Correct 39 ms 5468 KB Output is correct
33 Correct 43 ms 5464 KB Output is correct
34 Correct 1 ms 4956 KB Output is correct
35 Correct 1 ms 4956 KB Output is correct
36 Correct 2 ms 4956 KB Output is correct
37 Correct 1 ms 4956 KB Output is correct
38 Correct 1 ms 4956 KB Output is correct
39 Correct 1 ms 4956 KB Output is correct
40 Correct 1 ms 4956 KB Output is correct
41 Correct 1 ms 4956 KB Output is correct
42 Correct 2 ms 4956 KB Output is correct
43 Correct 1 ms 4956 KB Output is correct
44 Correct 1 ms 4952 KB Output is correct
45 Correct 1 ms 4956 KB Output is correct
46 Correct 1 ms 5040 KB Output is correct
47 Correct 1 ms 4956 KB Output is correct
48 Correct 1 ms 4956 KB Output is correct
49 Correct 1 ms 4956 KB Output is correct
50 Correct 1 ms 4956 KB Output is correct
51 Correct 1 ms 4952 KB Output is correct
52 Correct 1 ms 4956 KB Output is correct
53 Correct 2 ms 4956 KB Output is correct
54 Correct 2 ms 4956 KB Output is correct
55 Correct 4 ms 5140 KB Output is correct
56 Correct 1 ms 4956 KB Output is correct
57 Correct 1 ms 4956 KB Output is correct
58 Correct 5 ms 4956 KB Output is correct
59 Correct 5 ms 4956 KB Output is correct
60 Correct 3 ms 5292 KB Output is correct
61 Correct 7 ms 4956 KB Output is correct
62 Correct 3 ms 4956 KB Output is correct
63 Correct 1 ms 4956 KB Output is correct
64 Correct 1 ms 4956 KB Output is correct
65 Correct 1 ms 4956 KB Output is correct
66 Correct 2 ms 4956 KB Output is correct
67 Correct 6 ms 5152 KB Output is correct
68 Correct 1 ms 4956 KB Output is correct
69 Correct 84 ms 5132 KB Output is correct
70 Correct 88 ms 4956 KB Output is correct
71 Correct 4 ms 4952 KB Output is correct
72 Correct 49 ms 4956 KB Output is correct
73 Correct 680 ms 5168 KB Output is correct
74 Correct 4 ms 4956 KB Output is correct
75 Correct 3 ms 4956 KB Output is correct
76 Correct 790 ms 5200 KB Output is correct
77 Execution timed out 1034 ms 4952 KB Time limit exceeded
78 Halted 0 ms 0 KB -