Submission #870087

# Submission time Handle Problem Language Result Execution time Memory
870087 2023-11-06T23:30:38 Z StefanL2005 Dreaming (IOI13_dreaming) C++14
77 / 100
487 ms 22560 KB
#include <bits/stdc++.h>
#include "dreaming.h"
using namespace std;
int k = 0, M;
 
void DFS_sum(int node, int p, vector<int> &sum, vector<vector<int>> &vec, vector<vector<int>> &cost, vector<int> &col)
{
    col[node] = k;
    for (int i = 0; i < vec[node].size(); i++)
    {
        if (vec[node][i] == p)
            continue;
 
        DFS_sum(vec[node][i], node, sum, vec, cost, col);
        sum[node] = max(sum[node], sum[vec[node][i]] + cost[node][i]);
    }
}

void DFS_main(int node, int p, int main, int sec, vector<int> &sum, int &ans, vector<vector<int>> &vec, vector<vector<int>> &cost)
{
    M = max(M, main + sec);
    ans = min(ans, max(main, sec));
    if (sec > main)
        return;
    int nr = 0;
    for (int i = 0; i < vec[node].size(); i++)
    {
        if (vec[node][i] == p)
            continue;
        int temp = sum[vec[node][i]] + cost[node][i];

        if (temp == main)
        {
            nr++;
            continue;
        }
        if (temp > sec && (temp != main || nr >= 1))
            sec = temp; 
    }

    for (int i = 0; i < vec[node].size(); i++)
    {
        if (vec[node][i] == p)
            continue;
        int temp = sum[vec[node][i]] + cost[node][i];

        if (temp == main)
            DFS_main(vec[node][i], node, main - cost[node][i], sec + cost[node][i], sum, ans, vec, cost);
    }
}

int trace(int node, int p, int main, vector<int> &sum, vector<vector<int>> &vec, vector<vector<int>> &cost)
{   
    for (int i = 0; i < vec[node].size(); i++)
    {
        if (vec[node][i] == p)
            continue;

        if (sum[vec[node][i]] + cost[node][i] == main)
            return trace(vec[node][i], node, main - cost[node][i], sum, vec, cost);
    }
    
    return node;
}

pair<int, int> graph_hub(int node, vector<vector<int>> &vec, vector<vector<int>> &cost, vector<int> &col)
{
    vector<int> sum(vec.size(), 0);
   // vector<int> new_sum(vec.size(), 0);
    DFS_sum(node, -1, sum, vec, cost, col);
    
    M = 0;
    int MAX = 0, sec = 0;
    for (int i = 0; i < vec[node].size(); i++)
    {
        int temp = sum[vec[node][i]] + cost[node][i];
 
        if (temp > MAX)
        {
            sec = MAX;
            MAX = temp;
        }
        else
            sec = max(sec, temp);
    }

    int ans = sum[node];
    DFS_main(node, -1, MAX, sec, sum, ans, vec, cost);
    /*
    int colt = trace(node, -1, sum[node], sum, vec, cost);
    DFS_sum(colt, -1, new_sum, vec, cost, col);
    */
    return make_pair(ans, M);
}
int travelTime(int N, int M, int L, int A[], int B[], int C[])
{
    vector<int> col(N, -1);
    vector<vector<int>> vec(N), cost(N);
    for (int i = 0; i < M; i++)
    {
        vec[A[i]].push_back(B[i]);
        vec[B[i]].push_back(A[i]);
        cost[A[i]].push_back(C[i]);
        cost[B[i]].push_back(C[i]);
    }

    if (M == N - 1)
    {
        vector<int> sum(N, 0);
        DFS_sum(0, -1, sum, vec, cost, col);
        
        int colt = trace(0, -1, sum[0], sum, vec, cost);
        
        vector<int> new_sum(vec.size(), 0);
        DFS_sum(colt, -1, new_sum, vec, cost, col);
        
        return new_sum[colt];
    }

    vector<pair<int, int>> hub_l;
    for (int i = 0; i < N; i++)
        if (col[i] == -1)
        {
            hub_l.push_back(graph_hub(i, vec, cost, col));
            k++;
        }
    
    int unos = 0, dos = 0, tres = 0;

    for (int i = 0; i < hub_l.size(); i++)
    {
        int p = hub_l[i].first;

        if (p > unos)
        {
            tres = dos;
            dos = unos;
            unos = p;
        }
        else
            if (p > dos)
            {
                tres = dos;
                dos = p;
            }
            else
                tres = max(tres, p);
    }
    int Max = 0;
    for (int i = 0; i < hub_l.size(); i++)
        Max = max(Max, hub_l[i].second);
    
    if (M == N - 2)
        return max(unos + L + dos, Max);
    return max(unos + L + dos, max(Max, dos + 2 * L + tres));
}




