Submission #1105085

# Submission time Handle Problem Language Result Execution time Memory
1105085 2024-10-25T10:12:00 Z MateiKing80 Uplifting Excursion (BOI22_vault) C++14
80 / 100
5000 ms 18300 KB
#include <bits/stdc++.h>

using namespace std;

const int MAX_M = 300;
int MAX_S;
int MIN_S;
const long long INF = 1e18;
int m;
unordered_map<int, long long> tk, ntk;
unordered_map<int, long long> dp, dpp;

void add(int x, int i)
{
    swap(dp, dpp);

    for(int s = MIN_S; s <= MAX_S; s ++)
        dp[s] = dpp[s];

    for(int s = MIN_S; s - i * x <= MAX_S; s ++)
        if(MIN_S <= s - i * x && s - i * x <= MAX_S)
            dp[s] = max(dp[s], dpp[s - i * x] + x);

    for(int s = MIN_S; s <= MAX_S; s ++)
        dp[s] = (dp[s] <= -INF + m ? -INF : dp[s]);
}

void substract(int x, int i)
{
    swap(dp, dpp);

    for(int s = MIN_S; s <= MAX_S; s ++)
        dp[s] = dpp[s];
    for(int s = MIN_S; s <= MAX_S; s ++)
        if(MIN_S <= s + i * x && s + i * x <= MAX_S)
            dp[s] = max(dp[s], dpp[s + i * x] - x);

    for(int s = MIN_S; s <= MAX_S; s ++)
        dp[s] = (dp[s] <= -INF + m ? -INF : dp[s]);
}

void afis()
{
    for(int s = MIN_S; s <= MAX_S; s ++)
        cout << dp[s] << " ";
    cout << "\n";
}

