Submission #719457

# Submission time Handle Problem Language Result Execution time Memory
719457 2023-04-05T23:11:15 Z somethingnew Radio Towers (IOI22_towers) C++17
100 / 100
3953 ms 132352 KB
//  ↘ ⬇ ⬇ ⬇ ⬇ ⬇ ↙
//  ➡ @roadfromroi ⬅
//  ↗ ⬆ ⬆ ⬆ ⬆ ⬆ ↖
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#include "queue"
//#include "towers.h"
#define all(x) x.begin(), x.end()
using namespace std;

vector<int> h;
int dd;
struct node {
    int lval;
    int rval;
    int cnt;
    int lstenka;
    int rstenka;
    node() {}
    node(int x) {
        lval = rval = x;
        cnt = 1;
        lstenka = 0;
        rstenka = 0;
    }
    void swapchik() {
        swap(lval, rval);
        swap(lstenka, rstenka);
    }
};

void merge(node &a, node b) {
    bool swp = 0;
    if (a.rval > b.lval) {
        swp = 1;
        a.swapchik();
        b.swapchik();
        swap(a, b);
    }
    if (max(a.rstenka, b.lstenka) - dd >= max(a.rval, b.lval)) {
        a.cnt = a.cnt + b.cnt;
        a.rstenka = b.rstenka;
        a.rval = b.rval;
        if (swp)
            a.swapchik();
        return;
    } else {
        a.cnt = a.cnt + b.cnt - 1;
        if (b.cnt != 1) {
            a.rstenka = b.rstenka;
            a.rval = b.rval;
        } else {
          //  cout << c.rstenka << ' ';
            a.rstenka = max(a.rstenka, max(b.rstenka, max(b.lstenka, b.rval)));
          //  cout << c.rstenka << '\n';
        }
        if (swp)
            a.swapchik();
        return;
    }
}
struct kornihunka{
    vector<int> elems;
    node nd;
    void push(int x) {
        elems.push_back(x);
    }
    node get(int l, int r) {
        r = min(r, (int)elems.size() - 1);
        node nres(elems[l]);
        for (int i = l + 1; i <= r; ++i) {
            merge(nres, node(elems[i]));
        }
        return nres;
    }
    int calc() {
        int incdd = -1;
        nd = node(elems[0]);
        int cc = 1;
        int pr3 = 2e9;
        for (int i = 1; i < elems.size(); ++i) {
            int pr = nd.rval, pr2 = nd.rstenka;
            merge(nd, elems[i]);
            if (nd.cnt != cc) {
                cc = nd.cnt;
                if (incdd == -1)
                    incdd = min(pr2 - dd - pr, pr3 - dd - pr);
                incdd = min(incdd, min(pr2 - dd - pr, pr3 - dd - pr));
                pr3 = pr2;
            }
        }
        incdd = min(incdd, pr3 - dd - nd.rval);
        if (nd.cnt == 1)
            return 0;
        return incdd + 1;
    }
    node getnode() {
        return nd;
    }
};
int K = 317;
vector<vector<kornihunka>> vecnode;
vector<vector<int>> detki;
vector<vector<int>> realdetki;
vector<int> alex;
int calcedd = 0;
void init(int n, vector<int> hh) {
    h = hh;
    vecnode.assign((n + K - 1) / K, vector<kornihunka>(K));
    detki.assign((n + K - 1) / K, {});
    for (int i = 0; i < n; ++i) {
        vecnode[i/K][0].push(h[i]);
    }
    for (int i = 0; i < vecnode.size(); ++i) {
        int j = 0;
        int inc = 1;
        dd = 0;
        do {
            dd += inc;
            detki[i].push_back(dd);
            alex.push_back(dd);
            vecnode[i][j + 1] = vecnode[i][j];
            inc = vecnode[i][j].calc();
            j++;
        } while (inc != 0);
    }
    sort(all(alex));
    alex.erase(unique(all(alex)), alex.end());
    realdetki.assign(vecnode.size(), vector<int>(alex.size()));
    for (int i = 0; i < vecnode.size(); ++i) {
        int j = 0;
        for (int pvl = 0; pvl < alex.size(); ++pvl) {
            while (j + 1 != detki[i].size() and detki[i][j + 1] <= alex[pvl]) {
                j++;
            }
            realdetki[i][pvl] = j;
        }
    }
}
int max_towers(int L, int R, int D) {
    node res(2e9);
    dd = D;
    int dvl = upper_bound(all(alex), dd) - alex.begin()-1;
    if (L / K == R / K) {
        //cout << upper_bound(all(detki[L/K]), dd) - detki[L/K].begin()-1 << '\n';
   //     cout << res.rval << ' ' << res.rstenka << ' ' << res.cnt << '\n';
        merge(res, vecnode[L/K][realdetki[L/K][dvl]].get(L % K, R % K));
        return res.cnt;
    }
    if (L % K != 0) {
      //  cout << res.rval << ' ' << res.rstenka << ' ' << res.cnt << '\n';
        merge(res, vecnode[L/K][realdetki[L/K][dvl]].get(L % K, K - 1));
        L = L / K * K + K;
    }
    while (L + K <= R + 1) {
        //cout << "TT " << res.rval << ' ' << res.rstenka << ' ' << res.cnt << '\n';
        node res2 = vecnode[L/K][0].getnode();
        //cout << "TT2 " << res2.lval << ' ' << res2.lstenka << ' ' << res2.cnt << '\n';
        merge(res, vecnode[L/K][realdetki[L/K][dvl]].getnode());
        //cout << "TT3 " << res.rval << ' ' << res.rstenka << ' ' << res.cnt << '\n';

        L += K;
    }
    if (L <= R) {
       // cout << res.rval << ' ' << res.rstenka << ' ' << res.cnt << '\n';
        merge(res, vecnode[L/K][realdetki[L/K][dvl]].get(L % K, R % K));
    }
   // cout << res.rval << ' ' << res.rstenka << ' ' << res.cnt << '\n';
    return res.cnt;
}
/*
int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    init(n, a);
    for (int i = 0; i < m; ++i) {
        int q1, q2, q3;
        cin >> q1 >> q2 >> q3;
        cout << max_towers(q1,q2,q3) << '\n';
    }
}*/
/*
7 1
10 20 60 40 50 30 70
0 6 17
 */

