Submission #636353

# Submission time Handle Problem Language Result Execution time Memory
636353 2022-08-29T00:22:23 Z CodePlatina Radio Towers (IOI22_towers) C++17
58 / 100
1598 ms 494796 KB
#include "towers.h"
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <utility>
#include <tuple>
#define pii pair<int, int>
#define piii pair<int, pii>
#define pll pair<long long, long long>
#define plll pair<long long, pll>
#define tiii tuple<int, int, int>
#define tiiii tuple<int, int, int, int>
#define ff first
#define ss second
#define ee ss.ff
#define rr ss.ss
#define DEBUG
const int INF = (int)1e9 + 7;

using namespace std;

int N, M;
vector<int> H;
vector<int> P;
vector<int> ind;
vector<pii> indm;
vector<pii> LD, RD;
vector<int> GD;
vector<int> DS;
vector<int> DH;
vector<int> Lroot, Rroot, LDroot, RDroot;

int qry(int l, int r)
{
    int ret = 0;
    for(int x = l + N, y = r + N; x != y; x >>= 1, y >>= 1)
    {
        if(x & 1) ret = max(ret, ind[x++]);
        if(y & 1) ret = max(ret, ind[--y]);
    }
    return ret;
}

int qrym(int l, int r)
{
    pii ret = {INF, INF};
    for(int x = l + N, y = r + N; x != y; x >>= 1, y >>= 1)
    {
        if(x & 1) ret = min(ret, indm[x++]);
        if(y & 1) ret = min(ret, indm[--y]);
    }
    return ret.ss;
}

struct SEG
{
    struct Node
    {
        int x;
        int l, r;
        Node(void) : x(0), l(-1), r(-1) {}
    }nd[40404040];
    int cnt = 0;

    int init(int s, int e, const vector<int> &V)
    {
        int ret = cnt++;

        if(s + 1 == e)
        {
            nd[ret].x = V[s];
            return ret;
        }

        int mid = s + e >> 1;
        nd[ret].l = init(s, mid, V);
        nd[ret].r = init(mid, e, V);
        nd[ret].x = nd[nd[ret].l].x + nd[nd[ret].r].x;
        return ret;
    }

    int upd(int ind, int s, int e, int x, int v)
    {
        int ret = cnt++;
        nd[ret] = nd[ind];

        if(s + 1 == e)
        {
            nd[ret].x += v;
            return ret;
        }

        int mid = s + e >> 1;
        if(x < mid) nd[ret].l = upd(nd[ret].l, s, mid, x, v);
        else nd[ret].r = upd(nd[ret].r, mid, e, x, v);
        nd[ret].x = nd[nd[ret].l].x + nd[nd[ret].r].x;
        return ret;
    }

    int qry(int ind, int s, int e, int l, int r)
    {
        if(e <= l || r <= s) return 0;
        if(l <= s && e <= r) return nd[ind].x;

        int mid = s + e >> 1;
        return qry(nd[ind].l, s, mid, l, r) + qry(nd[ind].r, mid, e, l, r);
    }
}seg;

