답안 #1102788

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1102788 2024-10-18T22:56:24 Z totoro 꿈 (IOI13_dreaming) C++17
59 / 100
1000 ms 13380 KB
// SOLVED   SUBTASK 1 (14 pts)
// SOLVED   SUBTASK 2 (10 pts)
// SOLVED   SUBTASK 3 (23 pts)
// UNSOLVED SUBTASK 4 (18 pts)
// UNSOLVED SUBTASK 5 (12 pts)
// UNSOLVED SUBTASK 6 (23 pts)
// [+-+]----------------------
// TOTAL      47/100 pts

#include "dreaming.h"

#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>

struct Edge {
    int from;
    int to;
    int length;
    Edge(int from, int to, int length) : from(from), to(to), length(length) {}
    bool operator<(const Edge& other) {
        return from < other.from;
    }
};
bool operator<(const Edge& a, const Edge& b) {
    return a.from < b.from;
}

int farthest_node(const std::vector<std::vector<Edge>>& tree, int a) {
    std::vector<bool> visited(tree.size());
    std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>>, std::greater<std::pair<int, int>>> q;
    q.emplace(0, a);
    int last;
    while (!q.empty()) {
        auto el = q.top();
        q.pop();
        if (visited[el.second]) continue;
        visited[el.second] = true;
        for (auto edge : tree[el.second]) {
            q.emplace(el.first + edge.length, edge.to);
        }
        last = el.second;
    }
    return last;
}

std::vector<Edge> dijkstra_path(const std::vector<std::vector<Edge>>& tree, int a, int b) {
    std::vector<bool> visited(tree.size());
    std::priority_queue<std::pair<int, std::pair<Edge, int>>> q;
    Edge dummy = Edge(-1, a, -1);
    q.emplace(0, std::pair<Edge, int>(dummy, a));
    std::vector<Edge> from(tree.size(), dummy);
    while (!q.empty() && q.top().second.second != b) {
        auto el = q.top();
        q.pop();
        if (visited[el.second.second]) continue;
        visited[el.second.second] = true;
        from[el.second.second] = el.second.first;
        for (auto edge : tree[el.second.second]) {
            q.emplace(el.first + edge.length, std::pair<Edge, int>(edge, edge.to));
        }
    }
    if (q.empty()) return {};
    from[b] = q.top().second.first;
    std::vector<Edge> path;
    int current = b;
    while (current != a) {
        path.push_back(from[current]);
        current = from[current].from;
    }
    return path;
}

int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
    std::vector<std::vector<Edge>> tree(N);
    for (int i = 0; i < M; ++i) {
        tree[A[i]].emplace_back(A[i], B[i], T[i]);
        tree[B[i]].emplace_back(B[i], A[i], T[i]);
    }
    // std::cout << "finished init" << std::endl;
    // floodfill
    std::vector<int> color(N);
    std::vector<int> parents;
    int current = 1;
    for (int i = 0; i < N; ++i) {
        if (color[i]) continue;
        parents.push_back(i);
        std::vector<int> stack;
        stack.push_back(i);
        while (!stack.empty()) {
            int back = stack.back();
            stack.pop_back();
            if (color[back]) continue;
            color[back] = current;
            for (auto edge : tree[back]) {
                stack.push_back(edge.to);
            }
        }
        ++current;
    }
    // std::cout << "finished floodfill" << std::endl;

    // radius and centers
    std::vector<std::pair<int, int>> radius_centers(parents.size());
    int sp = 0;
    int largest_diameter = 0;
    for (auto parent : parents) {
        int b = farthest_node(tree, parent);
        int a = farthest_node(tree, b);
        if (a == b) {
            radius_centers[sp++] = std::make_pair(0, parent);
            continue;
        }
        auto diameter = dijkstra_path(tree, b, a);
        int sum = 0;
        for (auto edge : diameter) {
            sum += edge.length;
        }
        largest_diameter = std::max(largest_diameter, sum);
        int small_sum = 0;
        int i = 0;
        while (i < diameter.size() && small_sum <= sum / 2) {
            small_sum += diameter[i++].length;
        }
        if (sum - small_sum + diameter[i - 1].length < small_sum) {
            --i;
            small_sum = sum - small_sum + diameter[i].length;
        }
        radius_centers[sp++] = std::make_pair(small_sum, i > 0 ? diameter[i - 1].from : diameter[i].to);
        // if (sp % 100 == 0) {
        //     std::cout << "finished " << sp << " rads" << std::endl;
        // }
    }
    // std::cout << "finished rads" << std::endl;

    if (radius_centers.size() < 2) {
        return largest_diameter;
    }
    std::sort(radius_centers.rbegin(), radius_centers.rend());
    // std::cout << "finished sorting" << std::endl;
    long long max = std::max(largest_diameter, radius_centers[0].first + L + radius_centers[1].first);
    if (radius_centers.size() > 2) {
        max = std::max(max, (long long)L + L + radius_centers[1].first + radius_centers[2].first);
    }
    return max;
}