int main()
{
    long long l, u = 0, t = 0;

    cin >> m >> l;
    MIN_S = -m * m;
    MAX_S = m * m;
    for(int i = -m; i <= m; i ++)
    {
        cin >> ntk[i];
        u += ntk[i];
    }

    if(l < 0)
    {
        for(int i = 1; i <= m; i ++)
            swap(ntk[i], ntk[-i]);
        l = -l;
    }

    long long s = 0;
    for(int i = -m; i <= 0; i ++)
    {
        long long x = ntk[i];
        s += i * x;
        tk[i] += x;
        ntk[i] -= x;
        t += x;
        u -= x;
    }
    for(int i = 1; i <= m; i ++)
    {
        long long x = min(ntk[i], (l - s) / i);
        s += i * x;
        tk[i] += x;
        ntk[i] -= x;
        t += x;
        u -= x;
    }
    if(s + m < l)
    {
        for(int i = -m; i < 0; i ++)
        {
            long long x = min(tk[i], (l - s) / (-i));
            s -= i * x;
            tk[i] -= x;
            ntk[i] += x;
            t -= x;
            u += x;
        }
    }

    for(int s = MIN_S; s <= MAX_S; s ++)
        dp[s] = -INF;
    dp[0] = 0;

    for(int i = -m; i <= m; i ++)
    {
        int k, s;

        s = 0;
        k = min((long long)m, ntk[i]);
        for(int b = 0; s + (1 << b) <= k; s += (1 << b), b ++)
            add((1 << b), i);
        add(k - s, i);

        s = 0;
        k = min((long long)m, tk[i]);
        for(int b = 0; s + (1 << b) <= k; s += (1 << b), b ++)
            substract((1 << b), i);
        substract(k - s, i);
    }


    if(l - s > MAX_S || dp[l - s] == -INF)
        cout << "impossible\n";
    else
        cout << t + dp[l - s] << '\n';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 97 ms 828 KB Output is correct
6 Correct 106 ms 848 KB Output is correct
7 Correct 61 ms 592 KB Output is correct
8 Correct 115 ms 832 KB Output is correct
9 Correct 124 ms 848 KB Output is correct
10 Correct 32 ms 848 KB Output is correct
11 Correct 33 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 97 ms 828 KB Output is correct
6 Correct 106 ms 848 KB Output is correct
7 Correct 61 ms 592 KB Output is correct
8 Correct 115 ms 832 KB Output is correct
9 Correct 124 ms 848 KB Output is correct
10 Correct 32 ms 848 KB Output is correct
11 Correct 33 ms 848 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 99 ms 592 KB Output is correct
17 Correct 105 ms 848 KB Output is correct
18 Correct 58 ms 760 KB Output is correct
19 Correct 121 ms 824 KB Output is correct
20 Correct 130 ms 592 KB Output is correct
21 Correct 33 ms 836 KB Output is correct
22 Correct 33 ms 848 KB Output is correct
23 Correct 935 ms 1872 KB Output is correct
24 Correct 945 ms 2024 KB Output is correct
25 Correct 498 ms 2220 KB Output is correct
26 Correct 1198 ms 2028 KB Output is correct
27 Correct 1150 ms 2024 KB Output is correct
28 Correct 240 ms 2560 KB Output is correct
29 Correct 228 ms 2472 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 13 ms 592 KB Output is correct
3 Correct 9 ms 592 KB Output is correct
4 Correct 14 ms 592 KB Output is correct
5 Correct 19 ms 592 KB Output is correct
6 Correct 21 ms 592 KB Output is correct
7 Correct 9 ms 764 KB Output is correct
8 Correct 8 ms 592 KB Output is correct
9 Correct 10 ms 432 KB Output is correct
10 Correct 12 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 13 ms 592 KB Output is correct
3 Correct 9 ms 592 KB Output is correct
4 Correct 14 ms 592 KB Output is correct
5 Correct 19 ms 592 KB Output is correct
6 Correct 21 ms 592 KB Output is correct
7 Correct 9 ms 764 KB Output is correct
8 Correct 8 ms 592 KB Output is correct
9 Correct 10 ms 432 KB Output is correct
10 Correct 12 ms 592 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 440 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 504 KB Output is correct
15 Correct 14 ms 772 KB Output is correct
16 Correct 9 ms 592 KB Output is correct
17 Correct 15 ms 592 KB Output is correct
18 Correct 15 ms 592 KB Output is correct
19 Correct 14 ms 596 KB Output is correct
20 Correct 8 ms 592 KB Output is correct
21 Correct 8 ms 592 KB Output is correct
22 Correct 11 ms 844 KB Output is correct
23 Correct 12 ms 592 KB Output is correct
24 Correct 22 ms 592 KB Output is correct
25 Correct 13 ms 592 KB Output is correct
26 Correct 22 ms 592 KB Output is correct
27 Correct 19 ms 592 KB Output is correct
28 Correct 20 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 13 ms 592 KB Output is correct
3 Correct 9 ms 592 KB Output is correct
4 Correct 14 ms 592 KB Output is correct
5 Correct 19 ms 592 KB Output is correct
6 Correct 21 ms 592 KB Output is correct
7 Correct 9 ms 764 KB Output is correct
8 Correct 8 ms 592 KB Output is correct
9 Correct 10 ms 432 KB Output is correct
10 Correct 12 ms 592 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 13 ms 592 KB Output is correct
13 Correct 9 ms 592 KB Output is correct
14 Correct 15 ms 592 KB Output is correct
15 Correct 17 ms 592 KB Output is correct
16 Correct 13 ms 592 KB Output is correct
17 Correct 10 ms 592 KB Output is correct
18 Correct 8 ms 592 KB Output is correct
19 Correct 11 ms 592 KB Output is correct
20 Correct 11 ms 592 KB Output is correct
21 Correct 33 ms 848 KB Output is correct
22 Correct 33 ms 840 KB Output is correct
23 Correct 64 ms 828 KB Output is correct
24 Correct 45 ms 592 KB Output is correct
25 Correct 65 ms 840 KB Output is correct
26 Correct 74 ms 836 KB Output is correct
27 Correct 68 ms 848 KB Output is correct
28 Correct 58 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 97 ms 828 KB Output is correct
6 Correct 106 ms 848 KB Output is correct
7 Correct 61 ms 592 KB Output is correct
8 Correct 115 ms 832 KB Output is correct
9 Correct 124 ms 848 KB Output is correct
10 Correct 32 ms 848 KB Output is correct
11 Correct 33 ms 848 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 13 ms 592 KB Output is correct
14 Correct 9 ms 592 KB Output is correct
15 Correct 14 ms 592 KB Output is correct
16 Correct 19 ms 592 KB Output is correct
17 Correct 21 ms 592 KB Output is correct
18 Correct 9 ms 764 KB Output is correct
19 Correct 8 ms 592 KB Output is correct
20 Correct 10 ms 432 KB Output is correct
21 Correct 12 ms 592 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 440 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 504 KB Output is correct
26 Correct 14 ms 772 KB Output is correct
27 Correct 9 ms 592 KB Output is correct
28 Correct 15 ms 592 KB Output is correct
29 Correct 15 ms 592 KB Output is correct
30 Correct 14 ms 596 KB Output is correct
31 Correct 8 ms 592 KB Output is correct
32 Correct 8 ms 592 KB Output is correct
33 Correct 11 ms 844 KB Output is correct
34 Correct 12 ms 592 KB Output is correct
35 Correct 22 ms 592 KB Output is correct
36 Correct 13 ms 592 KB Output is correct
37 Correct 22 ms 592 KB Output is correct
38 Correct 19 ms 592 KB Output is correct
39 Correct 20 ms 592 KB Output is correct
40 Correct 1 ms 336 KB Output is correct
41 Correct 13 ms 592 KB Output is correct
42 Correct 9 ms 592 KB Output is correct
43 Correct 15 ms 592 KB Output is correct
44 Correct 17 ms 592 KB Output is correct
45 Correct 13 ms 592 KB Output is correct
46 Correct 10 ms 592 KB Output is correct
47 Correct 8 ms 592 KB Output is correct
48 Correct 11 ms 592 KB Output is correct
49 Correct 11 ms 592 KB Output is correct
50 Correct 33 ms 848 KB Output is correct
51 Correct 33 ms 840 KB Output is correct
52 Correct 64 ms 828 KB Output is correct
53 Correct 45 ms 592 KB Output is correct
54 Correct 65 ms 840 KB Output is correct
55 Correct 74 ms 836 KB Output is correct
56 Correct 68 ms 848 KB Output is correct
57 Correct 58 ms 848 KB Output is correct
58 Correct 1 ms 336 KB Output is correct
59 Correct 1 ms 336 KB Output is correct
60 Correct 1 ms 336 KB Output is correct
61 Correct 1 ms 336 KB Output is correct
62 Correct 94 ms 828 KB Output is correct
63 Correct 99 ms 592 KB Output is correct
64 Correct 58 ms 596 KB Output is correct
65 Correct 110 ms 592 KB Output is correct
66 Correct 138 ms 592 KB Output is correct
67 Correct 33 ms 848 KB Output is correct
68 Correct 34 ms 840 KB Output is correct
69 Correct 15 ms 592 KB Output is correct
70 Correct 10 ms 592 KB Output is correct
71 Correct 15 ms 592 KB Output is correct
72 Correct 15 ms 604 KB Output is correct
73 Correct 14 ms 592 KB Output is correct
74 Correct 8 ms 592 KB Output is correct
75 Correct 12 ms 592 KB Output is correct
76 Correct 10 ms 592 KB Output is correct
77 Correct 12 ms 592 KB Output is correct
78 Correct 21 ms 592 KB Output is correct
79 Correct 13 ms 592 KB Output is correct
80 Correct 23 ms 336 KB Output is correct
81 Correct 21 ms 596 KB Output is correct
82 Correct 20 ms 592 KB Output is correct
83 Correct 65 ms 840 KB Output is correct
84 Correct 46 ms 592 KB Output is correct
85 Correct 65 ms 836 KB Output is correct
86 Correct 78 ms 836 KB Output is correct
87 Correct 62 ms 852 KB Output is correct
88 Correct 57 ms 836 KB Output is correct
89 Correct 114 ms 592 KB Output is correct
90 Correct 136 ms 592 KB Output is correct
91 Correct 104 ms 848 KB Output is correct
92 Correct 127 ms 592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 13 ms 592 KB Output is correct
3 Correct 9 ms 592 KB Output is correct
4 Correct 14 ms 592 KB Output is correct
5 Correct 19 ms 592 KB Output is correct
6 Correct 21 ms 592 KB Output is correct
7 Correct 9 ms 764 KB Output is correct
8 Correct 8 ms 592 KB Output is correct
9 Correct 10 ms 432 KB Output is correct
10 Correct 12 ms 592 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 13 ms 592 KB Output is correct
13 Correct 9 ms 592 KB Output is correct
14 Correct 15 ms 592 KB Output is correct
15 Correct 17 ms 592 KB Output is correct
16 Correct 13 ms 592 KB Output is correct
17 Correct 10 ms 592 KB Output is correct
18 Correct 8 ms 592 KB Output is correct
19 Correct 11 ms 592 KB Output is correct
20 Correct 11 ms 592 KB Output is correct
21 Correct 33 ms 848 KB Output is correct
22 Correct 33 ms 840 KB Output is correct
23 Correct 64 ms 828 KB Output is correct
24 Correct 45 ms 592 KB Output is correct
25 Correct 65 ms 840 KB Output is correct
26 Correct 74 ms 836 KB Output is correct
27 Correct 68 ms 848 KB Output is correct
28 Correct 58 ms 848 KB Output is correct
29 Correct 2 ms 336 KB Output is correct
30 Correct 14 ms 592 KB Output is correct
31 Correct 9 ms 592 KB Output is correct
32 Correct 16 ms 592 KB Output is correct
33 Correct 15 ms 592 KB Output is correct
34 Correct 13 ms 592 KB Output is correct
35 Correct 11 ms 592 KB Output is correct
36 Correct 8 ms 592 KB Output is correct
37 Correct 11 ms 764 KB Output is correct
38 Correct 12 ms 760 KB Output is correct
39 Correct 33 ms 840 KB Output is correct
40 Correct 33 ms 848 KB Output is correct
41 Correct 65 ms 840 KB Output is correct
42 Correct 45 ms 592 KB Output is correct
43 Correct 66 ms 856 KB Output is correct
44 Correct 84 ms 840 KB Output is correct
45 Correct 64 ms 848 KB Output is correct
46 Correct 57 ms 836 KB Output is correct
47 Correct 250 ms 2464 KB Output is correct
48 Correct 248 ms 2468 KB Output is correct
49 Correct 565 ms 2568 KB Output is correct
50 Correct 351 ms 2120 KB Output is correct
51 Correct 578 ms 2560 KB Output is correct
52 Correct 625 ms 2560 KB Output is correct
53 Correct 511 ms 2560 KB Output is correct
54 Correct 481 ms 2468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 97 ms 828 KB Output is correct
6 Correct 106 ms 848 KB Output is correct
7 Correct 61 ms 592 KB Output is correct
8 Correct 115 ms 832 KB Output is correct
9 Correct 124 ms 848 KB Output is correct
10 Correct 32 ms 848 KB Output is correct
11 Correct 33 ms 848 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 99 ms 592 KB Output is correct
17 Correct 105 ms 848 KB Output is correct
18 Correct 58 ms 760 KB Output is correct
19 Correct 121 ms 824 KB Output is correct
20 Correct 130 ms 592 KB Output is correct
21 Correct 33 ms 836 KB Output is correct
22 Correct 33 ms 848 KB Output is correct
23 Correct 935 ms 1872 KB Output is correct
24 Correct 945 ms 2024 KB Output is correct
25 Correct 498 ms 2220 KB Output is correct
26 Correct 1198 ms 2028 KB Output is correct
27 Correct 1150 ms 2024 KB Output is correct
28 Correct 240 ms 2560 KB Output is correct
29 Correct 228 ms 2472 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
31 Correct 13 ms 592 KB Output is correct
32 Correct 9 ms 592 KB Output is correct
33 Correct 14 ms 592 KB Output is correct
34 Correct 19 ms 592 KB Output is correct
35 Correct 21 ms 592 KB Output is correct
36 Correct 9 ms 764 KB Output is correct
37 Correct 8 ms 592 KB Output is correct
38 Correct 10 ms 432 KB Output is correct
39 Correct 12 ms 592 KB Output is correct
40 Correct 1 ms 336 KB Output is correct
41 Correct 1 ms 440 KB Output is correct
42 Correct 1 ms 336 KB Output is correct
43 Correct 1 ms 504 KB Output is correct
44 Correct 14 ms 772 KB Output is correct
45 Correct 9 ms 592 KB Output is correct
46 Correct 15 ms 592 KB Output is correct
47 Correct 15 ms 592 KB Output is correct
48 Correct 14 ms 596 KB Output is correct
49 Correct 8 ms 592 KB Output is correct
50 Correct 8 ms 592 KB Output is correct
51 Correct 11 ms 844 KB Output is correct
52 Correct 12 ms 592 KB Output is correct
53 Correct 22 ms 592 KB Output is correct
54 Correct 13 ms 592 KB Output is correct
55 Correct 22 ms 592 KB Output is correct
56 Correct 19 ms 592 KB Output is correct
57 Correct 20 ms 592 KB Output is correct
58 Correct 1 ms 336 KB Output is correct
59 Correct 13 ms 592 KB Output is correct
60 Correct 9 ms 592 KB Output is correct
61 Correct 15 ms 592 KB Output is correct
62 Correct 17 ms 592 KB Output is correct
63 Correct 13 ms 592 KB Output is correct
64 Correct 10 ms 592 KB Output is correct
65 Correct 8 ms 592 KB Output is correct
66 Correct 11 ms 592 KB Output is correct
67 Correct 11 ms 592 KB Output is correct
68 Correct 33 ms 848 KB Output is correct
69 Correct 33 ms 840 KB Output is correct
70 Correct 64 ms 828 KB Output is correct
71 Correct 45 ms 592 KB Output is correct
72 Correct 65 ms 840 KB Output is correct
73 Correct 74 ms 836 KB Output is correct
74 Correct 68 ms 848 KB Output is correct
75 Correct 58 ms 848 KB Output is correct
76 Correct 1 ms 336 KB Output is correct
77 Correct 1 ms 336 KB Output is correct
78 Correct 1 ms 336 KB Output is correct
79 Correct 1 ms 336 KB Output is correct
80 Correct 94 ms 828 KB Output is correct
81 Correct 99 ms 592 KB Output is correct
82 Correct 58 ms 596 KB Output is correct
83 Correct 110 ms 592 KB Output is correct
84 Correct 138 ms 592 KB Output is correct
85 Correct 33 ms 848 KB Output is correct
86 Correct 34 ms 840 KB Output is correct
87 Correct 15 ms 592 KB Output is correct
88 Correct 10 ms 592 KB Output is correct
89 Correct 15 ms 592 KB Output is correct
90 Correct 15 ms 604 KB Output is correct
91 Correct 14 ms 592 KB Output is correct
92 Correct 8 ms 592 KB Output is correct
93 Correct 12 ms 592 KB Output is correct
94 Correct 10 ms 592 KB Output is correct
95 Correct 12 ms 592 KB Output is correct
96 Correct 21 ms 592 KB Output is correct
97 Correct 13 ms 592 KB Output is correct
98 Correct 23 ms 336 KB Output is correct
99 Correct 21 ms 596 KB Output is correct
100 Correct 20 ms 592 KB Output is correct
101 Correct 65 ms 840 KB Output is correct
102 Correct 46 ms 592 KB Output is correct
103 Correct 65 ms 836 KB Output is correct
104 Correct 78 ms 836 KB Output is correct
105 Correct 62 ms 852 KB Output is correct
106 Correct 57 ms 836 KB Output is correct
107 Correct 114 ms 592 KB Output is correct
108 Correct 136 ms 592 KB Output is correct
109 Correct 104 ms 848 KB Output is correct
110 Correct 127 ms 592 KB Output is correct
111 Correct 2 ms 336 KB Output is correct
112 Correct 14 ms 592 KB Output is correct
113 Correct 9 ms 592 KB Output is correct
114 Correct 16 ms 592 KB Output is correct
115 Correct 15 ms 592 KB Output is correct
116 Correct 13 ms 592 KB Output is correct
117 Correct 11 ms 592 KB Output is correct
118 Correct 8 ms 592 KB Output is correct
119 Correct 11 ms 764 KB Output is correct
120 Correct 12 ms 760 KB Output is correct
121 Correct 33 ms 840 KB Output is correct
122 Correct 33 ms 848 KB Output is correct
123 Correct 65 ms 840 KB Output is correct
124 Correct 45 ms 592 KB Output is correct
125 Correct 66 ms 856 KB Output is correct
126 Correct 84 ms 840 KB Output is correct
127 Correct 64 ms 848 KB Output is correct
128 Correct 57 ms 836 KB Output is correct
129 Correct 250 ms 2464 KB Output is correct
130 Correct 248 ms 2468 KB Output is correct
131 Correct 565 ms 2568 KB Output is correct
132 Correct 351 ms 2120 KB Output is correct
133 Correct 578 ms 2560 KB Output is correct
134 Correct 625 ms 2560 KB Output is correct
135 Correct 511 ms 2560 KB Output is correct
136 Correct 481 ms 2468 KB Output is correct
137 Correct 1 ms 336 KB Output is correct
138 Correct 1 ms 336 KB Output is correct
139 Correct 1 ms 336 KB Output is correct
140 Correct 1 ms 440 KB Output is correct
141 Correct 93 ms 592 KB Output is correct
142 Correct 104 ms 592 KB Output is correct
143 Correct 60 ms 832 KB Output is correct
144 Correct 111 ms 592 KB Output is correct
145 Correct 133 ms 592 KB Output is correct
146 Correct 33 ms 840 KB Output is correct
147 Correct 33 ms 860 KB Output is correct
148 Correct 836 ms 2128 KB Output is correct
149 Correct 906 ms 2032 KB Output is correct
150 Correct 461 ms 2124 KB Output is correct
151 Correct 1188 ms 1872 KB Output is correct
152 Correct 1187 ms 2028 KB Output is correct
153 Correct 234 ms 2560 KB Output is correct
154 Correct 232 ms 2468 KB Output is correct
155 Correct 14 ms 592 KB Output is correct
156 Correct 10 ms 592 KB Output is correct
157 Correct 16 ms 592 KB Output is correct
158 Correct 15 ms 760 KB Output is correct
159 Correct 13 ms 592 KB Output is correct
160 Correct 8 ms 596 KB Output is correct
161 Correct 8 ms 592 KB Output is correct
162 Correct 11 ms 760 KB Output is correct
163 Correct 12 ms 592 KB Output is correct
164 Correct 65 ms 840 KB Output is correct
165 Correct 70 ms 592 KB Output is correct
166 Correct 63 ms 840 KB Output is correct
167 Correct 80 ms 944 KB Output is correct
168 Correct 68 ms 848 KB Output is correct
169 Correct 57 ms 836 KB Output is correct
170 Correct 19 ms 592 KB Output is correct
171 Correct 13 ms 592 KB Output is correct
172 Correct 23 ms 768 KB Output is correct
173 Correct 19 ms 592 KB Output is correct
174 Correct 20 ms 592 KB Output is correct
175 Correct 112 ms 592 KB Output is correct
176 Correct 138 ms 848 KB Output is correct
177 Correct 117 ms 592 KB Output is correct
178 Correct 104 ms 592 KB Output is correct
179 Correct 524 ms 2484 KB Output is correct
180 Correct 355 ms 1872 KB Output is correct
181 Correct 602 ms 2468 KB Output is correct
182 Correct 622 ms 2588 KB Output is correct
183 Correct 560 ms 2560 KB Output is correct
184 Correct 500 ms 2472 KB Output is correct
185 Correct 947 ms 2028 KB Output is correct
186 Correct 1226 ms 2028 KB Output is correct
187 Correct 1010 ms 2128 KB Output is correct
188 Correct 940 ms 1872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 13 ms 592 KB Output is correct
3 Correct 9 ms 592 KB Output is correct
4 Correct 14 ms 592 KB Output is correct
5 Correct 19 ms 592 KB Output is correct
6 Correct 21 ms 592 KB Output is correct
7 Correct 9 ms 764 KB Output is correct
8 Correct 8 ms 592 KB Output is correct
9 Correct 10 ms 432 KB Output is correct
10 Correct 12 ms 592 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 13 ms 592 KB Output is correct
13 Correct 9 ms 592 KB Output is correct
14 Correct 15 ms 592 KB Output is correct
15 Correct 17 ms 592 KB Output is correct
16 Correct 13 ms 592 KB Output is correct
17 Correct 10 ms 592 KB Output is correct
18 Correct 8 ms 592 KB Output is correct
19 Correct 11 ms 592 KB Output is correct
20 Correct 11 ms 592 KB Output is correct
21 Correct 33 ms 848 KB Output is correct
22 Correct 33 ms 840 KB Output is correct
23 Correct 64 ms 828 KB Output is correct
24 Correct 45 ms 592 KB Output is correct
25 Correct 65 ms 840 KB Output is correct
26 Correct 74 ms 836 KB Output is correct
27 Correct 68 ms 848 KB Output is correct
28 Correct 58 ms 848 KB Output is correct
29 Correct 2 ms 336 KB Output is correct
30 Correct 14 ms 592 KB Output is correct
31 Correct 9 ms 592 KB Output is correct
32 Correct 16 ms 592 KB Output is correct
33 Correct 15 ms 592 KB Output is correct
34 Correct 13 ms 592 KB Output is correct
35 Correct 11 ms 592 KB Output is correct
36 Correct 8 ms 592 KB Output is correct
37 Correct 11 ms 764 KB Output is correct
38 Correct 12 ms 760 KB Output is correct
39 Correct 33 ms 840 KB Output is correct
40 Correct 33 ms 848 KB Output is correct
41 Correct 65 ms 840 KB Output is correct
42 Correct 45 ms 592 KB Output is correct
43 Correct 66 ms 856 KB Output is correct
44 Correct 84 ms 840 KB Output is correct
45 Correct 64 ms 848 KB Output is correct
46 Correct 57 ms 836 KB Output is correct
47 Correct 250 ms 2464 KB Output is correct
48 Correct 248 ms 2468 KB Output is correct
49 Correct 565 ms 2568 KB Output is correct
50 Correct 351 ms 2120 KB Output is correct
51 Correct 578 ms 2560 KB Output is correct
52 Correct 625 ms 2560 KB Output is correct
53 Correct 511 ms 2560 KB Output is correct
54 Correct 481 ms 2468 KB Output is correct
55 Correct 1 ms 336 KB Output is correct
56 Correct 13 ms 596 KB Output is correct
57 Correct 10 ms 760 KB Output is correct
58 Correct 14 ms 620 KB Output is correct
59 Correct 15 ms 596 KB Output is correct
60 Correct 14 ms 592 KB Output is correct
61 Correct 9 ms 592 KB Output is correct
62 Correct 9 ms 592 KB Output is correct
63 Correct 11 ms 592 KB Output is correct
64 Correct 12 ms 592 KB Output is correct
65 Correct 48 ms 840 KB Output is correct
66 Correct 34 ms 840 KB Output is correct
67 Correct 65 ms 840 KB Output is correct
68 Correct 47 ms 592 KB Output is correct
69 Correct 65 ms 840 KB Output is correct
70 Correct 78 ms 1016 KB Output is correct
71 Correct 70 ms 996 KB Output is correct
72 Correct 56 ms 832 KB Output is correct
73 Correct 224 ms 2460 KB Output is correct
74 Correct 229 ms 2468 KB Output is correct
75 Correct 545 ms 2472 KB Output is correct
76 Correct 384 ms 1872 KB Output is correct
77 Correct 597 ms 2560 KB Output is correct
78 Correct 617 ms 2696 KB Output is correct
79 Correct 534 ms 2548 KB Output is correct
80 Correct 501 ms 2464 KB Output is correct
81 Execution timed out 5054 ms 18300 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 97 ms 828 KB Output is correct
6 Correct 106 ms 848 KB Output is correct
7 Correct 61 ms 592 KB Output is correct
8 Correct 115 ms 832 KB Output is correct
9 Correct 124 ms 848 KB Output is correct
10 Correct 32 ms 848 KB Output is correct
11 Correct 33 ms 848 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 99 ms 592 KB Output is correct
17 Correct 105 ms 848 KB Output is correct
18 Correct 58 ms 760 KB Output is correct
19 Correct 121 ms 824 KB Output is correct
20 Correct 130 ms 592 KB Output is correct
21 Correct 33 ms 836 KB Output is correct
22 Correct 33 ms 848 KB Output is correct
23 Correct 935 ms 1872 KB Output is correct
24 Correct 945 ms 2024 KB Output is correct
25 Correct 498 ms 2220 KB Output is correct
26 Correct 1198 ms 2028 KB Output is correct
27 Correct 1150 ms 2024 KB Output is correct
28 Correct 240 ms 2560 KB Output is correct
29 Correct 228 ms 2472 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
31 Correct 13 ms 592 KB Output is correct
32 Correct 9 ms 592 KB Output is correct
33 Correct 14 ms 592 KB Output is correct
34 Correct 19 ms 592 KB Output is correct
35 Correct 21 ms 592 KB Output is correct
36 Correct 9 ms 764 KB Output is correct
37 Correct 8 ms 592 KB Output is correct
38 Correct 10 ms 432 KB Output is correct
39 Correct 12 ms 592 KB Output is correct
40 Correct 1 ms 336 KB Output is correct
41 Correct 1 ms 440 KB Output is correct
42 Correct 1 ms 336 KB Output is correct
43 Correct 1 ms 504 KB Output is correct
44 Correct 14 ms 772 KB Output is correct
45 Correct 9 ms 592 KB Output is correct
46 Correct 15 ms 592 KB Output is correct
47 Correct 15 ms 592 KB Output is correct
48 Correct 14 ms 596 KB Output is correct
49 Correct 8 ms 592 KB Output is correct
50 Correct 8 ms 592 KB Output is correct
51 Correct 11 ms 844 KB Output is correct
52 Correct 12 ms 592 KB Output is correct
53 Correct 22 ms 592 KB Output is correct
54 Correct 13 ms 592 KB Output is correct
55 Correct 22 ms 592 KB Output is correct
56 Correct 19 ms 592 KB Output is correct
57 Correct 20 ms 592 KB Output is correct
58 Correct 1 ms 336 KB Output is correct
59 Correct 13 ms 592 KB Output is correct
60 Correct 9 ms 592 KB Output is correct
61 Correct 15 ms 592 KB Output is correct
62 Correct 17 ms 592 KB Output is correct
63 Correct 13 ms 592 KB Output is correct
64 Correct 10 ms 592 KB Output is correct
65 Correct 8 ms 592 KB Output is correct
66 Correct 11 ms 592 KB Output is correct
67 Correct 11 ms 592 KB Output is correct
68 Correct 33 ms 848 KB Output is correct
69 Correct 33 ms 840 KB Output is correct
70 Correct 64 ms 828 KB Output is correct
71 Correct 45 ms 592 KB Output is correct
72 Correct 65 ms 840 KB Output is correct
73 Correct 74 ms 836 KB Output is correct
74 Correct 68 ms 848 KB Output is correct
75 Correct 58 ms 848 KB Output is correct
76 Correct 1 ms 336 KB Output is correct
77 Correct 1 ms 336 KB Output is correct
78 Correct 1 ms 336 KB Output is correct
79 Correct 1 ms 336 KB Output is correct
80 Correct 94 ms 828 KB Output is correct
81 Correct 99 ms 592 KB Output is correct
82 Correct 58 ms 596 KB Output is correct
83 Correct 110 ms 592 KB Output is correct
84 Correct 138 ms 592 KB Output is correct
85 Correct 33 ms 848 KB Output is correct
86 Correct 34 ms 840 KB Output is correct
87 Correct 15 ms 592 KB Output is correct
88 Correct 10 ms 592 KB Output is correct
89 Correct 15 ms 592 KB Output is correct
90 Correct 15 ms 604 KB Output is correct
91 Correct 14 ms 592 KB Output is correct
92 Correct 8 ms 592 KB Output is correct
93 Correct 12 ms 592 KB Output is correct
94 Correct 10 ms 592 KB Output is correct
95 Correct 12 ms 592 KB Output is correct
96 Correct 21 ms 592 KB Output is correct
97 Correct 13 ms 592 KB Output is correct
98 Correct 23 ms 336 KB Output is correct
99 Correct 21 ms 596 KB Output is correct
100 Correct 20 ms 592 KB Output is correct
101 Correct 65 ms 840 KB Output is correct
102 Correct 46 ms 592 KB Output is correct
103 Correct 65 ms 836 KB Output is correct
104 Correct 78 ms 836 KB Output is correct
105 Correct 62 ms 852 KB Output is correct
106 Correct 57 ms 836 KB Output is correct
107 Correct 114 ms 592 KB Output is correct
108 Correct 136 ms 592 KB Output is correct
109 Correct 104 ms 848 KB Output is correct
110 Correct 127 ms 592 KB Output is correct
111 Correct 2 ms 336 KB Output is correct
112 Correct 14 ms 592 KB Output is correct
113 Correct 9 ms 592 KB Output is correct
114 Correct 16 ms 592 KB Output is correct
115 Correct 15 ms 592 KB Output is correct
116 Correct 13 ms 592 KB Output is correct
117 Correct 11 ms 592 KB Output is correct
118 Correct 8 ms 592 KB Output is correct
119 Correct 11 ms 764 KB Output is correct
120 Correct 12 ms 760 KB Output is correct
121 Correct 33 ms 840 KB Output is correct
122 Correct 33 ms 848 KB Output is correct
123 Correct 65 ms 840 KB Output is correct
124 Correct 45 ms 592 KB Output is correct
125 Correct 66 ms 856 KB Output is correct
126 Correct 84 ms 840 KB Output is correct
127 Correct 64 ms 848 KB Output is correct
128 Correct 57 ms 836 KB Output is correct
129 Correct 250 ms 2464 KB Output is correct
130 Correct 248 ms 2468 KB Output is correct
131 Correct 565 ms 2568 KB Output is correct
132 Correct 351 ms 2120 KB Output is correct
133 Correct 578 ms 2560 KB Output is correct
134 Correct 625 ms 2560 KB Output is correct
135 Correct 511 ms 2560 KB Output is correct
136 Correct 481 ms 2468 KB Output is correct
137 Correct 1 ms 336 KB Output is correct
138 Correct 1 ms 336 KB Output is correct
139 Correct 1 ms 336 KB Output is correct
140 Correct 1 ms 440 KB Output is correct
141 Correct 93 ms 592 KB Output is correct
142 Correct 104 ms 592 KB Output is correct
143 Correct 60 ms 832 KB Output is correct
144 Correct 111 ms 592 KB Output is correct
145 Correct 133 ms 592 KB Output is correct
146 Correct 33 ms 840 KB Output is correct
147 Correct 33 ms 860 KB Output is correct
148 Correct 836 ms 2128 KB Output is correct
149 Correct 906 ms 2032 KB Output is correct
150 Correct 461 ms 2124 KB Output is correct
151 Correct 1188 ms 1872 KB Output is correct
152 Correct 1187 ms 2028 KB Output is correct
153 Correct 234 ms 2560 KB Output is correct
154 Correct 232 ms 2468 KB Output is correct
155 Correct 14 ms 592 KB Output is correct
156 Correct 10 ms 592 KB Output is correct
157 Correct 16 ms 592 KB Output is correct
158 Correct 15 ms 760 KB Output is correct
159 Correct 13 ms 592 KB Output is correct
160 Correct 8 ms 596 KB Output is correct
161 Correct 8 ms 592 KB Output is correct
162 Correct 11 ms 760 KB Output is correct
163 Correct 12 ms 592 KB Output is correct
164 Correct 65 ms 840 KB Output is correct
165 Correct 70 ms 592 KB Output is correct
166 Correct 63 ms 840 KB Output is correct
167 Correct 80 ms 944 KB Output is correct
168 Correct 68 ms 848 KB Output is correct
169 Correct 57 ms 836 KB Output is correct
170 Correct 19 ms 592 KB Output is correct
171 Correct 13 ms 592 KB Output is correct
172 Correct 23 ms 768 KB Output is correct
173 Correct 19 ms 592 KB Output is correct
174 Correct 20 ms 592 KB Output is correct
175 Correct 112 ms 592 KB Output is correct
176 Correct 138 ms 848 KB Output is correct
177 Correct 117 ms 592 KB Output is correct
178 Correct 104 ms 592 KB Output is correct
179 Correct 524 ms 2484 KB Output is correct
180 Correct 355 ms 1872 KB Output is correct
181 Correct 602 ms 2468 KB Output is correct
182 Correct 622 ms 2588 KB Output is correct
183 Correct 560 ms 2560 KB Output is correct
184 Correct 500 ms 2472 KB Output is correct
185 Correct 947 ms 2028 KB Output is correct
186 Correct 1226 ms 2028 KB Output is correct
187 Correct 1010 ms 2128 KB Output is correct
188 Correct 940 ms 1872 KB Output is correct
189 Correct 1 ms 336 KB Output is correct
190 Correct 13 ms 596 KB Output is correct
191 Correct 10 ms 760 KB Output is correct
192 Correct 14 ms 620 KB Output is correct
193 Correct 15 ms 596 KB Output is correct
194 Correct 14 ms 592 KB Output is correct
195 Correct 9 ms 592 KB Output is correct
196 Correct 9 ms 592 KB Output is correct
197 Correct 11 ms 592 KB Output is correct
198 Correct 12 ms 592 KB Output is correct
199 Correct 48 ms 840 KB Output is correct
200 Correct 34 ms 840 KB Output is correct
201 Correct 65 ms 840 KB Output is correct
202 Correct 47 ms 592 KB Output is correct
203 Correct 65 ms 840 KB Output is correct
204 Correct 78 ms 1016 KB Output is correct
205 Correct 70 ms 996 KB Output is correct
206 Correct 56 ms 832 KB Output is correct
207 Correct 224 ms 2460 KB Output is correct
208 Correct 229 ms 2468 KB Output is correct
209 Correct 545 ms 2472 KB Output is correct
210 Correct 384 ms 1872 KB Output is correct
211 Correct 597 ms 2560 KB Output is correct
212 Correct 617 ms 2696 KB Output is correct
213 Correct 534 ms 2548 KB Output is correct
214 Correct 501 ms 2464 KB Output is correct
215 Execution timed out 5054 ms 18300 KB Time limit exceeded
216 Halted 0 ms 0 KB -