void init(int _N, vector<int> _H)
{
    N = _N;
    H = _H;
    for(int i = 0; i < N; ++i) P.push_back(i);
    sort(P.begin(), P.end(), [](int x, int y){return H[x] < H[y];});
    ind.resize(2 * N);
    for(int i = 0; i < N; ++i) ind[i + N] = H[i];
    for(int i = N - 1; i >= 1; --i) ind[i] = max(ind[i << 1], ind[i << 1 | 1]);
    indm.resize(2 * N);
    for(int i = 0; i < N; ++i) indm[i + N] = { H[i], i };
    for(int i = N - 1; i >= 1; --i) indm[i] = min(indm[i << 1], indm[i << 1 | 1]);
    set<int> S;
    LD.resize(N);
    RD.resize(N);
    GD.resize(N);
    for(int i : P)
    {
        auto it = S.lower_bound(i);
        int l = (it == S.begin() ? -1 : *prev(it));
        int r = (it == S.end() ? N : *it);
        LD[i] = { l, qry(l + 1, i + 1) - H[i] };
        RD[i] = { r, qry(i, r) - H[i] };
        GD[i] = min(LD[i].ss, RD[i].ss);
        DH.push_back(LD[i].ss);
        DH.push_back(RD[i].ss);
        S.insert(i);
    }
    sort(DH.begin(), DH.end());
    DH.resize(unique(DH.begin(), DH.end()) - DH.begin());
    M = DH.size();
    for(int i = 0; i < N; ++i)
    {
        LD[i].ss = lower_bound(DH.begin(), DH.end(), LD[i].ss) - DH.begin();
        RD[i].ss = lower_bound(DH.begin(), DH.end(), RD[i].ss) - DH.begin();
        GD[i] = lower_bound(DH.begin(), DH.end(), GD[i]) - DH.begin();
        DS.push_back(GD[i]);
    }
    sort(DS.begin(), DS.end());
    Lroot.resize(N + 1);
    Rroot.resize(N + 1);
    vector<int> tmp(M);
    vector<int> ls[N + 1];
    for(int i = 0; i < N; ++i) ++tmp[GD[i]], ls[LD[i].ff + 1].push_back(i);
    Lroot[0] = Rroot[N] = seg.init(0, M, tmp);
    for(int i = 0; i <= N; ++i)
    {
        if(i) Lroot[i] = Lroot[i - 1];
        for(auto x : ls[i])
        {
            Lroot[i] = seg.upd(Lroot[i], 0, M, GD[x], -1);
            Lroot[i] = seg.upd(Lroot[i], 0, M, RD[x].ss, 1);
        }
    }
    for(auto &v : ls) v.clear();
    for(int i = 0; i < N; ++i) ls[RD[i].ff].push_back(i);
    for(int i = N - 1; i >= 0; --i)
    {
        Rroot[i] = Rroot[i + 1];
        for(auto x : ls[i + 1])
        {
            Rroot[i] = seg.upd(Rroot[i], 0, M, GD[x], -1);
            Rroot[i] = seg.upd(Rroot[i], 0, M, LD[x].ss, 1);
        }
    }
    LDroot.resize(N);
    LDroot[0] = seg.init(0, M, vector<int>(M));
    for(int i = 1; i < N; ++i) LDroot[i] = seg.upd(LDroot[i - 1], 0, M, RD[i - 1].ss, 1);
    RDroot.resize(N);
    RDroot[N - 1] = LDroot[0];
    for(int i = N - 2; i >= 0; --i) RDroot[i] = seg.upd(RDroot[i + 1], 0, M, LD[i + 1].ss, 1);


//    for(int i = 0; i < N; ++i)
//    {
//        cout << LD[i].ff << ' ' << LD[i].ss << ' ' << RD[i].ff << ' ' << RD[i].ss << endl;
//    }

    if(seg.cnt > 40404000) exit(0);
}

int max_towers(int L, int R, int D)
{
    D = lower_bound(DH.begin(), DH.end(), D) - DH.begin();
    int m = qrym(L, R + 1);
//    cout << seg.qry(Lroot[L], 0, M, D, M) << endl;
//    cout << seg.qry(Rroot[R], 0, M, D, M) << endl;
//    cout << (DS.end() - lower_bound(DS.begin(), DS.end(), D)) << endl;
//    cout << (GD[m] >= D ? 1 : 0) << endl;
//    cout << (LD[m].ss >= D ? 1 : 0) << endl;
//    cout << (RD[m].ss >= D ? 1 : 0) << endl;
//    cout << seg.qry(LDroot[L], 0, M, D, M) << endl;
//    cout << seg.qry(RDroot[R], 0, M, D, M) << endl;
    return seg.qry(Lroot[L], 0, M, D, M) + seg.qry(Rroot[R], 0, M, D, M)
            - (DS.end() - lower_bound(DS.begin(), DS.end(), D))
            + (GD[m] >= D ? 1 : 0) - (LD[m].ss >= D ? 1 : 0) - (RD[m].ss >= D ? 1 : 0)
            - seg.qry(LDroot[L], 0, M, D, M) - seg.qry(RDroot[R], 0, M, D, M) + 1;
}

Compilation message

towers.cpp: In member function 'int SEG::init(int, int, const std::vector<int>&)':
towers.cpp:76:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   76 |         int mid = s + e >> 1;
      |                   ~~^~~
towers.cpp: In member function 'int SEG::upd(int, int, int, int, int)':
towers.cpp:94:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   94 |         int mid = s + e >> 1;
      |                   ~~^~~
