Submission #228354

# Submission time Handle Problem Language Result Execution time Memory
228354 2020-04-30T17:03:45 Z AaronNaidu Shortcut (IOI16_shortcut) C++14
23 / 100
2000 ms 198520 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

vector<pair<int, int> > graph[100000];
ll dist1s[100000];
bool visited[100000];
ll distMatrix[5000][5000];
int n, c;

void DFS(int node) {
    visited[node] = true;
    for (auto i : graph[node])
    {
        if (!visited[i.first])
        {
            dist1s[i.first] = i.second + dist1s[node];
            DFS(i.first);
        }
    }
}

ll bridgeBetween(int fir, int sec) {
    ll toRet = 0;
    for (int i = 0; i < 2 * n; i++)
    {
        for (int j = i + 1; j < 2 * n; j++)
        {
            if (distMatrix[i][j] < 1000000000000000000)
            {
                toRet = max(toRet, min(distMatrix[i][j], min(distMatrix[i][fir] + c + distMatrix[sec][j], distMatrix[i][sec] + c + distMatrix[fir][j])));
            }
            
        }
        
    }
    return toRet;
}

void trash()  {
    //cout << "Starting first DFS\n";
    DFS(0);
    //cout << "Done with first DFS\n";
    ll maxDist = 0;
    int maxVert = -1;
    for (int i = 0; i < 2 * n; i++)
    {
        if (maxDist < dist1s[i])
        {
            maxDist = dist1s[i];
            maxVert = i;
        }
        dist1s[i] = 0;
        visited[i] = false;
    }
    DFS(maxVert);
    ll maxDist2 = 0;
    int maxVert2 = -1;
    for (int i = 0; i < 2 * n; i++)
    {
        if (maxDist2 < dist1s[i])
        {
            maxDist2 = dist1s[i];
            maxVert2 = i;
        }
        dist1s[i] = 0;
    }
    if (maxVert >= n)
    {
        maxVert -= n;
    }
    if (maxVert2 >= n)
    {
        maxVert2 -= n;
    }
    
    graph[maxVert].push_back({maxVert2, c});
    graph[maxVert2].push_back({maxVert, c});
    //cout << "Edge between " << maxVert << " and " << maxVert2 << "\n";
}

ll find_shortcut(int ln, vector<int> l, vector<int> d, int lc) {
    n = ln;
    c = lc;
    //cout << "Starting\n";
    for (int i = 0; i < l.size(); i++)
    {
        graph[i].push_back({i+1, l[i]});
        graph[i+1].push_back({i, l[i]});
    }
    for (int i = 0; i < d.size(); i++)
    {
        if (d[i] > 0)
        {
            graph[i].push_back({i+n, d[i]});
            graph[i+n].push_back({i, d[i]});
        }
    }
    
    priority_queue<pair<ll, ll> > q;
    for (int i = 0; i < 5000; i++)
    {
        for (int j = 0; j < 5000; j++)
        {
            distMatrix[i][j] = 1000000000000000000;
        }
        
    }
    
    for (int i = 0; i < 2 * n; i++)
    {
        q.push({0, i});
        for (int j = 0; j < 2 * n; j++)
        {
            visited[j] = false;
        }
        distMatrix[i][i] = 0;
        while (!q.empty())
        {
            int dist = -q.top().first;
            int node = q.top().second;
            q.pop();
            if (visited[node])
            {
                continue;
            }
            visited[node] = true;
            for (auto j : graph[node])    
            {
                if (!visited[j.first])
                {
                    distMatrix[i][j.first] = min(distMatrix[i][j.first], distMatrix[i][node] + j.second);
                    //cout << "Updating distMatrix " << i << j.first << " to " <<  min(distMatrix[i][j.first], distMatrix[i][node] + j.second) << "\n";
                    q.push({-distMatrix[i][j.first], j.first});
                }
            }
        }
    }
    ll toRet = 1000000000000000000;
    for (int i = 0; i < n; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            if (distMatrix[i][j] < 1000000000000000000)
            {
                toRet = min(toRet, bridgeBetween(i,j));
            }
        }
    }
    return toRet;
}

Compilation message

shortcut.cpp: In function 'll find_shortcut(int, std::vector<int>, std::vector<int>, int)':
shortcut.cpp:86:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < l.size(); i++)
                     ~~^~~~~~~~~~
shortcut.cpp:91:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < d.size(); i++)
                     ~~^~~~~~~~~~
