Submission #916698

# Submission time Handle Problem Language Result Execution time Memory
916698 2024-01-26T10:12:53 Z Tuanlinh123 IOI Fever (JOI21_fever) C++17
57 / 100
484 ms 144488 KB
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;

const ll maxn=100005, inf=1e15;
pll dis[maxn*12];
vector <pll> A[maxn*12];
vector <ll> nx, ny, ns, nd;
vector <pll> ho[maxn], ve[maxn], sm[maxn], df[maxn];
vector <ll> pho[maxn], pve[maxn], psm[maxn], pdf[maxn];
vector <ll> sho[maxn], sve[maxn], ssm[maxn], sdf[maxn];
ll crr, x[maxn], y[maxn], poho[maxn], pove[maxn], posm[maxn], podf[maxn];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll n; cin >> n; crr=n;
    for (ll i=1; i<=n; i++)
    {
        cin >> x[i] >> y[i]; x[i]*=2, y[i]*=2;
        nx.pb(x[i]), ny.pb(y[i]), ns.pb(x[i]+y[i]), nd.pb(x[i]-y[i]);
    }
    auto compr=[&](vector <ll> &a)
    {
        sort(a.begin(), a.end());
        a.resize(unique(a.begin(), a.end())-a.begin());
        return;
    };
    compr(nx), compr(ny), compr(ns), compr(nd);
    for (ll i=1; i<=n; i++)
    {
        ll h=lower_bound(ny.begin(), ny.end(), y[i])-ny.begin()+1;
        ll v=lower_bound(nx.begin(), nx.end(), x[i])-nx.begin()+1;
        ll s=lower_bound(ns.begin(), ns.end(), x[i]+y[i])-ns.begin()+1;
        ll d=lower_bound(nd.begin(), nd.end(), x[i]-y[i])-nd.begin()+1;
        ho[h].pb({x[i], i}), ve[v].pb({y[i], i}), sm[s].pb({x[i], i}), df[d].pb({x[i], i});
        poho[i]=h, pove[i]=v, posm[i]=s, podf[i]=d;
    }
    auto getnodes=[&](vector <pll> &id, vector <ll> &pre, vector <ll> &suf, bool diag)
    {
        sort(id.begin(), id.end());
        pre.resize(id.size()), suf.resize(id.size());
        for (ll i=0; i<id.size(); i++)
        {
            pre[i]=++crr; A[pre[i]].pb({id[i].se, 0});
            if (i) A[pre[i]].pb({pre[i-1], (id[i].fi-id[i-1].fi)/(diag?1:2)});
        }
        for (ll i=(ll)id.size()-1; i>=0; i--)
        {
            suf[i]=++crr; A[suf[i]].pb({id[i].se, 0});
            if (i+1!=id.size()) A[suf[i]].pb({suf[i+1], (id[i+1].fi-id[i].fi)/(diag?1:2)});
        }
    };
    for (ll i=1; i<=nx.size(); i++) getnodes(ho[i], pho[i], sho[i], 0);
    for (ll i=1; i<=ny.size(); i++) getnodes(ve[i], pve[i], sve[i], 0);
    for (ll i=1; i<=ns.size(); i++) getnodes(sm[i], psm[i], ssm[i], 1);
    for (ll i=1; i<=nd.size(); i++) getnodes(df[i], pdf[i], sdf[i], 1);
    auto Try=[&](ll direction)
    {
        for (ll i=1; i<=crr; i++)
            dis[i]={inf, 0};
        priority_queue <pll, vector <pll>, greater<pll>> q;
        auto update=[&](ll v, ll t, ll di)
        {
            if (t<dis[v].fi)
                dis[v]={t, di}, q.push({dis[v].fi, v});
            return;
        };
        auto findpos=[&](vector <pll> &a, ll val, bool up)
        {
            if (!up) return lower_bound(a.begin(), a.end(), mp(val, 0ll))-a.begin();
            return lower_bound(a.begin(), a.end(), mp(val, inf))-a.begin()-1;
        };
        dis[1]={0, direction}; q.push({dis[1].fi, 1});
        while (q.size())
        {
            ll t=q.top().fi, u=q.top().se; q.pop();
            if (t!=dis[u].fi) continue;
            ll di=dis[u].se;
            if (u>n) for (pll child:A[u])
            {
                ll v=child.fi, tv=child.se;
                update(v, t+tv, di);
            }
            else if (di==0)
            {
                ll p=findpos(sm[posm[u]], x[u]-t, 1);
                if (p>=0) update(psm[posm[u]][p], x[u]-sm[posm[u]][p].fi, 1);
                p=findpos(ve[pove[u]], y[u]+t*2, 0);
                if (p<ve[pove[u]].size()) update(sve[pove[u]][p], (ve[pove[u]][p].fi-y[u])/2, 2);
                p=findpos(df[podf[u]], x[u]+t, 0);
                if (p<df[podf[u]].size()) update(sdf[podf[u]][p], df[podf[u]][p].fi-x[u], 3);
            }
            else if (di==1)
            {
                ll p=findpos(df[podf[u]], x[u]+t, 0);
                if (p<df[podf[u]].size()) update(sdf[podf[u]][p], df[podf[u]][p].fi-x[u], 2);
                p=findpos(ho[poho[u]], x[u]+2*t, 0);
                if (p<ho[poho[u]].size()) update(sho[poho[u]][p], (ho[poho[u]][p].fi-x[u])/2, 3);
                p=findpos(sm[posm[u]], x[u]+t, 0);
                if (p<sm[posm[u]].size()) update(ssm[posm[u]][p], sm[posm[u]][p].fi-x[u], 0);
            }
            else if (di==2)
            {
                ll p=findpos(sm[posm[u]], x[u]+t, 0);
                if (p<sm[posm[u]].size()) update(ssm[posm[u]][p], sm[posm[u]][p].fi-x[u], 3);
                p=findpos(ve[pove[u]], y[u]-t*2, 1);
                if (p>=0) update(pve[pove[u]][p], (y[u]-ve[pove[u]][p].fi)/2, 0);
                p=findpos(df[podf[u]], x[u]-t, 1);
                if (p>=0) update(pdf[podf[u]][p], x[u]-df[podf[u]][p].fi, 1);
            }
            else
            {
                ll p=findpos(df[podf[u]], x[u]-t, 1);
                if (p>=0) update(pdf[podf[u]][p], x[u]-df[podf[u]][p].fi, 0);
                p=findpos(ho[poho[u]], x[u]-t*2, 1);
                if (p>=0) update(pho[poho[u]][p], (x[u]-ho[poho[u]][p].fi)/2, 1);
                p=findpos(sm[posm[u]], x[u]-t, 1);
                if (p>=0) update(psm[posm[u]][p], x[u]-sm[posm[u]][p].fi, 2);
            }
        }
        ll cnt=0;
        for (ll i=1; i<=n; i++)
            if (dis[i].fi<inf) cnt++;
        return cnt;
    };
    ll ans=1;
    for (ll i=0; i<4; i++)
        ans=max(ans, Try(i));
    cout << ans << "\n";
}