towers.cpp: In member function 'int SEG::qry(int, int, int, int, int)':
towers.cpp:106:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  106 |         int mid = s + e >> 1;
      |                   ~~^~~
# Verdict Execution time Memory Grader output
1 Correct 746 ms 486360 KB Output is correct
2 Correct 1572 ms 494344 KB Output is correct
3 Correct 1493 ms 494484 KB Output is correct
4 Correct 1358 ms 494352 KB Output is correct
5 Correct 1491 ms 494240 KB Output is correct
6 Correct 1181 ms 494380 KB Output is correct
7 Correct 1303 ms 494396 KB Output is correct
8 Correct 198 ms 474636 KB Output is correct
9 Correct 207 ms 475020 KB Output is correct
10 Correct 204 ms 474960 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 200 ms 474776 KB Output is correct
2 Correct 200 ms 475052 KB Output is correct
3 Correct 218 ms 474968 KB Output is correct
4 Correct 200 ms 475024 KB Output is correct
5 Correct 206 ms 474992 KB Output is correct
6 Correct 207 ms 474952 KB Output is correct
7 Correct 210 ms 475016 KB Output is correct
8 Correct 215 ms 475036 KB Output is correct
9 Correct 207 ms 474988 KB Output is correct
10 Correct 208 ms 474980 KB Output is correct
11 Correct 207 ms 475040 KB Output is correct
12 Correct 195 ms 474704 KB Output is correct
13 Correct 225 ms 475048 KB Output is correct
14 Correct 217 ms 475012 KB Output is correct
15 Correct 220 ms 474980 KB Output is correct
16 Correct 204 ms 474980 KB Output is correct
17 Correct 202 ms 475056 KB Output is correct
18 Correct 206 ms 474976 KB Output is correct
19 Correct 203 ms 474984 KB Output is correct
20 Correct 208 ms 474972 KB Output is correct
21 Correct 200 ms 474956 KB Output is correct
22 Correct 219 ms 475040 KB Output is correct
23 Correct 204 ms 475120 KB Output is correct
24 Correct 215 ms 475008 KB Output is correct
25 Correct 205 ms 474808 KB Output is correct
26 Correct 200 ms 474948 KB Output is correct
27 Correct 205 ms 474984 KB Output is correct
28 Correct 224 ms 475108 KB Output is correct
29 Correct 198 ms 475012 KB Output is correct
30 Correct 208 ms 475056 KB Output is correct
31 Correct 212 ms 474992 KB Output is correct
32 Correct 199 ms 475032 KB Output is correct
33 Correct 203 ms 475148 KB Output is correct
34 Correct 237 ms 474984 KB Output is correct
35 Correct 199 ms 474972 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 200 ms 474776 KB Output is correct
2 Correct 200 ms 475052 KB Output is correct
3 Correct 218 ms 474968 KB Output is correct
4 Correct 200 ms 475024 KB Output is correct
5 Correct 206 ms 474992 KB Output is correct
6 Correct 207 ms 474952 KB Output is correct
7 Correct 210 ms 475016 KB Output is correct
8 Correct 215 ms 475036 KB Output is correct
9 Correct 207 ms 474988 KB Output is correct
10 Correct 208 ms 474980 KB Output is correct
11 Correct 207 ms 475040 KB Output is correct
12 Correct 195 ms 474704 KB Output is correct
13 Correct 225 ms 475048 KB Output is correct
14 Correct 217 ms 475012 KB Output is correct
15 Correct 220 ms 474980 KB Output is correct
16 Correct 204 ms 474980 KB Output is correct
17 Correct 202 ms 475056 KB Output is correct
18 Correct 206 ms 474976 KB Output is correct
19 Correct 203 ms 474984 KB Output is correct
20 Correct 208 ms 474972 KB Output is correct
21 Correct 200 ms 474956 KB Output is correct
22 Correct 219 ms 475040 KB Output is correct
23 Correct 204 ms 475120 KB Output is correct
24 Correct 215 ms 475008 KB Output is correct
25 Correct 205 ms 474808 KB Output is correct
26 Correct 200 ms 474948 KB Output is correct
27 Correct 205 ms 474984 KB Output is correct
28 Correct 224 ms 475108 KB Output is correct
29 Correct 198 ms 475012 KB Output is correct
30 Correct 208 ms 475056 KB Output is correct
31 Correct 212 ms 474992 KB Output is correct
32 Correct 199 ms 475032 KB Output is correct
33 Correct 203 ms 475148 KB Output is correct
34 Correct 237 ms 474984 KB Output is correct
35 Correct 199 ms 474972 KB Output is correct
36 Correct 342 ms 487176 KB Output is correct
37 Correct 449 ms 494004 KB Output is correct
38 Correct 486 ms 494032 KB Output is correct
39 Correct 442 ms 494012 KB Output is correct
40 Correct 466 ms 493996 KB Output is correct
41 Correct 491 ms 494016 KB Output is correct
42 Correct 444 ms 493936 KB Output is correct
43 Correct 369 ms 494440 KB Output is correct
44 Correct 350 ms 494284 KB Output is correct
45 Correct 377 ms 494720 KB Output is correct
46 Correct 397 ms 494440 KB Output is correct
47 Correct 446 ms 493976 KB Output is correct
48 Correct 461 ms 494040 KB Output is correct
49 Correct 455 ms 494012 KB Output is correct
50 Correct 364 ms 494248 KB Output is correct
51 Correct 371 ms 494316 KB Output is correct
52 Correct 459 ms 494072 KB Output is correct
53 Correct 470 ms 493992 KB Output is correct
54 Correct 441 ms 494004 KB Output is correct
55 Correct 376 ms 494296 KB Output is correct
56 Correct 370 ms 494532 KB Output is correct
57 Correct 502 ms 493352 KB Output is correct
58 Correct 442 ms 494008 KB Output is correct
59 Correct 455 ms 493964 KB Output is correct
60 Correct 446 ms 494008 KB Output is correct
61 Correct 435 ms 494000 KB Output is correct
62 Correct 447 ms 493932 KB Output is correct
63 Correct 436 ms 494012 KB Output is correct
64 Correct 373 ms 494596 KB Output is correct
65 Correct 364 ms 494300 KB Output is correct
66 Correct 375 ms 494684 KB Output is correct
67 Correct 371 ms 494368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1053 ms 494108 KB Output is correct
2 Correct 1541 ms 494020 KB Output is correct
3 Correct 1502 ms 494012 KB Output is correct
4 Correct 1583 ms 494072 KB Output is correct
5 Correct 1418 ms 494084 KB Output is correct
6 Correct 1598 ms 493996 KB Output is correct
7 Correct 1589 ms 494032 KB Output is correct
8 Correct 1366 ms 494360 KB Output is correct
9 Correct 1333 ms 494324 KB Output is correct
10 Correct 1371 ms 494796 KB Output is correct
11 Correct 1206 ms 494312 KB Output is correct
12 Correct 1433 ms 494472 KB Output is correct
13 Correct 1416 ms 494292 KB Output is correct
14 Correct 208 ms 474588 KB Output is correct
15 Correct 211 ms 474984 KB Output is correct
16 Correct 206 ms 474984 KB Output is correct
17 Correct 431 ms 494040 KB Output is correct
18 Correct 468 ms 494008 KB Output is correct
19 Correct 499 ms 493900 KB Output is correct
20 Correct 403 ms 494304 KB Output is correct
21 Correct 379 ms 494400 KB Output is correct
22 Correct 423 ms 494048 KB Output is correct
23 Correct 472 ms 494012 KB Output is correct
24 Correct 457 ms 493936 KB Output is correct
25 Correct 370 ms 494268 KB Output is correct
26 Correct 365 ms 494492 KB Output is correct
27 Correct 234 ms 475004 KB Output is correct
28 Correct 207 ms 475040 KB Output is correct
29 Correct 227 ms 474956 KB Output is correct
30 Correct 214 ms 475080 KB Output is correct
31 Correct 205 ms 475056 KB Output is correct
32 Correct 213 ms 475000 KB Output is correct
33 Correct 204 ms 474968 KB Output is correct
34 Correct 211 ms 474952 KB Output is correct
35 Correct 220 ms 475084 KB Output is correct
36 Correct 210 ms 475104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 483 ms 479260 KB Output is correct
2 Correct 1492 ms 493944 KB Output is correct
3 Correct 1303 ms 494036 KB Output is correct
4 Correct 1450 ms 493956 KB Output is correct
5 Correct 1429 ms 494044 KB Output is correct
6 Correct 1409 ms 494000 KB Output is correct
7 Correct 1583 ms 494100 KB Output is correct
8 Correct 1258 ms 494404 KB Output is correct
9 Correct 1312 ms 494296 KB Output is correct
10 Correct 1383 ms 494560 KB Output is correct
11 Correct 1259 ms 494340 KB Output is correct
12 Correct 460 ms 493924 KB Output is correct
13 Correct 458 ms 494012 KB Output is correct
14 Correct 459 ms 493996 KB Output is correct
15 Correct 369 ms 494284 KB Output is correct
16 Correct 379 ms 494648 KB Output is correct
17 Correct 456 ms 493360 KB Output is correct
18 Correct 458 ms 494020 KB Output is correct
19 Correct 451 ms 493900 KB Output is correct
20 Correct 439 ms 494012 KB Output is correct
21 Correct 480 ms 493928 KB Output is correct
22 Correct 442 ms 494012 KB Output is correct
23 Correct 440 ms 494012 KB Output is correct
24 Correct 379 ms 494408 KB Output is correct
25 Correct 382 ms 494276 KB Output is correct
26 Correct 369 ms 494728 KB Output is correct
27 Correct 359 ms 494312 KB Output is correct
28 Correct 203 ms 475000 KB Output is correct
29 Correct 216 ms 475036 KB Output is correct
30 Correct 205 ms 475084 KB Output is correct
31 Correct 199 ms 474968 KB Output is correct
32 Correct 219 ms 475040 KB Output is correct
33 Correct 201 ms 474772 KB Output is correct
34 Correct 234 ms 474984 KB Output is correct
35 Correct 217 ms 474976 KB Output is correct
36 Correct 204 ms 474952 KB Output is correct
37 Correct 210 ms 475036 KB Output is correct
38 Correct 206 ms 474960 KB Output is correct
39 Correct 200 ms 475008 KB Output is correct
40 Correct 217 ms 475064 KB Output is correct
41 Correct 205 ms 474984 KB Output is correct
42 Correct 203 ms 474968 KB Output is correct
43 Correct 211 ms 475024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 200 ms 474776 KB Output is correct
2 Correct 200 ms 475052 KB Output is correct
3 Correct 218 ms 474968 KB Output is correct
4 Correct 200 ms 475024 KB Output is correct
5 Correct 206 ms 474992 KB Output is correct
6 Correct 207 ms 474952 KB Output is correct
7 Correct 210 ms 475016 KB Output is correct
8 Correct 215 ms 475036 KB Output is correct
9 Correct 207 ms 474988 KB Output is correct
10 Correct 208 ms 474980 KB Output is correct
11 Correct 207 ms 475040 KB Output is correct
12 Correct 195 ms 474704 KB Output is correct
13 Correct 225 ms 475048 KB Output is correct
14 Correct 217 ms 475012 KB Output is correct
15 Correct 220 ms 474980 KB Output is correct
16 Correct 204 ms 474980 KB Output is correct
17 Correct 202 ms 475056 KB Output is correct
18 Correct 206 ms 474976 KB Output is correct
19 Correct 203 ms 474984 KB Output is correct
20 Correct 208 ms 474972 KB Output is correct
21 Correct 200 ms 474956 KB Output is correct
22 Correct 219 ms 475040 KB Output is correct
23 Correct 204 ms 475120 KB Output is correct
24 Correct 215 ms 475008 KB Output is correct
25 Correct 205 ms 474808 KB Output is correct
26 Correct 200 ms 474948 KB Output is correct
27 Correct 205 ms 474984 KB Output is correct
28 Correct 224 ms 475108 KB Output is correct
29 Correct 198 ms 475012 KB Output is correct
30 Correct 208 ms 475056 KB Output is correct
31 Correct 212 ms 474992 KB Output is correct
32 Correct 199 ms 475032 KB Output is correct
33 Correct 203 ms 475148 KB Output is correct
34 Correct 237 ms 474984 KB Output is correct
35 Correct 199 ms 474972 KB Output is correct
36 Correct 342 ms 487176 KB Output is correct
37 Correct 449 ms 494004 KB Output is correct
38 Correct 486 ms 494032 KB Output is correct
39 Correct 442 ms 494012 KB Output is correct
40 Correct 466 ms 493996 KB Output is correct
41 Correct 491 ms 494016 KB Output is correct
42 Correct 444 ms 493936 KB Output is correct
43 Correct 369 ms 494440 KB Output is correct
44 Correct 350 ms 494284 KB Output is correct
45 Correct 377 ms 494720 KB Output is correct
46 Correct 397 ms 494440 KB Output is correct
47 Correct 446 ms 493976 KB Output is correct
48 Correct 461 ms 494040 KB Output is correct
49 Correct 455 ms 494012 KB Output is correct
50 Correct 364 ms 494248 KB Output is correct
51 Correct 371 ms 494316 KB Output is correct
52 Correct 459 ms 494072 KB Output is correct
53 Correct 470 ms 493992 KB Output is correct
54 Correct 441 ms 494004 KB Output is correct
55 Correct 376 ms 494296 KB Output is correct
56 Correct 370 ms 494532 KB Output is correct
57 Correct 502 ms 493352 KB Output is correct
58 Correct 442 ms 494008 KB Output is correct
59 Correct 455 ms 493964 KB Output is correct
60 Correct 446 ms 494008 KB Output is correct
61 Correct 435 ms 494000 KB Output is correct
62 Correct 447 ms 493932 KB Output is correct
63 Correct 436 ms 494012 KB Output is correct
64 Correct 373 ms 494596 KB Output is correct
65 Correct 364 ms 494300 KB Output is correct
66 Correct 375 ms 494684 KB Output is correct
67 Correct 371 ms 494368 KB Output is correct
68 Correct 1053 ms 494108 KB Output is correct
69 Correct 1541 ms 494020 KB Output is correct
70 Correct 1502 ms 494012 KB Output is correct
71 Correct 1583 ms 494072 KB Output is correct
72 Correct 1418 ms 494084 KB Output is correct
73 Correct 1598 ms 493996 KB Output is correct
74 Correct 1589 ms 494032 KB Output is correct
75 Correct 1366 ms 494360 KB Output is correct
76 Correct 1333 ms 494324 KB Output is correct
77 Correct 1371 ms 494796 KB Output is correct
78 Correct 1206 ms 494312 KB Output is correct
79 Correct 1433 ms 494472 KB Output is correct
80 Correct 1416 ms 494292 KB Output is correct
81 Correct 208 ms 474588 KB Output is correct
82 Correct 211 ms 474984 KB Output is correct
83 Correct 206 ms 474984 KB Output is correct
84 Correct 431 ms 494040 KB Output is correct
85 Correct 468 ms 494008 KB Output is correct
86 Correct 499 ms 493900 KB Output is correct
87 Correct 403 ms 494304 KB Output is correct
88 Correct 379 ms 494400 KB Output is correct
89 Correct 423 ms 494048 KB Output is correct
90 Correct 472 ms 494012 KB Output is correct
91 Correct 457 ms 493936 KB Output is correct
92 Correct 370 ms 494268 KB Output is correct
93 Correct 365 ms 494492 KB Output is correct
94 Correct 234 ms 475004 KB Output is correct
95 Correct 207 ms 475040 KB Output is correct
96 Correct 227 ms 474956 KB Output is correct
97 Correct 214 ms 475080 KB Output is correct
98 Correct 205 ms 475056 KB Output is correct
99 Correct 213 ms 475000 KB Output is correct
100 Correct 204 ms 474968 KB Output is correct
101 Correct 211 ms 474952 KB Output is correct
102 Correct 220 ms 475084 KB Output is correct
103 Correct 210 ms 475104 KB Output is correct
104 Correct 1414 ms 491796 KB Output is correct
105 Correct 1208 ms 493900 KB Output is correct
106 Incorrect 1577 ms 494008 KB 10307th lines differ - on the 1st token, expected: '1', found: '2'
107 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 746 ms 486360 KB Output is correct
2 Correct 1572 ms 494344 KB Output is correct
3 Correct 1493 ms 494484 KB Output is correct
4 Correct 1358 ms 494352 KB Output is correct
5 Correct 1491 ms 494240 KB Output is correct
6 Correct 1181 ms 494380 KB Output is correct
7 Correct 1303 ms 494396 KB Output is correct
8 Correct 198 ms 474636 KB Output is correct
9 Correct 207 ms 475020 KB Output is correct
10 Correct 204 ms 474960 KB Output is correct
11 Correct 200 ms 474776 KB Output is correct
12 Correct 200 ms 475052 KB Output is correct
13 Correct 218 ms 474968 KB Output is correct
14 Correct 200 ms 475024 KB Output is correct
15 Correct 206 ms 474992 KB Output is correct
16 Correct 207 ms 474952 KB Output is correct
17 Correct 210 ms 475016 KB Output is correct
18 Correct 215 ms 475036 KB Output is correct
19 Correct 207 ms 474988 KB Output is correct
20 Correct 208 ms 474980 KB Output is correct
21 Correct 207 ms 475040 KB Output is correct
22 Correct 195 ms 474704 KB Output is correct
23 Correct 225 ms 475048 KB Output is correct
24 Correct 217 ms 475012 KB Output is correct
25 Correct 220 ms 474980 KB Output is correct
26 Correct 204 ms 474980 KB Output is correct
27 Correct 202 ms 475056 KB Output is correct
28 Correct 206 ms 474976 KB Output is correct
29 Correct 203 ms 474984 KB Output is correct
30 Correct 208 ms 474972 KB Output is correct
31 Correct 200 ms 474956 KB Output is correct
32 Correct 219 ms 475040 KB Output is correct
33 Correct 204 ms 475120 KB Output is correct
34 Correct 215 ms 475008 KB Output is correct
35 Correct 205 ms 474808 KB Output is correct
36 Correct 200 ms 474948 KB Output is correct
37 Correct 205 ms 474984 KB Output is correct
38 Correct 224 ms 475108 KB Output is correct
39 Correct 198 ms 475012 KB Output is correct
40 Correct 208 ms 475056 KB Output is correct
41 Correct 212 ms 474992 KB Output is correct
42 Correct 199 ms 475032 KB Output is correct
43 Correct 203 ms 475148 KB Output is correct
44 Correct 237 ms 474984 KB Output is correct
45 Correct 199 ms 474972 KB Output is correct
46 Correct 342 ms 487176 KB Output is correct
47 Correct 449 ms 494004 KB Output is correct
48 Correct 486 ms 494032 KB Output is correct
49 Correct 442 ms 494012 KB Output is correct
50 Correct 466 ms 493996 KB Output is correct
51 Correct 491 ms 494016 KB Output is correct
52 Correct 444 ms 493936 KB Output is correct
53 Correct 369 ms 494440 KB Output is correct
54 Correct 350 ms 494284 KB Output is correct
55 Correct 377 ms 494720 KB Output is correct
56 Correct 397 ms 494440 KB Output is correct
57 Correct 446 ms 493976 KB Output is correct
58 Correct 461 ms 494040 KB Output is correct
59 Correct 455 ms 494012 KB Output is correct
60 Correct 364 ms 494248 KB Output is correct
61 Correct 371 ms 494316 KB Output is correct
62 Correct 459 ms 494072 KB Output is correct
63 Correct 470 ms 493992 KB Output is correct
64 Correct 441 ms 494004 KB Output is correct
65 Correct 376 ms 494296 KB Output is correct
66 Correct 370 ms 494532 KB Output is correct
67 Correct 502 ms 493352 KB Output is correct
68 Correct 442 ms 494008 KB Output is correct
69 Correct 455 ms 493964 KB Output is correct
70 Correct 446 ms 494008 KB Output is correct
71 Correct 435 ms 494000 KB Output is correct
72 Correct 447 ms 493932 KB Output is correct
73 Correct 436 ms 494012 KB Output is correct
74 Correct 373 ms 494596 KB Output is correct
75 Correct 364 ms 494300 KB Output is correct
76 Correct 375 ms 494684 KB Output is correct
77 Correct 371 ms 494368 KB Output is correct
78 Correct 1053 ms 494108 KB Output is correct
79 Correct 1541 ms 494020 KB Output is correct
80 Correct 1502 ms 494012 KB Output is correct
81 Correct 1583 ms 494072 KB Output is correct
82 Correct 1418 ms 494084 KB Output is correct
83 Correct 1598 ms 493996 KB Output is correct
84 Correct 1589 ms 494032 KB Output is correct
85 Correct 1366 ms 494360 KB Output is correct
86 Correct 1333 ms 494324 KB Output is correct
87 Correct 1371 ms 494796 KB Output is correct
88 Correct 1206 ms 494312 KB Output is correct
89 Correct 1433 ms 494472 KB Output is correct
90 Correct 1416 ms 494292 KB Output is correct
91 Correct 208 ms 474588 KB Output is correct
92 Correct 211 ms 474984 KB Output is correct
93 Correct 206 ms 474984 KB Output is correct
94 Correct 431 ms 494040 KB Output is correct
95 Correct 468 ms 494008 KB Output is correct
96 Correct 499 ms 493900 KB Output is correct
97 Correct 403 ms 494304 KB Output is correct
98 Correct 379 ms 494400 KB Output is correct
99 Correct 423 ms 494048 KB Output is correct
100 Correct 472 ms 494012 KB Output is correct
101 Correct 457 ms 493936 KB Output is correct
102 Correct 370 ms 494268 KB Output is correct
103 Correct 365 ms 494492 KB Output is correct
104 Correct 234 ms 475004 KB Output is correct
105 Correct 207 ms 475040 KB Output is correct
106 Correct 227 ms 474956 KB Output is correct
107 Correct 214 ms 475080 KB Output is correct
108 Correct 205 ms 475056 KB Output is correct
109 Correct 213 ms 475000 KB Output is correct
110 Correct 204 ms 474968 KB Output is correct
111 Correct 211 ms 474952 KB Output is correct
112 Correct 220 ms 475084 KB Output is correct
113 Correct 210 ms 475104 KB Output is correct
114 Correct 483 ms 479260 KB Output is correct
115 Correct 1492 ms 493944 KB Output is correct
116 Correct 1303 ms 494036 KB Output is correct
117 Correct 1450 ms 493956 KB Output is correct
118 Correct 1429 ms 494044 KB Output is correct
119 Correct 1409 ms 494000 KB Output is correct
120 Correct 1583 ms 494100 KB Output is correct
121 Correct 1258 ms 494404 KB Output is correct
122 Correct 1312 ms 494296 KB Output is correct
123 Correct 1383 ms 494560 KB Output is correct
124 Correct 1259 ms 494340 KB Output is correct
125 Correct 460 ms 493924 KB Output is correct
126 Correct 458 ms 494012 KB Output is correct
127 Correct 459 ms 493996 KB Output is correct
128 Correct 369 ms 494284 KB Output is correct
129 Correct 379 ms 494648 KB Output is correct
130 Correct 456 ms 493360 KB Output is correct
131 Correct 458 ms 494020 KB Output is correct
132 Correct 451 ms 493900 KB Output is correct
133 Correct 439 ms 494012 KB Output is correct
134 Correct 480 ms 493928 KB Output is correct
135 Correct 442 ms 494012 KB Output is correct
136 Correct 440 ms 494012 KB Output is correct
137 Correct 379 ms 494408 KB Output is correct
138 Correct 382 ms 494276 KB Output is correct
139 Correct 369 ms 494728 KB Output is correct
140 Correct 359 ms 494312 KB Output is correct
141 Correct 203 ms 475000 KB Output is correct
142 Correct 216 ms 475036 KB Output is correct
143 Correct 205 ms 475084 KB Output is correct
144 Correct 199 ms 474968 KB Output is correct
145 Correct 219 ms 475040 KB Output is correct
146 Correct 201 ms 474772 KB Output is correct
147 Correct 234 ms 474984 KB Output is correct
148 Correct 217 ms 474976 KB Output is correct
149 Correct 204 ms 474952 KB Output is correct
150 Correct 210 ms 475036 KB Output is correct
151 Correct 206 ms 474960 KB Output is correct
152 Correct 200 ms 475008 KB Output is correct
153 Correct 217 ms 475064 KB Output is correct
154 Correct 205 ms 474984 KB Output is correct
155 Correct 203 ms 474968 KB Output is correct
156 Correct 211 ms 475024 KB Output is correct
157 Correct 1414 ms 491796 KB Output is correct
158 Correct 1208 ms 493900 KB Output is correct
159 Incorrect 1577 ms 494008 KB 10307th lines differ - on the 1st token, expected: '1', found: '2'
160 Halted 0 ms 0 KB -