Compilation message

dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:123:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Edge>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  123 |         while (i < diameter.size() && small_sum <= sum / 2) {
      |                ~~^~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int farthest_node(const std::vector<std::vector<Edge> >&, int)':
dreaming.cpp:45:12: warning: 'last' may be used uninitialized in this function [-Wmaybe-uninitialized]
   45 |     return last;
      |            ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 12232 KB Output is correct
2 Correct 61 ms 12372 KB Output is correct
3 Correct 41 ms 8000 KB Output is correct
4 Correct 9 ms 2268 KB Output is correct
5 Correct 9 ms 1620 KB Output is correct
6 Correct 14 ms 3020 KB Output is correct
7 Correct 1 ms 508 KB Output is correct
8 Correct 29 ms 5172 KB Output is correct
9 Correct 38 ms 6652 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 54 ms 8944 KB Output is correct
12 Correct 57 ms 11104 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 512 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 504 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 12232 KB Output is correct
2 Correct 61 ms 12372 KB Output is correct
3 Correct 41 ms 8000 KB Output is correct
4 Correct 9 ms 2268 KB Output is correct
5 Correct 9 ms 1620 KB Output is correct
6 Correct 14 ms 3020 KB Output is correct
7 Correct 1 ms 508 KB Output is correct
8 Correct 29 ms 5172 KB Output is correct
9 Correct 38 ms 6652 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 54 ms 8944 KB Output is correct
12 Correct 57 ms 11104 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 512 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 504 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 65 ms 12392 KB Output is correct
40 Correct 64 ms 12368 KB Output is correct
41 Correct 41 ms 8008 KB Output is correct
42 Correct 9 ms 2100 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 504 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 85 ms 11348 KB Output is correct
58 Correct 89 ms 11340 KB Output is correct
59 Correct 83 ms 11192 KB Output is correct
60 Correct 74 ms 11172 KB Output is correct
61 Correct 99 ms 11296 KB Output is correct
62 Correct 84 ms 11340 KB Output is correct
63 Correct 79 ms 11060 KB Output is correct
64 Correct 88 ms 11000 KB Output is correct
65 Correct 86 ms 11304 KB Output is correct
66 Correct 84 ms 11280 KB Output is correct
67 Correct 86 ms 11108 KB Output is correct
68 Correct 86 ms 11084 KB Output is correct
69 Correct 83 ms 11456 KB Output is correct
70 Correct 78 ms 11364 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 3 ms 712 KB Output is correct
73 Correct 3 ms 596 KB Output is correct
74 Correct 3 ms 596 KB Output is correct
75 Correct 3 ms 760 KB Output is correct
76 Correct 3 ms 596 KB Output is correct
77 Correct 3 ms 596 KB Output is correct
78 Correct 2 ms 596 KB Output is correct
79 Correct 3 ms 760 KB Output is correct
80 Correct 71 ms 11136 KB Output is correct
81 Correct 83 ms 11192 KB Output is correct
82 Correct 76 ms 11296 KB Output is correct
83 Correct 78 ms 11340 KB Output is correct
84 Correct 2 ms 596 KB Output is correct
85 Correct 2 ms 596 KB Output is correct
86 Correct 2 ms 596 KB Output is correct
87 Correct 2 ms 596 KB Output is correct
88 Correct 2 ms 596 KB Output is correct
89 Correct 3 ms 596 KB Output is correct
90 Correct 3 ms 740 KB Output is correct
91 Correct 3 ms 760 KB Output is correct
92 Correct 3 ms 596 KB Output is correct
93 Correct 2 ms 596 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 508 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 340 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 1 ms 504 KB Output is correct
103 Correct 1 ms 384 KB Output is correct
104 Correct 7 ms 1620 KB Output is correct
105 Correct 16 ms 3152 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 30 ms 5064 KB Output is correct
108 Correct 36 ms 6816 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 68 ms 8828 KB Output is correct
111 Correct 60 ms 11096 KB Output is correct
112 Correct 2 ms 340 KB Output is correct
113 Correct 73 ms 13380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1066 ms 7640 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 512 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 504 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 504 KB Output is correct
27 Correct 2 ms 596 KB Output is correct
28 Correct 3 ms 760 KB Output is correct
29 Correct 1 ms 352 KB Output is correct
30 Correct 2 ms 760 KB Output is correct
31 Correct 3 ms 752 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 2 ms 596 KB Output is correct
34 Correct 3 ms 596 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 504 KB Output is correct
54 Correct 3 ms 852 KB Output is correct
55 Correct 2 ms 852 KB Output is correct
56 Correct 4 ms 596 KB Output is correct
57 Correct 3 ms 776 KB Output is correct
58 Correct 3 ms 596 KB Output is correct
59 Correct 4 ms 596 KB Output is correct
60 Correct 4 ms 596 KB Output is correct
61 Correct 3 ms 596 KB Output is correct
62 Correct 3 ms 596 KB Output is correct
63 Correct 3 ms 760 KB Output is correct
64 Correct 2 ms 596 KB Output is correct
65 Correct 4 ms 596 KB Output is correct
66 Correct 3 ms 596 KB Output is correct
67 Correct 3 ms 596 KB Output is correct
68 Correct 4 ms 596 KB Output is correct
69 Correct 4 ms 596 KB Output is correct
70 Correct 4 ms 596 KB Output is correct
71 Correct 4 ms 596 KB Output is correct
72 Correct 3 ms 596 KB Output is correct
73 Correct 3 ms 596 KB Output is correct
74 Correct 3 ms 720 KB Output is correct
75 Correct 3 ms 596 KB Output is correct
76 Correct 3 ms 776 KB Output is correct
77 Correct 3 ms 596 KB Output is correct
78 Correct 3 ms 760 KB Output is correct
79 Correct 4 ms 596 KB Output is correct
80 Correct 2 ms 596 KB Output is correct
81 Correct 1 ms 448 KB Output is correct
82 Correct 4 ms 596 KB Output is correct
83 Correct 3 ms 596 KB Output is correct
84 Correct 2 ms 596 KB Output is correct
85 Correct 2 ms 596 KB Output is correct
86 Correct 3 ms 596 KB Output is correct
87 Correct 4 ms 596 KB Output is correct
88 Correct 3 ms 724 KB Output is correct
89 Correct 4 ms 596 KB Output is correct
90 Correct 4 ms 484 KB Output is correct
91 Correct 3 ms 596 KB Output is correct
92 Correct 2 ms 596 KB Output is correct
93 Correct 2 ms 492 KB Output is correct
94 Correct 2 ms 596 KB Output is correct
95 Correct 2 ms 596 KB Output is correct
96 Correct 3 ms 764 KB Output is correct
97 Correct 3 ms 596 KB Output is correct
98 Correct 2 ms 596 KB Output is correct
99 Correct 3 ms 596 KB Output is correct
100 Correct 3 ms 712 KB Output is correct
101 Correct 3 ms 596 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 344 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 1 ms 456 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 500 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 1 ms 340 KB Output is correct
111 Correct 1 ms 344 KB Output is correct
112 Correct 1 ms 344 KB Output is correct
113 Correct 1 ms 340 KB Output is correct
114 Correct 2 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 12232 KB Output is correct
2 Correct 61 ms 12372 KB Output is correct
3 Correct 41 ms 8000 KB Output is correct
4 Correct 9 ms 2268 KB Output is correct
5 Correct 9 ms 1620 KB Output is correct
6 Correct 14 ms 3020 KB Output is correct
7 Correct 1 ms 508 KB Output is correct
8 Correct 29 ms 5172 KB Output is correct
9 Correct 38 ms 6652 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 54 ms 8944 KB Output is correct
12 Correct 57 ms 11104 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 512 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 504 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 65 ms 12392 KB Output is correct
40 Correct 64 ms 12368 KB Output is correct
41 Correct 41 ms 8008 KB Output is correct
42 Correct 9 ms 2100 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 504 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 85 ms 11348 KB Output is correct
58 Correct 89 ms 11340 KB Output is correct
59 Correct 83 ms 11192 KB Output is correct
60 Correct 74 ms 11172 KB Output is correct
61 Correct 99 ms 11296 KB Output is correct
62 Correct 84 ms 11340 KB Output is correct
63 Correct 79 ms 11060 KB Output is correct
64 Correct 88 ms 11000 KB Output is correct
65 Correct 86 ms 11304 KB Output is correct
66 Correct 84 ms 11280 KB Output is correct
67 Correct 86 ms 11108 KB Output is correct
68 Correct 86 ms 11084 KB Output is correct
69 Correct 83 ms 11456 KB Output is correct
70 Correct 78 ms 11364 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 3 ms 712 KB Output is correct
73 Correct 3 ms 596 KB Output is correct
74 Correct 3 ms 596 KB Output is correct
75 Correct 3 ms 760 KB Output is correct
76 Correct 3 ms 596 KB Output is correct
77 Correct 3 ms 596 KB Output is correct
78 Correct 2 ms 596 KB Output is correct
79 Correct 3 ms 760 KB Output is correct
80 Correct 71 ms 11136 KB Output is correct
81 Correct 83 ms 11192 KB Output is correct
82 Correct 76 ms 11296 KB Output is correct
83 Correct 78 ms 11340 KB Output is correct
84 Correct 2 ms 596 KB Output is correct
85 Correct 2 ms 596 KB Output is correct
86 Correct 2 ms 596 KB Output is correct
87 Correct 2 ms 596 KB Output is correct
88 Correct 2 ms 596 KB Output is correct
89 Correct 3 ms 596 KB Output is correct
90 Correct 3 ms 740 KB Output is correct
91 Correct 3 ms 760 KB Output is correct
92 Correct 3 ms 596 KB Output is correct
93 Correct 2 ms 596 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 508 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 340 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 1 ms 504 KB Output is correct
103 Correct 1 ms 384 KB Output is correct
104 Correct 7 ms 1620 KB Output is correct
105 Correct 16 ms 3152 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 30 ms 5064 KB Output is correct
108 Correct 36 ms 6816 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 68 ms 8828 KB Output is correct
111 Correct 60 ms 11096 KB Output is correct
112 Correct 2 ms 340 KB Output is correct
113 Correct 73 ms 13380 KB Output is correct
114 Execution timed out 1066 ms 7640 KB Time limit exceeded
115 Halted 0 ms 0 KB -