Compilation message

dreaming.cpp: In function 'void DFS_sum(int, int, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, std::vector<int>&)':
dreaming.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i = 0; i < vec[node].size(); i++)
      |                     ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'void DFS_main(int, int, int, int, std::vector<int>&, int&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)':
dreaming.cpp:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for (int i = 0; i < vec[node].size(); i++)
      |                     ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:41:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |     for (int i = 0; i < vec[node].size(); i++)
      |                     ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int trace(int, int, int, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)':
dreaming.cpp:54:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |     for (int i = 0; i < vec[node].size(); i++)
      |                     ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'std::pair<int, int> graph_hub(int, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, std::vector<int>&)':
dreaming.cpp:74:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |     for (int i = 0; i < vec[node].size(); i++)
      |                     ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:130:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  130 |     for (int i = 0; i < hub_l.size(); i++)
      |                     ~~^~~~~~~~~~~~~~
dreaming.cpp:150:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  150 |     for (int i = 0; i < hub_l.size(); i++)
      |                     ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 43 ms 16912 KB Output is correct
2 Correct 43 ms 16468 KB Output is correct
3 Correct 29 ms 12964 KB Output is correct
4 Correct 6 ms 2808 KB Output is correct
5 Correct 5 ms 1880 KB Output is correct
6 Correct 10 ms 3928 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 20 ms 7244 KB Output is correct
9 Correct 27 ms 10384 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 39 ms 12616 KB Output is correct
12 Correct 48 ms 14676 KB Output is correct
13 Correct 1 ms 856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 16912 KB Output is correct
2 Correct 43 ms 16468 KB Output is correct
3 Correct 29 ms 12964 KB Output is correct
4 Correct 6 ms 2808 KB Output is correct
5 Correct 5 ms 1880 KB Output is correct
6 Correct 10 ms 3928 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 20 ms 7244 KB Output is correct
9 Correct 27 ms 10384 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 39 ms 12616 KB Output is correct
12 Correct 48 ms 14676 KB Output is correct
13 Correct 1 ms 856 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 44 ms 16884 KB Output is correct
40 Correct 46 ms 16468 KB Output is correct
41 Correct 29 ms 13164 KB Output is correct
42 Correct 6 ms 2652 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 54 ms 13420 KB Output is correct
58 Correct 64 ms 13260 KB Output is correct
59 Correct 52 ms 13392 KB Output is correct
60 Correct 52 ms 13400 KB Output is correct
61 Correct 53 ms 13600 KB Output is correct
62 Correct 63 ms 13736 KB Output is correct
63 Correct 51 ms 13404 KB Output is correct
64 Correct 50 ms 13392 KB Output is correct
65 Correct 50 ms 13516 KB Output is correct
66 Correct 52 ms 13396 KB Output is correct
67 Correct 50 ms 13484 KB Output is correct
68 Correct 49 ms 13404 KB Output is correct
69 Correct 54 ms 13512 KB Output is correct
70 Correct 56 ms 13384 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 728 KB Output is correct
73 Correct 1 ms 604 KB Output is correct
74 Correct 1 ms 604 KB Output is correct
75 Correct 1 ms 604 KB Output is correct
76 Correct 1 ms 604 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 604 KB Output is correct
79 Correct 1 ms 604 KB Output is correct
80 Correct 54 ms 13396 KB Output is correct
81 Correct 55 ms 13396 KB Output is correct
82 Correct 54 ms 13512 KB Output is correct
83 Correct 57 ms 13528 KB Output is correct
84 Correct 1 ms 604 KB Output is correct
85 Correct 1 ms 604 KB Output is correct
86 Correct 1 ms 604 KB Output is correct
87 Correct 1 ms 604 KB Output is correct
88 Correct 1 ms 604 KB Output is correct
89 Correct 1 ms 604 KB Output is correct
90 Correct 1 ms 604 KB Output is correct
91 Correct 1 ms 604 KB Output is correct
92 Correct 1 ms 600 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 5 ms 1884 KB Output is correct
105 Correct 10 ms 3924 KB Output is correct
106 Correct 0 ms 344 KB Output is correct
107 Correct 20 ms 7240 KB Output is correct
108 Correct 26 ms 10380 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 38 ms 12512 KB Output is correct
111 Correct 48 ms 14524 KB Output is correct
112 Correct 1 ms 604 KB Output is correct
113 Correct 67 ms 22560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 295 ms 10612 KB Output is correct
2 Correct 306 ms 10488 KB Output is correct
3 Correct 274 ms 10468 KB Output is correct
4 Correct 286 ms 10464 KB Output is correct
5 Correct 310 ms 10588 KB Output is correct
6 Correct 385 ms 11444 KB Output is correct
7 Correct 322 ms 10964 KB Output is correct
8 Correct 277 ms 10216 KB Output is correct
9 Correct 261 ms 10388 KB Output is correct
10 Correct 306 ms 10956 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 469 ms 7024 KB Output is correct
13 Correct 436 ms 7012 KB Output is correct
14 Correct 465 ms 6972 KB Output is correct
15 Correct 456 ms 6980 KB Output is correct
16 Correct 463 ms 6972 KB Output is correct
17 Correct 487 ms 6860 KB Output is correct
18 Correct 439 ms 7036 KB Output is correct
19 Correct 467 ms 7216 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 481 ms 7044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 604 KB Output is correct
28 Correct 1 ms 604 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 604 KB Output is correct
31 Correct 2 ms 600 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 604 KB Output is correct
34 Correct 1 ms 856 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 344 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 2 ms 860 KB Output is correct
55 Correct 2 ms 860 KB Output is correct
56 Correct 1 ms 604 KB Output is correct
57 Correct 1 ms 604 KB Output is correct
58 Correct 2 ms 604 KB Output is correct
59 Correct 1 ms 604 KB Output is correct
60 Correct 1 ms 604 KB Output is correct
61 Correct 1 ms 604 KB Output is correct
62 Correct 1 ms 604 KB Output is correct
63 Correct 1 ms 604 KB Output is correct
64 Correct 1 ms 604 KB Output is correct
65 Correct 1 ms 600 KB Output is correct
66 Correct 1 ms 604 KB Output is correct
67 Correct 2 ms 604 KB Output is correct
68 Correct 1 ms 604 KB Output is correct
69 Correct 2 ms 604 KB Output is correct
70 Correct 1 ms 604 KB Output is correct
71 Correct 1 ms 696 KB Output is correct
72 Correct 1 ms 604 KB Output is correct
73 Correct 1 ms 604 KB Output is correct
74 Correct 1 ms 600 KB Output is correct
75 Correct 2 ms 600 KB Output is correct
76 Correct 2 ms 600 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 604 KB Output is correct
79 Correct 1 ms 600 KB Output is correct
80 Correct 1 ms 604 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 1 ms 604 KB Output is correct
83 Correct 1 ms 604 KB Output is correct
84 Correct 1 ms 604 KB Output is correct
85 Correct 1 ms 604 KB Output is correct
86 Correct 1 ms 604 KB Output is correct
87 Correct 1 ms 600 KB Output is correct
88 Correct 1 ms 604 KB Output is correct
89 Correct 1 ms 604 KB Output is correct
90 Correct 2 ms 604 KB Output is correct
91 Correct 1 ms 604 KB Output is correct
92 Correct 1 ms 604 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 604 KB Output is correct
95 Correct 1 ms 604 KB Output is correct
96 Correct 1 ms 604 KB Output is correct
97 Correct 1 ms 604 KB Output is correct
98 Correct 2 ms 604 KB Output is correct
99 Correct 1 ms 604 KB Output is correct
100 Correct 1 ms 604 KB Output is correct
101 Correct 1 ms 604 KB Output is correct
102 Correct 0 ms 344 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 0 ms 348 KB Output is correct
111 Correct 0 ms 348 KB Output is correct
112 Correct 0 ms 348 KB Output is correct
113 Correct 0 ms 348 KB Output is correct
114 Correct 1 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 16912 KB Output is correct
2 Correct 43 ms 16468 KB Output is correct
3 Correct 29 ms 12964 KB Output is correct
4 Correct 6 ms 2808 KB Output is correct
5 Correct 5 ms 1880 KB Output is correct
6 Correct 10 ms 3928 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 20 ms 7244 KB Output is correct
9 Correct 27 ms 10384 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 39 ms 12616 KB Output is correct
12 Correct 48 ms 14676 KB Output is correct
13 Correct 1 ms 856 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 44 ms 16884 KB Output is correct
40 Correct 46 ms 16468 KB Output is correct
41 Correct 29 ms 13164 KB Output is correct
42 Correct 6 ms 2652 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 54 ms 13420 KB Output is correct
58 Correct 64 ms 13260 KB Output is correct
59 Correct 52 ms 13392 KB Output is correct
60 Correct 52 ms 13400 KB Output is correct
61 Correct 53 ms 13600 KB Output is correct
62 Correct 63 ms 13736 KB Output is correct
63 Correct 51 ms 13404 KB Output is correct
64 Correct 50 ms 13392 KB Output is correct
65 Correct 50 ms 13516 KB Output is correct
66 Correct 52 ms 13396 KB Output is correct
67 Correct 50 ms 13484 KB Output is correct
68 Correct 49 ms 13404 KB Output is correct
69 Correct 54 ms 13512 KB Output is correct
70 Correct 56 ms 13384 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 728 KB Output is correct
73 Correct 1 ms 604 KB Output is correct
74 Correct 1 ms 604 KB Output is correct
75 Correct 1 ms 604 KB Output is correct
76 Correct 1 ms 604 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 604 KB Output is correct
79 Correct 1 ms 604 KB Output is correct
80 Correct 54 ms 13396 KB Output is correct
81 Correct 55 ms 13396 KB Output is correct
82 Correct 54 ms 13512 KB Output is correct
83 Correct 57 ms 13528 KB Output is correct
84 Correct 1 ms 604 KB Output is correct
85 Correct 1 ms 604 KB Output is correct
86 Correct 1 ms 604 KB Output is correct
87 Correct 1 ms 604 KB Output is correct
88 Correct 1 ms 604 KB Output is correct
89 Correct 1 ms 604 KB Output is correct
90 Correct 1 ms 604 KB Output is correct
91 Correct 1 ms 604 KB Output is correct
92 Correct 1 ms 600 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 5 ms 1884 KB Output is correct
105 Correct 10 ms 3924 KB Output is correct
106 Correct 0 ms 344 KB Output is correct
107 Correct 20 ms 7240 KB Output is correct
108 Correct 26 ms 10380 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 38 ms 12512 KB Output is correct
111 Correct 48 ms 14524 KB Output is correct
112 Correct 1 ms 604 KB Output is correct
113 Correct 67 ms 22560 KB Output is correct
114 Correct 295 ms 10612 KB Output is correct
115 Correct 306 ms 10488 KB Output is correct
116 Correct 274 ms 10468 KB Output is correct
117 Correct 286 ms 10464 KB Output is correct
118 Correct 310 ms 10588 KB Output is correct
119 Correct 385 ms 11444 KB Output is correct
120 Correct 322 ms 10964 KB Output is correct
121 Correct 277 ms 10216 KB Output is correct
122 Correct 261 ms 10388 KB Output is correct
123 Correct 306 ms 10956 KB Output is correct
124 Correct 0 ms 348 KB Output is correct
125 Correct 469 ms 7024 KB Output is correct
126 Correct 436 ms 7012 KB Output is correct
127 Correct 465 ms 6972 KB Output is correct
128 Correct 456 ms 6980 KB Output is correct
129 Correct 463 ms 6972 KB Output is correct
130 Correct 487 ms 6860 KB Output is correct
131 Correct 439 ms 7036 KB Output is correct
132 Correct 467 ms 7216 KB Output is correct
133 Correct 0 ms 344 KB Output is correct
134 Correct 0 ms 348 KB Output is correct
135 Correct 1 ms 604 KB Output is correct
136 Correct 481 ms 7044 KB Output is correct
137 Correct 1 ms 348 KB Output is correct
138 Correct 1 ms 604 KB Output is correct
139 Correct 1 ms 604 KB Output is correct
140 Correct 1 ms 348 KB Output is correct
141 Correct 1 ms 604 KB Output is correct
142 Correct 2 ms 600 KB Output is correct
143 Correct 1 ms 348 KB Output is correct
144 Correct 1 ms 604 KB Output is correct
145 Correct 1 ms 856 KB Output is correct
146 Correct 0 ms 348 KB Output is correct
147 Correct 0 ms 348 KB Output is correct
148 Correct 0 ms 344 KB Output is correct
149 Correct 0 ms 348 KB Output is correct
150 Correct 0 ms 348 KB Output is correct
151 Correct 0 ms 344 KB Output is correct
152 Correct 0 ms 348 KB Output is correct
153 Correct 0 ms 348 KB Output is correct
154 Correct 0 ms 348 KB Output is correct
155 Correct 0 ms 348 KB Output is correct
156 Correct 0 ms 348 KB Output is correct
157 Correct 0 ms 348 KB Output is correct
158 Correct 0 ms 348 KB Output is correct
159 Correct 0 ms 348 KB Output is correct
160 Correct 0 ms 348 KB Output is correct
161 Correct 0 ms 348 KB Output is correct
162 Correct 0 ms 348 KB Output is correct
163 Correct 0 ms 348 KB Output is correct
164 Correct 0 ms 348 KB Output is correct
165 Correct 2 ms 860 KB Output is correct
166 Correct 2 ms 860 KB Output is correct
167 Correct 1 ms 604 KB Output is correct
168 Correct 1 ms 604 KB Output is correct
169 Correct 2 ms 604 KB Output is correct
170 Correct 1 ms 604 KB Output is correct
171 Correct 1 ms 604 KB Output is correct
172 Correct 1 ms 604 KB Output is correct
173 Correct 1 ms 604 KB Output is correct
174 Correct 1 ms 604 KB Output is correct
175 Correct 1 ms 604 KB Output is correct
176 Correct 1 ms 600 KB Output is correct
177 Correct 1 ms 604 KB Output is correct
178 Correct 2 ms 604 KB Output is correct
179 Correct 1 ms 604 KB Output is correct
180 Correct 2 ms 604 KB Output is correct
181 Correct 1 ms 604 KB Output is correct
182 Correct 1 ms 696 KB Output is correct
183 Correct 1 ms 604 KB Output is correct
184 Correct 1 ms 604 KB Output is correct
185 Correct 1 ms 600 KB Output is correct
186 Correct 2 ms 600 KB Output is correct
187 Correct 2 ms 600 KB Output is correct
188 Correct 1 ms 604 KB Output is correct
189 Correct 1 ms 604 KB Output is correct
190 Correct 1 ms 600 KB Output is correct
191 Correct 1 ms 604 KB Output is correct
192 Correct 1 ms 600 KB Output is correct
193 Correct 1 ms 604 KB Output is correct
194 Correct 1 ms 604 KB Output is correct
195 Correct 1 ms 604 KB Output is correct
196 Correct 1 ms 604 KB Output is correct
197 Correct 1 ms 604 KB Output is correct
198 Correct 1 ms 600 KB Output is correct
199 Correct 1 ms 604 KB Output is correct
200 Correct 1 ms 604 KB Output is correct
201 Correct 2 ms 604 KB Output is correct
202 Correct 1 ms 604 KB Output is correct
203 Correct 1 ms 604 KB Output is correct
204 Correct 1 ms 604 KB Output is correct
205 Correct 1 ms 604 KB Output is correct
206 Correct 1 ms 604 KB Output is correct
207 Correct 1 ms 604 KB Output is correct
208 Correct 1 ms 604 KB Output is correct
209 Correct 2 ms 604 KB Output is correct
210 Correct 1 ms 604 KB Output is correct
211 Correct 1 ms 604 KB Output is correct
212 Correct 1 ms 604 KB Output is correct
213 Correct 0 ms 344 KB Output is correct
214 Correct 0 ms 348 KB Output is correct
215 Correct 0 ms 348 KB Output is correct
216 Correct 0 ms 348 KB Output is correct
217 Correct 0 ms 348 KB Output is correct
218 Correct 0 ms 348 KB Output is correct
219 Correct 0 ms 348 KB Output is correct
220 Correct 0 ms 348 KB Output is correct
221 Correct 0 ms 348 KB Output is correct
222 Correct 0 ms 348 KB Output is correct
223 Correct 0 ms 348 KB Output is correct
224 Correct 0 ms 348 KB Output is correct
225 Correct 1 ms 604 KB Output is correct
226 Correct 1 ms 348 KB Output is correct
227 Correct 1 ms 604 KB Output is correct
228 Correct 1 ms 860 KB Output is correct
229 Incorrect 84 ms 11656 KB Output isn't correct
230 Halted 0 ms 0 KB -