Compilation message

towers.cpp: In member function 'int kornihunka::calc()':
towers.cpp:91:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   91 |         for (int i = 1; i < elems.size(); ++i) {
      |                         ~~^~~~~~~~~~~~~~
towers.cpp: In function 'void init(int, std::vector<int>)':
towers.cpp:124:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<kornihunka> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  124 |     for (int i = 0; i < vecnode.size(); ++i) {
      |                     ~~^~~~~~~~~~~~~~~~
towers.cpp:140:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<kornihunka> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  140 |     for (int i = 0; i < vecnode.size(); ++i) {
      |                     ~~^~~~~~~~~~~~~~~~
towers.cpp:142:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  142 |         for (int pvl = 0; pvl < alex.size(); ++pvl) {
      |                           ~~~~^~~~~~~~~~~~~
towers.cpp:143:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  143 |             while (j + 1 != detki[i].size() and detki[i][j + 1] <= alex[pvl]) {
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:167:14: warning: variable 'res2' set but not used [-Wunused-but-set-variable]
  167 |         node res2 = vecnode[L/K][0].getnode();
      |              ^~~~
# Verdict Execution time Memory Grader output
1 Correct 633 ms 4432 KB Output is correct
2 Correct 1467 ms 7200 KB Output is correct
3 Correct 1445 ms 7224 KB Output is correct
4 Correct 1426 ms 7240 KB Output is correct
5 Correct 1609 ms 7220 KB Output is correct
6 Correct 1423 ms 7240 KB Output is correct
7 Correct 1710 ms 7196 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 5 ms 1232 KB Output is correct
3 Correct 5 ms 1232 KB Output is correct
4 Correct 7 ms 1604 KB Output is correct
5 Correct 7 ms 1688 KB Output is correct
6 Correct 7 ms 1616 KB Output is correct
7 Correct 7 ms 1616 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 5 ms 1232 KB Output is correct
16 Correct 7 ms 1676 KB Output is correct
17 Correct 8 ms 1592 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 5 ms 1236 KB Output is correct
21 Correct 7 ms 1676 KB Output is correct
22 Correct 7 ms 1616 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 2 ms 720 KB Output is correct
26 Correct 5 ms 1232 KB Output is correct
27 Correct 5 ms 1232 KB Output is correct
28 Correct 8 ms 1616 KB Output is correct
29 Correct 8 ms 1608 KB Output is correct
30 Correct 7 ms 1616 KB Output is correct
31 Correct 7 ms 1620 KB Output is correct
32 Correct 1 ms 336 KB Output is correct
33 Correct 1 ms 336 KB Output is correct
34 Correct 1 ms 336 KB Output is correct
35 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 5 ms 1232 KB Output is correct
3 Correct 5 ms 1232 KB Output is correct
4 Correct 7 ms 1604 KB Output is correct
5 Correct 7 ms 1688 KB Output is correct
6 Correct 7 ms 1616 KB Output is correct
7 Correct 7 ms 1616 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 5 ms 1232 KB Output is correct
16 Correct 7 ms 1676 KB Output is correct
17 Correct 8 ms 1592 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 5 ms 1236 KB Output is correct
21 Correct 7 ms 1676 KB Output is correct
22 Correct 7 ms 1616 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 2 ms 720 KB Output is correct
26 Correct 5 ms 1232 KB Output is correct
27 Correct 5 ms 1232 KB Output is correct
28 Correct 8 ms 1616 KB Output is correct
29 Correct 8 ms 1608 KB Output is correct
30 Correct 7 ms 1616 KB Output is correct
31 Correct 7 ms 1620 KB Output is correct
32 Correct 1 ms 336 KB Output is correct
33 Correct 1 ms 336 KB Output is correct
34 Correct 1 ms 336 KB Output is correct
35 Correct 1 ms 336 KB Output is correct
36 Correct 166 ms 49240 KB Output is correct
37 Correct 276 ms 90512 KB Output is correct
38 Correct 266 ms 89784 KB Output is correct
39 Correct 391 ms 132156 KB Output is correct
40 Correct 384 ms 132296 KB Output is correct
41 Correct 389 ms 132252 KB Output is correct
42 Correct 383 ms 132216 KB Output is correct
43 Correct 23 ms 7216 KB Output is correct
44 Correct 19 ms 7200 KB Output is correct
45 Correct 16 ms 7200 KB Output is correct
46 Correct 17 ms 7248 KB Output is correct
47 Correct 266 ms 89924 KB Output is correct
48 Correct 391 ms 132236 KB Output is correct
49 Correct 382 ms 132340 KB Output is correct
50 Correct 17 ms 7184 KB Output is correct
51 Correct 18 ms 7192 KB Output is correct
52 Correct 262 ms 89824 KB Output is correct
53 Correct 390 ms 132120 KB Output is correct
54 Correct 383 ms 132100 KB Output is correct
55 Correct 16 ms 7196 KB Output is correct
56 Correct 16 ms 7248 KB Output is correct
57 Correct 254 ms 85796 KB Output is correct
58 Correct 260 ms 90152 KB Output is correct
59 Correct 264 ms 90272 KB Output is correct
60 Correct 389 ms 132136 KB Output is correct
61 Correct 384 ms 132164 KB Output is correct
62 Correct 381 ms 132184 KB Output is correct
63 Correct 387 ms 132288 KB Output is correct
64 Correct 25 ms 7200 KB Output is correct
65 Correct 17 ms 7204 KB Output is correct
66 Correct 24 ms 7200 KB Output is correct
67 Correct 17 ms 7192 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1464 ms 88996 KB Output is correct
2 Correct 1943 ms 90052 KB Output is correct
3 Correct 1812 ms 90016 KB Output is correct
4 Correct 2191 ms 132156 KB Output is correct
5 Correct 2112 ms 132148 KB Output is correct
6 Correct 1948 ms 132072 KB Output is correct
7 Correct 2037 ms 132100 KB Output is correct
8 Correct 1357 ms 7240 KB Output is correct
9 Correct 1866 ms 7196 KB Output is correct
10 Correct 1351 ms 7192 KB Output is correct
11 Correct 1827 ms 7208 KB Output is correct
12 Correct 1301 ms 7196 KB Output is correct
13 Correct 1819 ms 7248 KB Output is correct
14 Correct 0 ms 208 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 259 ms 89880 KB Output is correct
18 Correct 386 ms 132168 KB Output is correct
19 Correct 391 ms 132352 KB Output is correct
20 Correct 16 ms 7204 KB Output is correct
21 Correct 16 ms 7216 KB Output is correct
22 Correct 256 ms 89940 KB Output is correct
23 Correct 385 ms 132200 KB Output is correct
24 Correct 379 ms 132064 KB Output is correct
25 Correct 16 ms 7248 KB Output is correct
26 Correct 16 ms 7240 KB Output is correct
27 Correct 5 ms 1232 KB Output is correct
28 Correct 7 ms 1616 KB Output is correct
29 Correct 8 ms 1616 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
31 Correct 1 ms 336 KB Output is correct
32 Correct 5 ms 1232 KB Output is correct
33 Correct 7 ms 1616 KB Output is correct
34 Correct 7 ms 1616 KB Output is correct
35 Correct 1 ms 336 KB Output is correct
36 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 452 ms 14336 KB Output is correct
2 Correct 3762 ms 90120 KB Output is correct
3 Correct 3718 ms 90160 KB Output is correct
4 Correct 3953 ms 132080 KB Output is correct
5 Correct 3772 ms 132144 KB Output is correct
6 Correct 3899 ms 132228 KB Output is correct
7 Correct 3353 ms 132164 KB Output is correct
8 Correct 1339 ms 7240 KB Output is correct
9 Correct 1939 ms 7200 KB Output is correct
10 Correct 1429 ms 7240 KB Output is correct
11 Correct 1842 ms 7180 KB Output is correct
12 Correct 258 ms 89924 KB Output is correct
13 Correct 379 ms 132124 KB Output is correct
14 Correct 388 ms 132164 KB Output is correct
15 Correct 17 ms 7248 KB Output is correct
16 Correct 23 ms 7212 KB Output is correct
17 Correct 247 ms 85660 KB Output is correct
18 Correct 263 ms 90160 KB Output is correct
19 Correct 255 ms 90268 KB Output is correct
20 Correct 385 ms 132132 KB Output is correct
21 Correct 381 ms 132060 KB Output is correct
22 Correct 389 ms 132272 KB Output is correct
23 Correct 383 ms 132144 KB Output is correct
24 Correct 16 ms 7216 KB Output is correct
25 Correct 17 ms 7192 KB Output is correct
26 Correct 19 ms 7184 KB Output is correct
27 Correct 21 ms 7240 KB Output is correct
28 Correct 5 ms 1232 KB Output is correct
29 Correct 7 ms 1616 KB Output is correct
30 Correct 7 ms 1576 KB Output is correct
31 Correct 1 ms 336 KB Output is correct
32 Correct 1 ms 336 KB Output is correct
33 Correct 3 ms 720 KB Output is correct
34 Correct 5 ms 1232 KB Output is correct
35 Correct 5 ms 1232 KB Output is correct
36 Correct 7 ms 1616 KB Output is correct
37 Correct 8 ms 1616 KB Output is correct
38 Correct 7 ms 1616 KB Output is correct
39 Correct 7 ms 1632 KB Output is correct
40 Correct 1 ms 336 KB Output is correct
41 Correct 1 ms 336 KB Output is correct
42 Correct 1 ms 336 KB Output is correct
43 Correct 1 ms 420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 5 ms 1232 KB Output is correct
3 Correct 5 ms 1232 KB Output is correct
4 Correct 7 ms 1604 KB Output is correct
5 Correct 7 ms 1688 KB Output is correct
6 Correct 7 ms 1616 KB Output is correct
7 Correct 7 ms 1616 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 5 ms 1232 KB Output is correct
16 Correct 7 ms 1676 KB Output is correct
17 Correct 8 ms 1592 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 5 ms 1236 KB Output is correct
21 Correct 7 ms 1676 KB Output is correct
22 Correct 7 ms 1616 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 2 ms 720 KB Output is correct
26 Correct 5 ms 1232 KB Output is correct
27 Correct 5 ms 1232 KB Output is correct
28 Correct 8 ms 1616 KB Output is correct
29 Correct 8 ms 1608 KB Output is correct
30 Correct 7 ms 1616 KB Output is correct
31 Correct 7 ms 1620 KB Output is correct
32 Correct 1 ms 336 KB Output is correct
33 Correct 1 ms 336 KB Output is correct
34 Correct 1 ms 336 KB Output is correct
35 Correct 1 ms 336 KB Output is correct
36 Correct 166 ms 49240 KB Output is correct
37 Correct 276 ms 90512 KB Output is correct
38 Correct 266 ms 89784 KB Output is correct
39 Correct 391 ms 132156 KB Output is correct
40 Correct 384 ms 132296 KB Output is correct
41 Correct 389 ms 132252 KB Output is correct
42 Correct 383 ms 132216 KB Output is correct
43 Correct 23 ms 7216 KB Output is correct
44 Correct 19 ms 7200 KB Output is correct
45 Correct 16 ms 7200 KB Output is correct
46 Correct 17 ms 7248 KB Output is correct
47 Correct 266 ms 89924 KB Output is correct
48 Correct 391 ms 132236 KB Output is correct
49 Correct 382 ms 132340 KB Output is correct
50 Correct 17 ms 7184 KB Output is correct
51 Correct 18 ms 7192 KB Output is correct
52 Correct 262 ms 89824 KB Output is correct
53 Correct 390 ms 132120 KB Output is correct
54 Correct 383 ms 132100 KB Output is correct
55 Correct 16 ms 7196 KB Output is correct
56 Correct 16 ms 7248 KB Output is correct
57 Correct 254 ms 85796 KB Output is correct
58 Correct 260 ms 90152 KB Output is correct
59 Correct 264 ms 90272 KB Output is correct
60 Correct 389 ms 132136 KB Output is correct
61 Correct 384 ms 132164 KB Output is correct
62 Correct 381 ms 132184 KB Output is correct
63 Correct 387 ms 132288 KB Output is correct
64 Correct 25 ms 7200 KB Output is correct
65 Correct 17 ms 7204 KB Output is correct
66 Correct 24 ms 7200 KB Output is correct
67 Correct 17 ms 7192 KB Output is correct
68 Correct 1464 ms 88996 KB Output is correct
69 Correct 1943 ms 90052 KB Output is correct
70 Correct 1812 ms 90016 KB Output is correct
71 Correct 2191 ms 132156 KB Output is correct
72 Correct 2112 ms 132148 KB Output is correct
73 Correct 1948 ms 132072 KB Output is correct
74 Correct 2037 ms 132100 KB Output is correct
75 Correct 1357 ms 7240 KB Output is correct
76 Correct 1866 ms 7196 KB Output is correct
77 Correct 1351 ms 7192 KB Output is correct
78 Correct 1827 ms 7208 KB Output is correct
79 Correct 1301 ms 7196 KB Output is correct
80 Correct 1819 ms 7248 KB Output is correct
81 Correct 0 ms 208 KB Output is correct
82 Correct 1 ms 336 KB Output is correct
83 Correct 1 ms 336 KB Output is correct
84 Correct 259 ms 89880 KB Output is correct
85 Correct 386 ms 132168 KB Output is correct
86 Correct 391 ms 132352 KB Output is correct
87 Correct 16 ms 7204 KB Output is correct
88 Correct 16 ms 7216 KB Output is correct
89 Correct 256 ms 89940 KB Output is correct
90 Correct 385 ms 132200 KB Output is correct
91 Correct 379 ms 132064 KB Output is correct
92 Correct 16 ms 7248 KB Output is correct
93 Correct 16 ms 7240 KB Output is correct
94 Correct 5 ms 1232 KB Output is correct
95 Correct 7 ms 1616 KB Output is correct
96 Correct 8 ms 1616 KB Output is correct
97 Correct 1 ms 336 KB Output is correct
98 Correct 1 ms 336 KB Output is correct
99 Correct 5 ms 1232 KB Output is correct
100 Correct 7 ms 1616 KB Output is correct
101 Correct 7 ms 1616 KB Output is correct
102 Correct 1 ms 336 KB Output is correct
103 Correct 1 ms 336 KB Output is correct
104 Correct 1811 ms 76208 KB Output is correct
105 Correct 2013 ms 89720 KB Output is correct
106 Correct 2103 ms 90288 KB Output is correct
107 Correct 2121 ms 132120 KB Output is correct
108 Correct 2207 ms 132136 KB Output is correct
109 Correct 2221 ms 132096 KB Output is correct
110 Correct 2136 ms 132168 KB Output is correct
111 Correct 1497 ms 7248 KB Output is correct
112 Correct 1905 ms 7240 KB Output is correct
113 Correct 1507 ms 7180 KB Output is correct
114 Correct 1934 ms 7204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 633 ms 4432 KB Output is correct
2 Correct 1467 ms 7200 KB Output is correct
3 Correct 1445 ms 7224 KB Output is correct
4 Correct 1426 ms 7240 KB Output is correct
5 Correct 1609 ms 7220 KB Output is correct
6 Correct 1423 ms 7240 KB Output is correct
7 Correct 1710 ms 7196 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 464 KB Output is correct
12 Correct 5 ms 1232 KB Output is correct
13 Correct 5 ms 1232 KB Output is correct
14 Correct 7 ms 1604 KB Output is correct
15 Correct 7 ms 1688 KB Output is correct
16 Correct 7 ms 1616 KB Output is correct
17 Correct 7 ms 1616 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 0 ms 208 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 5 ms 1232 KB Output is correct
26 Correct 7 ms 1676 KB Output is correct
27 Correct 8 ms 1592 KB Output is correct
28 Correct 1 ms 336 KB Output is correct
29 Correct 1 ms 336 KB Output is correct
30 Correct 5 ms 1236 KB Output is correct
31 Correct 7 ms 1676 KB Output is correct
32 Correct 7 ms 1616 KB Output is correct
33 Correct 1 ms 336 KB Output is correct
34 Correct 1 ms 336 KB Output is correct
35 Correct 2 ms 720 KB Output is correct
36 Correct 5 ms 1232 KB Output is correct
37 Correct 5 ms 1232 KB Output is correct
38 Correct 8 ms 1616 KB Output is correct
39 Correct 8 ms 1608 KB Output is correct
40 Correct 7 ms 1616 KB Output is correct
41 Correct 7 ms 1620 KB Output is correct
42 Correct 1 ms 336 KB Output is correct
43 Correct 1 ms 336 KB Output is correct
44 Correct 1 ms 336 KB Output is correct
45 Correct 1 ms 336 KB Output is correct
46 Correct 166 ms 49240 KB Output is correct
47 Correct 276 ms 90512 KB Output is correct
48 Correct 266 ms 89784 KB Output is correct
49 Correct 391 ms 132156 KB Output is correct
50 Correct 384 ms 132296 KB Output is correct
51 Correct 389 ms 132252 KB Output is correct
52 Correct 383 ms 132216 KB Output is correct
53 Correct 23 ms 7216 KB Output is correct
54 Correct 19 ms 7200 KB Output is correct
55 Correct 16 ms 7200 KB Output is correct
56 Correct 17 ms 7248 KB Output is correct
57 Correct 266 ms 89924 KB Output is correct
58 Correct 391 ms 132236 KB Output is correct
59 Correct 382 ms 132340 KB Output is correct
60 Correct 17 ms 7184 KB Output is correct
61 Correct 18 ms 7192 KB Output is correct
62 Correct 262 ms 89824 KB Output is correct
63 Correct 390 ms 132120 KB Output is correct
64 Correct 383 ms 132100 KB Output is correct
65 Correct 16 ms 7196 KB Output is correct
66 Correct 16 ms 7248 KB Output is correct
67 Correct 254 ms 85796 KB Output is correct
68 Correct 260 ms 90152 KB Output is correct
69 Correct 264 ms 90272 KB Output is correct
70 Correct 389 ms 132136 KB Output is correct
71 Correct 384 ms 132164 KB Output is correct
72 Correct 381 ms 132184 KB Output is correct
73 Correct 387 ms 132288 KB Output is correct
74 Correct 25 ms 7200 KB Output is correct
75 Correct 17 ms 7204 KB Output is correct
76 Correct 24 ms 7200 KB Output is correct
77 Correct 17 ms 7192 KB Output is correct
78 Correct 1464 ms 88996 KB Output is correct
79 Correct 1943 ms 90052 KB Output is correct
80 Correct 1812 ms 90016 KB Output is correct
81 Correct 2191 ms 132156 KB Output is correct
82 Correct 2112 ms 132148 KB Output is correct
83 Correct 1948 ms 132072 KB Output is correct
84 Correct 2037 ms 132100 KB Output is correct
85 Correct 1357 ms 7240 KB Output is correct
86 Correct 1866 ms 7196 KB Output is correct
87 Correct 1351 ms 7192 KB Output is correct
88 Correct 1827 ms 7208 KB Output is correct
89 Correct 1301 ms 7196 KB Output is correct
90 Correct 1819 ms 7248 KB Output is correct
91 Correct 0 ms 208 KB Output is correct
92 Correct 1 ms 336 KB Output is correct
93 Correct 1 ms 336 KB Output is correct
94 Correct 259 ms 89880 KB Output is correct
95 Correct 386 ms 132168 KB Output is correct
96 Correct 391 ms 132352 KB Output is correct
97 Correct 16 ms 7204 KB Output is correct
98 Correct 16 ms 7216 KB Output is correct
99 Correct 256 ms 89940 KB Output is correct
100 Correct 385 ms 132200 KB Output is correct
101 Correct 379 ms 132064 KB Output is correct
102 Correct 16 ms 7248 KB Output is correct
103 Correct 16 ms 7240 KB Output is correct
104 Correct 5 ms 1232 KB Output is correct
105 Correct 7 ms 1616 KB Output is correct
106 Correct 8 ms 1616 KB Output is correct
107 Correct 1 ms 336 KB Output is correct
108 Correct 1 ms 336 KB Output is correct
109 Correct 5 ms 1232 KB Output is correct
110 Correct 7 ms 1616 KB Output is correct
111 Correct 7 ms 1616 KB Output is correct
112 Correct 1 ms 336 KB Output is correct
113 Correct 1 ms 336 KB Output is correct
114 Correct 452 ms 14336 KB Output is correct
115 Correct 3762 ms 90120 KB Output is correct
116 Correct 3718 ms 90160 KB Output is correct
117 Correct 3953 ms 132080 KB Output is correct
118 Correct 3772 ms 132144 KB Output is correct
119 Correct 3899 ms 132228 KB Output is correct
120 Correct 3353 ms 132164 KB Output is correct
121 Correct 1339 ms 7240 KB Output is correct
122 Correct 1939 ms 7200 KB Output is correct
123 Correct 1429 ms 7240 KB Output is correct
124 Correct 1842 ms 7180 KB Output is correct
125 Correct 258 ms 89924 KB Output is correct
126 Correct 379 ms 132124 KB Output is correct
127 Correct 388 ms 132164 KB Output is correct
128 Correct 17 ms 7248 KB Output is correct
129 Correct 23 ms 7212 KB Output is correct
130 Correct 247 ms 85660 KB Output is correct
131 Correct 263 ms 90160 KB Output is correct
132 Correct 255 ms 90268 KB Output is correct
133 Correct 385 ms 132132 KB Output is correct
134 Correct 381 ms 132060 KB Output is correct
135 Correct 389 ms 132272 KB Output is correct
136 Correct 383 ms 132144 KB Output is correct
137 Correct 16 ms 7216 KB Output is correct
138 Correct 17 ms 7192 KB Output is correct
139 Correct 19 ms 7184 KB Output is correct
140 Correct 21 ms 7240 KB Output is correct
141 Correct 5 ms 1232 KB Output is correct
142 Correct 7 ms 1616 KB Output is correct
143 Correct 7 ms 1576 KB Output is correct
144 Correct 1 ms 336 KB Output is correct
145 Correct 1 ms 336 KB Output is correct
146 Correct 3 ms 720 KB Output is correct
147 Correct 5 ms 1232 KB Output is correct
148 Correct 5 ms 1232 KB Output is correct
149 Correct 7 ms 1616 KB Output is correct
150 Correct 8 ms 1616 KB Output is correct
151 Correct 7 ms 1616 KB Output is correct
152 Correct 7 ms 1632 KB Output is correct
153 Correct 1 ms 336 KB Output is correct
154 Correct 1 ms 336 KB Output is correct
155 Correct 1 ms 336 KB Output is correct
156 Correct 1 ms 420 KB Output is correct
157 Correct 1811 ms 76208 KB Output is correct
158 Correct 2013 ms 89720 KB Output is correct
159 Correct 2103 ms 90288 KB Output is correct
160 Correct 2121 ms 132120 KB Output is correct
161 Correct 2207 ms 132136 KB Output is correct
162 Correct 2221 ms 132096 KB Output is correct
163 Correct 2136 ms 132168 KB Output is correct
164 Correct 1497 ms 7248 KB Output is correct
165 Correct 1905 ms 7240 KB Output is correct
166 Correct 1507 ms 7180 KB Output is correct
167 Correct 1934 ms 7204 KB Output is correct
168 Correct 1 ms 208 KB Output is correct
169 Correct 1170 ms 22128 KB Output is correct
170 Correct 2493 ms 89516 KB Output is correct
171 Correct 2500 ms 89796 KB Output is correct
172 Correct 2675 ms 132180 KB Output is correct
173 Correct 2653 ms 132176 KB Output is correct
174 Correct 2403 ms 132164 KB Output is correct
175 Correct 2760 ms 132140 KB Output is correct
176 Correct 1338 ms 7200 KB Output is correct
177 Correct 1540 ms 7192 KB Output is correct
178 Correct 1465 ms 7200 KB Output is correct
179 Correct 1640 ms 7240 KB Output is correct