shortcut.cpp:120:17: warning: unused variable 'dist' [-Wunused-variable]
             int dist = -q.top().first;
                 ^~~~
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
73 Execution timed out 2100 ms 198392 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
73 Execution timed out 2100 ms 198392 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
73 Execution timed out 2100 ms 198392 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
73 Execution timed out 2100 ms 198392 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
73 Execution timed out 2100 ms 198392 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 100 ms 198396 KB n = 4, 80 is a correct answer
2 Correct 95 ms 198368 KB n = 9, 110 is a correct answer
3 Correct 94 ms 198396 KB n = 4, 21 is a correct answer
4 Correct 98 ms 198396 KB n = 3, 4 is a correct answer
5 Correct 93 ms 198392 KB n = 2, 62 is a correct answer
6 Correct 92 ms 198392 KB n = 2, 3 is a correct answer
7 Correct 93 ms 198392 KB n = 3, 29 is a correct answer
8 Correct 101 ms 198520 KB n = 2, 3 is a correct answer
9 Correct 95 ms 198396 KB n = 2, 3 is a correct answer
10 Correct 93 ms 198520 KB n = 2, 2000000001 is a correct answer
11 Correct 98 ms 198392 KB n = 2, 3000000000 is a correct answer
12 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
13 Correct 95 ms 198392 KB n = 3, 3000000000 is a correct answer
14 Correct 92 ms 198392 KB n = 4, 3000000001 is a correct answer
15 Correct 94 ms 198392 KB n = 4, 4000000000 is a correct answer
16 Correct 93 ms 198392 KB n = 5, 4000000000 is a correct answer
17 Correct 94 ms 198412 KB n = 10, 1000000343 is a correct answer
18 Correct 97 ms 198392 KB n = 10, 3189 is a correct answer
19 Correct 95 ms 198392 KB n = 10, 7000000000 is a correct answer
20 Correct 93 ms 198392 KB n = 5, 12 is a correct answer
21 Correct 94 ms 198392 KB n = 5, 25 is a correct answer
22 Correct 94 ms 198392 KB n = 2, 122 is a correct answer
23 Correct 96 ms 198368 KB n = 10, 117 is a correct answer
24 Correct 102 ms 198392 KB n = 10, 336 is a correct answer
25 Correct 96 ms 198264 KB n = 10, 438 is a correct answer
26 Correct 95 ms 198392 KB n = 10, 206 is a correct answer
27 Correct 95 ms 198392 KB n = 10, 636 is a correct answer
28 Correct 95 ms 198396 KB n = 4, 2399 is a correct answer
29 Correct 95 ms 198392 KB n = 10, 10992 is a correct answer
30 Correct 94 ms 198392 KB n = 10, 3112 is a correct answer
31 Correct 328 ms 198520 KB n = 100, 51000000001 is a correct answer
32 Correct 114 ms 198392 KB n = 50, 197881272 is a correct answer
33 Correct 333 ms 198520 KB n = 100, 20969 is a correct answer
34 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
35 Correct 337 ms 198520 KB n = 100, 52000000000 is a correct answer
36 Correct 339 ms 198440 KB n = 100, 285 is a correct answer
37 Correct 328 ms 198424 KB n = 100, 21272 is a correct answer
38 Correct 326 ms 198392 KB n = 100, 12161 is a correct answer
39 Correct 95 ms 198392 KB n = 2, 62 is a correct answer
40 Correct 95 ms 198392 KB n = 2, 3 is a correct answer
41 Correct 94 ms 198392 KB n = 3, 29 is a correct answer
42 Correct 95 ms 198368 KB n = 2, 3 is a correct answer
43 Correct 97 ms 198392 KB n = 2, 3 is a correct answer
44 Correct 94 ms 198392 KB n = 2, 2000000001 is a correct answer
45 Correct 93 ms 198392 KB n = 2, 3000000000 is a correct answer
46 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
47 Correct 94 ms 198392 KB n = 3, 3000000000 is a correct answer
48 Correct 95 ms 198392 KB n = 4, 3000000001 is a correct answer
49 Correct 93 ms 198392 KB n = 4, 4000000000 is a correct answer
50 Correct 97 ms 198392 KB n = 5, 4000000000 is a correct answer
51 Correct 96 ms 198520 KB n = 10, 1000000343 is a correct answer
52 Correct 92 ms 198392 KB n = 10, 3189 is a correct answer
53 Correct 98 ms 198392 KB n = 10, 7000000000 is a correct answer
54 Correct 92 ms 198392 KB n = 5, 12 is a correct answer
55 Correct 96 ms 198392 KB n = 5, 25 is a correct answer
56 Correct 96 ms 198392 KB n = 2, 122 is a correct answer
57 Correct 95 ms 198392 KB n = 10, 117 is a correct answer
58 Correct 96 ms 198392 KB n = 10, 336 is a correct answer
59 Correct 96 ms 198392 KB n = 10, 438 is a correct answer
60 Correct 93 ms 198392 KB n = 10, 206 is a correct answer
61 Correct 94 ms 198392 KB n = 10, 636 is a correct answer
62 Correct 95 ms 198392 KB n = 4, 2399 is a correct answer
63 Correct 97 ms 198392 KB n = 10, 10992 is a correct answer
64 Correct 102 ms 198392 KB n = 10, 3112 is a correct answer
65 Correct 328 ms 198416 KB n = 100, 51000000001 is a correct answer
66 Correct 113 ms 198392 KB n = 50, 197881272 is a correct answer
67 Correct 325 ms 198392 KB n = 100, 20969 is a correct answer
68 Correct 327 ms 198392 KB n = 100, 20969 is a correct answer
69 Correct 323 ms 198392 KB n = 100, 52000000000 is a correct answer
70 Correct 332 ms 198520 KB n = 100, 285 is a correct answer
71 Correct 330 ms 198520 KB n = 100, 21272 is a correct answer
72 Correct 318 ms 198520 KB n = 100, 12161 is a correct answer
73 Execution timed out 2100 ms 198392 KB Time limit exceeded
74 Halted 0 ms 0 KB -