Compilation message

fever.cpp: In lambda function:
fever.cpp:50:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |         for (ll i=0; i<id.size(); i++)
      |                      ~^~~~~~~~~~
fever.cpp:58:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   58 |             if (i+1!=id.size()) A[suf[i]].pb({suf[i+1], (id[i+1].fi-id[i].fi)/(diag?1:2)});
      |                 ~~~^~~~~~~~~~~
fever.cpp: In function 'int main()':
fever.cpp:61:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |     for (ll i=1; i<=nx.size(); i++) getnodes(ho[i], pho[i], sho[i], 0);
      |                  ~^~~~~~~~~~~
fever.cpp:62:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   62 |     for (ll i=1; i<=ny.size(); i++) getnodes(ve[i], pve[i], sve[i], 0);
      |                  ~^~~~~~~~~~~
fever.cpp:63:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |     for (ll i=1; i<=ns.size(); i++) getnodes(sm[i], psm[i], ssm[i], 1);
      |                  ~^~~~~~~~~~~
fever.cpp:64:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   64 |     for (ll i=1; i<=nd.size(); i++) getnodes(df[i], pdf[i], sdf[i], 1);
      |                  ~^~~~~~~~~~~
fever.cpp: In lambda function:
fever.cpp:97:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   97 |                 if (p<ve[pove[u]].size()) update(sve[pove[u]][p], (ve[pove[u]][p].fi-y[u])/2, 2);
      |                     ~^~~~~~~~~~~~~~~~~~~
fever.cpp:99:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   99 |                 if (p<df[podf[u]].size()) update(sdf[podf[u]][p], df[podf[u]][p].fi-x[u], 3);
      |                     ~^~~~~~~~~~~~~~~~~~~
fever.cpp:104:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  104 |                 if (p<df[podf[u]].size()) update(sdf[podf[u]][p], df[podf[u]][p].fi-x[u], 2);
      |                     ~^~~~~~~~~~~~~~~~~~~
fever.cpp:106:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |                 if (p<ho[poho[u]].size()) update(sho[poho[u]][p], (ho[poho[u]][p].fi-x[u])/2, 3);
      |                     ~^~~~~~~~~~~~~~~~~~~
fever.cpp:108:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  108 |                 if (p<sm[posm[u]].size()) update(ssm[posm[u]][p], sm[posm[u]][p].fi-x[u], 0);
      |                     ~^~~~~~~~~~~~~~~~~~~
fever.cpp:113:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  113 |                 if (p<sm[posm[u]].size()) update(ssm[posm[u]][p], sm[posm[u]][p].fi-x[u], 3);
      |                     ~^~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 18 ms 61784 KB Output is correct
2 Correct 19 ms 61788 KB Output is correct
3 Correct 18 ms 62036 KB Output is correct
4 Correct 19 ms 61784 KB Output is correct
5 Correct 18 ms 61788 KB Output is correct
6 Correct 18 ms 62028 KB Output is correct
7 Correct 17 ms 61788 KB Output is correct
8 Correct 19 ms 61784 KB Output is correct
9 Correct 18 ms 61788 KB Output is correct
10 Correct 18 ms 61788 KB Output is correct
11 Correct 19 ms 62016 KB Output is correct
12 Correct 17 ms 61788 KB Output is correct
13 Correct 18 ms 61956 KB Output is correct
14 Correct 19 ms 61788 KB Output is correct
15 Correct 18 ms 61968 KB Output is correct
16 Correct 18 ms 61784 KB Output is correct
17 Correct 18 ms 61788 KB Output is correct
18 Correct 18 ms 61788 KB Output is correct
19 Correct 17 ms 62228 KB Output is correct
20 Correct 18 ms 61788 KB Output is correct
21 Correct 17 ms 61788 KB Output is correct
22 Correct 18 ms 61788 KB Output is correct
23 Correct 18 ms 61788 KB Output is correct
24 Correct 17 ms 61904 KB Output is correct
25 Correct 19 ms 61972 KB Output is correct
26 Correct 19 ms 61788 KB Output is correct
27 Correct 18 ms 61900 KB Output is correct
28 Correct 19 ms 62012 KB Output is correct
29 Correct 18 ms 61788 KB Output is correct
30 Correct 18 ms 61784 KB Output is correct
31 Correct 18 ms 61788 KB Output is correct
32 Correct 19 ms 62000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 61784 KB Output is correct
2 Correct 19 ms 61788 KB Output is correct
3 Correct 18 ms 62036 KB Output is correct
4 Correct 19 ms 61784 KB Output is correct
5 Correct 18 ms 61788 KB Output is correct
6 Correct 18 ms 62028 KB Output is correct
7 Correct 17 ms 61788 KB Output is correct
8 Correct 19 ms 61784 KB Output is correct
9 Correct 18 ms 61788 KB Output is correct
10 Correct 18 ms 61788 KB Output is correct
11 Correct 19 ms 62016 KB Output is correct
12 Correct 17 ms 61788 KB Output is correct
13 Correct 18 ms 61956 KB Output is correct
14 Correct 19 ms 61788 KB Output is correct
15 Correct 18 ms 61968 KB Output is correct
16 Correct 18 ms 61784 KB Output is correct
17 Correct 18 ms 61788 KB Output is correct
18 Correct 18 ms 61788 KB Output is correct
19 Correct 17 ms 62228 KB Output is correct
20 Correct 18 ms 61788 KB Output is correct
21 Correct 17 ms 61788 KB Output is correct
22 Correct 18 ms 61788 KB Output is correct
23 Correct 18 ms 61788 KB Output is correct
24 Correct 17 ms 61904 KB Output is correct
25 Correct 19 ms 61972 KB Output is correct
26 Correct 19 ms 61788 KB Output is correct
27 Correct 18 ms 61900 KB Output is correct
28 Correct 19 ms 62012 KB Output is correct
29 Correct 18 ms 61788 KB Output is correct
30 Correct 18 ms 61784 KB Output is correct
31 Correct 18 ms 61788 KB Output is correct
32 Correct 19 ms 62000 KB Output is correct
33 Correct 19 ms 61788 KB Output is correct
34 Correct 18 ms 61788 KB Output is correct
35 Correct 17 ms 62020 KB Output is correct
36 Correct 19 ms 61964 KB Output is correct
37 Correct 18 ms 61788 KB Output is correct
38 Correct 20 ms 62040 KB Output is correct
39 Correct 20 ms 61784 KB Output is correct
40 Correct 18 ms 62036 KB Output is correct
41 Correct 19 ms 61788 KB Output is correct
42 Correct 20 ms 61928 KB Output is correct
43 Correct 18 ms 61784 KB Output is correct
44 Correct 18 ms 61788 KB Output is correct
45 Correct 19 ms 61896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 62052 KB Output is correct
2 Correct 18 ms 62040 KB Output is correct
3 Correct 19 ms 62044 KB Output is correct
4 Correct 18 ms 61920 KB Output is correct
5 Correct 18 ms 62044 KB Output is correct
6 Correct 18 ms 61912 KB Output is correct
7 Correct 18 ms 61968 KB Output is correct
8 Correct 18 ms 61916 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 61784 KB Output is correct
2 Correct 19 ms 61788 KB Output is correct
3 Correct 18 ms 62036 KB Output is correct
4 Correct 19 ms 61784 KB Output is correct
5 Correct 18 ms 61788 KB Output is correct
6 Correct 18 ms 62028 KB Output is correct
7 Correct 17 ms 61788 KB Output is correct
8 Correct 19 ms 61784 KB Output is correct
9 Correct 18 ms 61788 KB Output is correct
10 Correct 18 ms 61788 KB Output is correct
11 Correct 19 ms 62016 KB Output is correct
12 Correct 17 ms 61788 KB Output is correct
13 Correct 18 ms 61956 KB Output is correct
14 Correct 19 ms 61788 KB Output is correct
15 Correct 18 ms 61968 KB Output is correct
16 Correct 18 ms 61784 KB Output is correct
17 Correct 18 ms 61788 KB Output is correct
18 Correct 18 ms 61788 KB Output is correct
19 Correct 17 ms 62228 KB Output is correct
20 Correct 18 ms 61788 KB Output is correct
21 Correct 17 ms 61788 KB Output is correct
22 Correct 18 ms 61788 KB Output is correct
23 Correct 18 ms 61788 KB Output is correct
24 Correct 17 ms 61904 KB Output is correct
25 Correct 19 ms 61972 KB Output is correct
26 Correct 19 ms 61788 KB Output is correct
27 Correct 18 ms 61900 KB Output is correct
28 Correct 19 ms 62012 KB Output is correct
29 Correct 18 ms 61788 KB Output is correct
30 Correct 18 ms 61784 KB Output is correct
31 Correct 18 ms 61788 KB Output is correct
32 Correct 19 ms 62000 KB Output is correct
33 Correct 19 ms 61788 KB Output is correct
34 Correct 18 ms 61788 KB Output is correct
35 Correct 17 ms 62020 KB Output is correct
36 Correct 19 ms 61964 KB Output is correct
37 Correct 18 ms 61788 KB Output is correct
38 Correct 20 ms 62040 KB Output is correct
39 Correct 20 ms 61784 KB Output is correct
40 Correct 18 ms 62036 KB Output is correct
41 Correct 19 ms 61788 KB Output is correct
42 Correct 20 ms 61928 KB Output is correct
43 Correct 18 ms 61784 KB Output is correct
44 Correct 18 ms 61788 KB Output is correct
45 Correct 19 ms 61896 KB Output is correct
46 Correct 19 ms 62052 KB Output is correct
47 Correct 18 ms 62040 KB Output is correct
48 Correct 19 ms 62044 KB Output is correct
49 Correct 18 ms 61920 KB Output is correct
50 Correct 18 ms 62044 KB Output is correct
51 Correct 18 ms 61912 KB Output is correct
52 Correct 18 ms 61968 KB Output is correct
53 Correct 18 ms 61916 KB Output is correct
54 Correct 19 ms 62044 KB Output is correct
55 Correct 19 ms 62044 KB Output is correct
56 Correct 23 ms 61948 KB Output is correct
57 Correct 24 ms 62044 KB Output is correct
58 Correct 18 ms 62024 KB Output is correct
59 Correct 18 ms 62044 KB Output is correct
60 Correct 20 ms 62016 KB Output is correct
61 Correct 18 ms 62044 KB Output is correct
62 Correct 23 ms 62044 KB Output is correct
63 Correct 19 ms 62092 KB Output is correct
64 Correct 19 ms 62044 KB Output is correct
65 Correct 18 ms 62044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 61784 KB Output is correct
2 Correct 19 ms 61788 KB Output is correct
3 Correct 18 ms 62036 KB Output is correct
4 Correct 19 ms 61784 KB Output is correct
5 Correct 18 ms 61788 KB Output is correct
6 Correct 18 ms 62028 KB Output is correct
7 Correct 17 ms 61788 KB Output is correct
8 Correct 19 ms 61784 KB Output is correct
9 Correct 18 ms 61788 KB Output is correct
10 Correct 18 ms 61788 KB Output is correct
11 Correct 19 ms 62016 KB Output is correct
12 Correct 17 ms 61788 KB Output is correct
13 Correct 18 ms 61956 KB Output is correct
14 Correct 19 ms 61788 KB Output is correct
15 Correct 18 ms 61968 KB Output is correct
16 Correct 18 ms 61784 KB Output is correct
17 Correct 18 ms 61788 KB Output is correct
18 Correct 18 ms 61788 KB Output is correct
19 Correct 17 ms 62228 KB Output is correct
20 Correct 18 ms 61788 KB Output is correct
21 Correct 17 ms 61788 KB Output is correct
22 Correct 18 ms 61788 KB Output is correct
23 Correct 18 ms 61788 KB Output is correct
24 Correct 17 ms 61904 KB Output is correct
25 Correct 19 ms 61972 KB Output is correct
26 Correct 19 ms 61788 KB Output is correct
27 Correct 18 ms 61900 KB Output is correct
28 Correct 19 ms 62012 KB Output is correct
29 Correct 18 ms 61788 KB Output is correct
30 Correct 18 ms 61784 KB Output is correct
31 Correct 18 ms 61788 KB Output is correct
32 Correct 19 ms 62000 KB Output is correct
33 Correct 19 ms 61788 KB Output is correct
34 Correct 18 ms 61788 KB Output is correct
35 Correct 17 ms 62020 KB Output is correct
36 Correct 19 ms 61964 KB Output is correct
37 Correct 18 ms 61788 KB Output is correct
38 Correct 20 ms 62040 KB Output is correct
39 Correct 20 ms 61784 KB Output is correct
40 Correct 18 ms 62036 KB Output is correct
41 Correct 19 ms 61788 KB Output is correct
42 Correct 20 ms 61928 KB Output is correct
43 Correct 18 ms 61784 KB Output is correct
44 Correct 18 ms 61788 KB Output is correct
45 Correct 19 ms 61896 KB Output is correct
46 Correct 19 ms 62052 KB Output is correct
47 Correct 18 ms 62040 KB Output is correct
48 Correct 19 ms 62044 KB Output is correct
49 Correct 18 ms 61920 KB Output is correct
50 Correct 18 ms 62044 KB Output is correct
51 Correct 18 ms 61912 KB Output is correct
52 Correct 18 ms 61968 KB Output is correct
53 Correct 18 ms 61916 KB Output is correct
54 Correct 19 ms 62044 KB Output is correct
55 Correct 19 ms 62044 KB Output is correct
56 Correct 23 ms 61948 KB Output is correct
57 Correct 24 ms 62044 KB Output is correct
58 Correct 18 ms 62024 KB Output is correct
59 Correct 18 ms 62044 KB Output is correct
60 Correct 20 ms 62016 KB Output is correct
61 Correct 18 ms 62044 KB Output is correct
62 Correct 23 ms 62044 KB Output is correct
63 Correct 19 ms 62092 KB Output is correct
64 Correct 19 ms 62044 KB Output is correct
65 Correct 18 ms 62044 KB Output is correct
66 Correct 26 ms 63904 KB Output is correct
67 Correct 24 ms 63832 KB Output is correct
68 Correct 24 ms 64088 KB Output is correct
69 Correct 28 ms 63772 KB Output is correct
70 Correct 25 ms 63584 KB Output is correct
71 Correct 35 ms 63584 KB Output is correct
72 Correct 29 ms 63892 KB Output is correct
73 Correct 24 ms 64092 KB Output is correct
74 Correct 24 ms 63832 KB Output is correct
75 Correct 24 ms 63940 KB Output is correct
76 Correct 24 ms 63832 KB Output is correct
77 Correct 24 ms 63992 KB Output is correct
78 Correct 25 ms 63836 KB Output is correct
79 Correct 24 ms 63828 KB Output is correct
80 Correct 24 ms 63828 KB Output is correct
81 Correct 25 ms 63928 KB Output is correct
82 Runtime error 74 ms 128596 KB Execution killed with signal 11
83 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 18 ms 61784 KB Output is correct
2 Correct 19 ms 61788 KB Output is correct
3 Correct 18 ms 62036 KB Output is correct
4 Correct 19 ms 61784 KB Output is correct
5 Correct 18 ms 61788 KB Output is correct
6 Correct 18 ms 62028 KB Output is correct
7 Correct 17 ms 61788 KB Output is correct
8 Correct 19 ms 61784 KB Output is correct
9 Correct 18 ms 61788 KB Output is correct
10 Correct 18 ms 61788 KB Output is correct
11 Correct 19 ms 62016 KB Output is correct
12 Correct 17 ms 61788 KB Output is correct
13 Correct 18 ms 61956 KB Output is correct
14 Correct 19 ms 61788 KB Output is correct
15 Correct 18 ms 61968 KB Output is correct
16 Correct 18 ms 61784 KB Output is correct
17 Correct 18 ms 61788 KB Output is correct
18 Correct 18 ms 61788 KB Output is correct
19 Correct 17 ms 62228 KB Output is correct
20 Correct 18 ms 61788 KB Output is correct
21 Correct 17 ms 61788 KB Output is correct
22 Correct 18 ms 61788 KB Output is correct
23 Correct 18 ms 61788 KB Output is correct
24 Correct 17 ms 61904 KB Output is correct
25 Correct 19 ms 61972 KB Output is correct
26 Correct 19 ms 61788 KB Output is correct
27 Correct 18 ms 61900 KB Output is correct
28 Correct 19 ms 62012 KB Output is correct
29 Correct 18 ms 61788 KB Output is correct
30 Correct 18 ms 61784 KB Output is correct
31 Correct 18 ms 61788 KB Output is correct
32 Correct 19 ms 62000 KB Output is correct
33 Correct 19 ms 61788 KB Output is correct
34 Correct 18 ms 61788 KB Output is correct
35 Correct 17 ms 62020 KB Output is correct
36 Correct 19 ms 61964 KB Output is correct
37 Correct 18 ms 61788 KB Output is correct
38 Correct 20 ms 62040 KB Output is correct
39 Correct 20 ms 61784 KB Output is correct
40 Correct 18 ms 62036 KB Output is correct
41 Correct 19 ms 61788 KB Output is correct
42 Correct 20 ms 61928 KB Output is correct
43 Correct 18 ms 61784 KB Output is correct
44 Correct 18 ms 61788 KB Output is correct
45 Correct 19 ms 61896 KB Output is correct
46 Correct 19 ms 62052 KB Output is correct
47 Correct 18 ms 62040 KB Output is correct
48 Correct 19 ms 62044 KB Output is correct
49 Correct 18 ms 61920 KB Output is correct
50 Correct 18 ms 62044 KB Output is correct
51 Correct 18 ms 61912 KB Output is correct
52 Correct 18 ms 61968 KB Output is correct
53 Correct 18 ms 61916 KB Output is correct
54 Correct 19 ms 62044 KB Output is correct
55 Correct 19 ms 62044 KB Output is correct
56 Correct 23 ms 61948 KB Output is correct
57 Correct 24 ms 62044 KB Output is correct
58 Correct 18 ms 62024 KB Output is correct
59 Correct 18 ms 62044 KB Output is correct
60 Correct 20 ms 62016 KB Output is correct
61 Correct 18 ms 62044 KB Output is correct
62 Correct 23 ms 62044 KB Output is correct
63 Correct 19 ms 62092 KB Output is correct
64 Correct 19 ms 62044 KB Output is correct
65 Correct 18 ms 62044 KB Output is correct
66 Correct 344 ms 126416 KB Output is correct
67 Correct 331 ms 141072 KB Output is correct
68 Correct 348 ms 144128 KB Output is correct
69 Correct 338 ms 140240 KB Output is correct
70 Correct 432 ms 141120 KB Output is correct
71 Correct 379 ms 144488 KB Output is correct
72 Correct 343 ms 143608 KB Output is correct
73 Correct 338 ms 141372 KB Output is correct
74 Correct 325 ms 144188 KB Output is correct
75 Correct 388 ms 144032 KB Output is correct
76 Correct 371 ms 141364 KB Output is correct
77 Correct 349 ms 144300 KB Output is correct
78 Correct 484 ms 139364 KB Output is correct
79 Correct 405 ms 139584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 61784 KB Output is correct
2 Correct 19 ms 61788 KB Output is correct
3 Correct 18 ms 62036 KB Output is correct
4 Correct 19 ms 61784 KB Output is correct
5 Correct 18 ms 61788 KB Output is correct
6 Correct 18 ms 62028 KB Output is correct
7 Correct 17 ms 61788 KB Output is correct
8 Correct 19 ms 61784 KB Output is correct
9 Correct 18 ms 61788 KB Output is correct
10 Correct 18 ms 61788 KB Output is correct
11 Correct 19 ms 62016 KB Output is correct
12 Correct 17 ms 61788 KB Output is correct
13 Correct 18 ms 61956 KB Output is correct
14 Correct 19 ms 61788 KB Output is correct
15 Correct 18 ms 61968 KB Output is correct
16 Correct 18 ms 61784 KB Output is correct
17 Correct 18 ms 61788 KB Output is correct
18 Correct 18 ms 61788 KB Output is correct
19 Correct 17 ms 62228 KB Output is correct
20 Correct 18 ms 61788 KB Output is correct
21 Correct 17 ms 61788 KB Output is correct
22 Correct 18 ms 61788 KB Output is correct
23 Correct 18 ms 61788 KB Output is correct
24 Correct 17 ms 61904 KB Output is correct
25 Correct 19 ms 61972 KB Output is correct
26 Correct 19 ms 61788 KB Output is correct
27 Correct 18 ms 61900 KB Output is correct
28 Correct 19 ms 62012 KB Output is correct
29 Correct 18 ms 61788 KB Output is correct
30 Correct 18 ms 61784 KB Output is correct
31 Correct 18 ms 61788 KB Output is correct
32 Correct 19 ms 62000 KB Output is correct
33 Correct 19 ms 61788 KB Output is correct
34 Correct 18 ms 61788 KB Output is correct
35 Correct 17 ms 62020 KB Output is correct
36 Correct 19 ms 61964 KB Output is correct
37 Correct 18 ms 61788 KB Output is correct
38 Correct 20 ms 62040 KB Output is correct
39 Correct 20 ms 61784 KB Output is correct
40 Correct 18 ms 62036 KB Output is correct
41 Correct 19 ms 61788 KB Output is correct
42 Correct 20 ms 61928 KB Output is correct
43 Correct 18 ms 61784 KB Output is correct
44 Correct 18 ms 61788 KB Output is correct
45 Correct 19 ms 61896 KB Output is correct
46 Correct 19 ms 62052 KB Output is correct
47 Correct 18 ms 62040 KB Output is correct
48 Correct 19 ms 62044 KB Output is correct
49 Correct 18 ms 61920 KB Output is correct
50 Correct 18 ms 62044 KB Output is correct
51 Correct 18 ms 61912 KB Output is correct
52 Correct 18 ms 61968 KB Output is correct
53 Correct 18 ms 61916 KB Output is correct
54 Correct 19 ms 62044 KB Output is correct
55 Correct 19 ms 62044 KB Output is correct
56 Correct 23 ms 61948 KB Output is correct
57 Correct 24 ms 62044 KB Output is correct
58 Correct 18 ms 62024 KB Output is correct
59 Correct 18 ms 62044 KB Output is correct
60 Correct 20 ms 62016 KB Output is correct
61 Correct 18 ms 62044 KB Output is correct
62 Correct 23 ms 62044 KB Output is correct
63 Correct 19 ms 62092 KB Output is correct
64 Correct 19 ms 62044 KB Output is correct
65 Correct 18 ms 62044 KB Output is correct
66 Correct 26 ms 63904 KB Output is correct
67 Correct 24 ms 63832 KB Output is correct
68 Correct 24 ms 64088 KB Output is correct
69 Correct 28 ms 63772 KB Output is correct
70 Correct 25 ms 63584 KB Output is correct
71 Correct 35 ms 63584 KB Output is correct
72 Correct 29 ms 63892 KB Output is correct
73 Correct 24 ms 64092 KB Output is correct
74 Correct 24 ms 63832 KB Output is correct
75 Correct 24 ms 63940 KB Output is correct
76 Correct 24 ms 63832 KB Output is correct
77 Correct 24 ms 63992 KB Output is correct
78 Correct 25 ms 63836 KB Output is correct
79 Correct 24 ms 63828 KB Output is correct
80 Correct 24 ms 63828 KB Output is correct
81 Correct 25 ms 63928 KB Output is correct
82 Runtime error 74 ms 128596 KB Execution killed with signal 11
83 Halted 0 ms 0 KB -