Submission #760813

# Submission time Handle Problem Language Result Execution time Memory
760813 2023-06-18T14:33:35 Z azberjibiou Double Attendance (CCO22_day1problem3) C++17
25 / 25
931 ms 84864 KB
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define gibon ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define pdd pair<long double, long double>
#define pii pair<int, int>
#define pll pair<ll, ll>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
using namespace std;
const int mxN=300020;
const int mxK=14;
const int MOD=1000000007;
const ll INF=1e18;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
ll N[2], K, M;
pll A[2][mxN];
vector <pll> coor;
ll dp[2][mxN];
ll ans;
bool add_zero;
pll seg1[2][4*mxN];
ll seg2[2][4*mxN];
void upd2(int idx, int s, int e, int pos, int val, int i)
{
    if(s==e)
    {
        seg2[i][idx]=val;
        return;
    }
    int mid=(s+e)/2;
    if(pos<=mid)    upd2(2*idx, s, mid, pos, val, i);
    else    upd2(2*idx+1, mid+1, e, pos, val, i);
    seg2[i][idx]=max(seg2[i][2*idx], seg2[i][2*idx+1]);
}
int solv2(int idx, int s1, int e1, int s2, int e2, int i)
{
    if(s2<=s1 && e1<=e2)    return seg2[i][idx];
    if(s2>e1 || s1>e2)  return 0;
    int mid=(s1+e1)/2;
    return max(solv2(2*idx, s1, mid, s2, e2, i), solv2(2*idx+1, mid+1, e1, s2, e2, i));
}
void init1(int idx, int s, int e)
{
    if(s==e)    seg1[0][idx]=pll(A[0][s].fi-2*K*s, A[0][s].se-2*K*s), seg1[1][idx]=pll(A[1][s].fi-2*K*s, A[1][s].se-2*K*s);
    else
    {
        int mid=(s+e)/2;
        init1(2*idx, s, mid);
        init1(2*idx+1, mid+1, e);
        for(int i=0;i<2;i++)
        {
            seg1[i][idx].fi=max(seg1[i][2*idx].fi, seg1[i][2*idx+1].fi);
            seg1[i][idx].se=min(seg1[i][2*idx].se, seg1[i][2*idx+1].se);
        }
    }
}
pll solv1(int idx, int s1, int e1, int s2, int e2, int i)
{
    if(s2<=s1 && e1<=e2)    return seg1[i][idx];
    if(s2>e1 || s1>e2)  return pll(-INF, INF);
    int mid=(s1+e1)/2;
    pll r1=solv1(2*idx, s1, mid, s2, e2, i), r2=solv1(2*idx+1, mid+1, e1, s2, e2, i);
    return pll(max(r1.fi, r2.fi), min(r1.se, r2.se));
}

void input()
{
    cin >> N[0] >> N[1] >> K;
    for(int i=0;i<N[0];i++)   cin >> A[0][i].fi >> A[0][i].se, A[0][i].se--;
    for(int i=0;i<N[1];i++)   cin >> A[1][i].fi >> A[1][i].se, A[1][i].se--;
    sort(A[0], A[0]+N[0]);
    sort(A[1], A[1]+N[1]);
    if(A[0][0].fi!=0)
    {
        add_zero=true;
        for(int i=N[0];i>=1;i--)    A[0][i]=A[0][i-1];
        A[0][0]=pii(0, 0);
        N[0]++;
    }
    M=max(N[0], N[1]);
}
void make_coor()
{
    for(int i=0;i<2;i++)    for(int j=0;j<N[i];j++)    coor.emplace_back(i, j);
    sort(all(coor), [](pii a, pii b){return A[a.fi][a.se].fi>A[b.fi][b.se].fi;});
}
ll f(int idx, int s, int lim)
{
    if(s==N[idx])   return 0;
    if(A[idx][s].fi>lim-K)  return dp[idx][s];
    int e1=lower_bound(A[idx], A[idx]+N[idx], pll(lim-K+1, 0), [](pll a, pll b){return a.fi<b.fi;})-A[idx];
    int e2=lower_bound(A[1-idx], A[1-idx]+N[1-idx], pll(lim+1, 0), [](pll a, pll b){return a.fi<b.fi;})-A[1-idx];
    ll res=0;
    res=max(res, e1-s+dp[idx][e1]);
    res=max(res, e1-s-2+dp[idx][e1-1]);
    return res;
}
int bin_search_r1(int idx, int s1, int e1, int s2, int e2, ll val, int i)
{
    if(s2>e1 || s1>e2)  return e1+1;
    if(s2<=s1 && e1<=e2)
    {
        if(seg1[i][idx].fi<=val && seg1[i][idx].se>=val)  return e1+1;
        if(s1==e1)  return s1;
    }
    int mid=(s1+e1)/2;
    if(e2<=mid) return bin_search_r1(2*idx, s1, mid, s2, e2, val, i);
    if(s2>mid)  return bin_search_r1(2*idx+1, mid+1, e1, s2, e2, val, i);
    int res1=bin_search_r1(2*idx, s1, mid, s2, e2, val, i);
    if(res1!=mid+1) return res1;
    return bin_search_r1(2*idx+1, mid+1, e1, s2, e2, val, i);
}
int bin_search1(int idx, ll val, int s, int e)
{
    pll tmp=solv1(1, 0, M-1, s, e, idx);
    if(val<=tmp.se && val>=tmp.fi)  return e;
    return bin_search_r1(1, 0, M-1, s, e, val, idx)-1;
}
void mx(ll &a, ll b){a=max(a, b);}
int main()
{
    gibon
    input();
    make_coor();
    init1(1, 0, M-1);
    upd2(1, 0, M, N[0], 2*N[0], 0);
    upd2(1, 0, M, N[1], 2*N[1], 1);
    for(auto [idx, now] : coor)
    {
        ll nc=A[idx][now].fi;
        dp[idx][now]=dp[idx][now+1]+1;
        ll s1=now, s2=lower_bound(A[1-idx], A[1-idx]+N[1-idx], pll(nc+K, nc+K), [](pll a, pll b){return a.se<b.se;})-A[1-idx];
        if(s2==N[1-idx])
        {
            upd2(1, 0, M, now, dp[idx][now]+2*now, idx);
            continue;
        }
        if(A[1-idx][s2].fi>nc+K)
        {
            mx(dp[idx][now], f(1-idx, s2, A[idx][now].se)+1);
            upd2(1, 0, M, now, dp[idx][now]+2*now, idx);
            continue;
        }
        ll c1=bin_search1(idx, nc-2*K*s1, s1, N[idx]-1), c2=bin_search1(1-idx, nc+K-2*K*s2, s2, N[1-idx]-1);
        /*
        ll c1=s1, c2=s2;
        while(c1+1<N[idx] && nc+2*K*(c1+1-s1)<=A[idx][c1+1].se && nc+2*K*(c1+1-s1)>=A[idx][c1+1].fi)  c1++;
        while(c2+1<N[1-idx] && nc+2*K*(c2+1-s2)+K<=A[1-idx][c2+1].se && nc+2*K*(c2+1-s2)+K>=A[1-idx][c2+1].fi)    c2++;
        */
        if(c2-s2<c1-s1-1)   c1=c2-s2+s1+1;
        if(c2-s2>c1-s1)     c2=c1-s1+s2;
        if(c2-s2==c1-s1)
        {
            mx(dp[idx][now], solv2(1, 0, M, s1+1, c1+1, idx)-2*s1-1);
            if(s2<=c2-1)    mx(dp[idx][now], solv2(1, 0, M, s2+1, c2, 1-idx)-2*s2);
            /*
            for(int i=s1;i<=c1;i++) mx(dp[idx][now], dp[idx][i+1]+2*(i-s1)+1);
            for(int i=s2;i<c2;i++) mx(dp[idx][now], dp[1-idx][i+1]+2*(i-s2)+2);
            */
            mx(dp[idx][now], f(1-idx, c2+1, A[idx][c1].se)+c1-s1+c2-s2+2);
            ll nxt=nc+2*K*(c1-s1+1);
            if(c1+1<N[idx] && nxt<A[idx][c1+1].fi)  mx(dp[idx][now], f(idx, c1+1, A[1-idx][c2].se)+2*(c1-s1+1));
        }
        else
        {
            if(s1<=c1-1)    mx(dp[idx][now], solv2(1, 0, M, s1+1, c1, idx)-2*s1-1);
            mx(dp[idx][now], solv2(1, 0, M, s2+1, c2+1, 1-idx)-2*s2);
            /*
            for(int i=s1;i<c1;i++) mx(dp[idx][now], dp[idx][i+1]+2*(i-s1)+1);
            for(int i=s2;i<=c2;i++) mx(dp[idx][now], dp[1-idx][i+1]+2*(i-s2)+2);
            */
            mx(dp[idx][now], f(idx, c1+1, A[1-idx][c2].se)+2*(c1-s1)+1);
            ll nxt=nc+2*K*(c1-s1)+K;
            if(c2+1<N[1-idx] && nxt<A[1-idx][c2+1].fi)  mx(dp[idx][now], f(1-idx, c2+1, A[idx][c1].se)+2*(c1-s1)+1);
        }
        upd2(1, 0, M, now, dp[idx][now]+2*now, idx);
    }
    cout << dp[0][0]-(add_zero ? 1 : 0);
}
/*
3 3 10
1 30
31 60
61 90
15 45
45 90
90 120
*/

Compilation message

Main.cpp: In function 'll f(int, int, int)':
Main.cpp:96:9: warning: unused variable 'e2' [-Wunused-variable]
   96 |     int e2=lower_bound(A[1-idx], A[1-idx]+N[1-idx], pll(lim+1, 0), [](pll a, pll b){return a.fi<b.fi;})-A[1-idx];
      |         ^~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 1 ms 296 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 0 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 0 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 356 KB Output is correct
47 Correct 0 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 0 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 1 ms 296 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 0 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 0 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 356 KB Output is correct
47 Correct 0 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 0 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 0 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 0 ms 340 KB Output is correct
55 Correct 0 ms 340 KB Output is correct
56 Correct 0 ms 340 KB Output is correct
57 Correct 1 ms 596 KB Output is correct
58 Correct 2 ms 596 KB Output is correct
59 Correct 2 ms 596 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 0 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 3 ms 724 KB Output is correct
65 Correct 2 ms 724 KB Output is correct
66 Correct 2 ms 724 KB Output is correct
67 Correct 2 ms 724 KB Output is correct
68 Correct 2 ms 724 KB Output is correct
69 Correct 3 ms 728 KB Output is correct
70 Correct 3 ms 724 KB Output is correct
71 Correct 2 ms 596 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 0 ms 340 KB Output is correct
75 Correct 0 ms 340 KB Output is correct
76 Correct 0 ms 340 KB Output is correct
77 Correct 1 ms 596 KB Output is correct
78 Correct 2 ms 732 KB Output is correct
79 Correct 3 ms 724 KB Output is correct
80 Correct 3 ms 724 KB Output is correct
81 Correct 2 ms 724 KB Output is correct
82 Correct 1 ms 468 KB Output is correct
83 Correct 2 ms 724 KB Output is correct
84 Correct 1 ms 724 KB Output is correct
85 Correct 2 ms 724 KB Output is correct
86 Correct 1 ms 596 KB Output is correct
87 Correct 0 ms 340 KB Output is correct
88 Correct 0 ms 340 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 0 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 0 ms 340 KB Output is correct
95 Correct 1 ms 360 KB Output is correct
96 Correct 0 ms 340 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 468 KB Output is correct
99 Correct 1 ms 468 KB Output is correct
100 Correct 1 ms 468 KB Output is correct
101 Correct 1 ms 468 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 0 ms 340 KB Output is correct
104 Correct 0 ms 340 KB Output is correct
105 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 3 ms 724 KB Output is correct
4 Correct 4 ms 724 KB Output is correct
5 Correct 3 ms 724 KB Output is correct
6 Correct 3 ms 724 KB Output is correct
7 Correct 3 ms 792 KB Output is correct
8 Correct 2 ms 724 KB Output is correct
9 Correct 3 ms 724 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 1 ms 596 KB Output is correct
12 Correct 3 ms 724 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 2 ms 724 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 2 ms 724 KB Output is correct
17 Correct 3 ms 724 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 2 ms 724 KB Output is correct
20 Correct 3 ms 760 KB Output is correct
21 Correct 2 ms 724 KB Output is correct
22 Correct 2 ms 800 KB Output is correct
23 Correct 2 ms 744 KB Output is correct
24 Correct 1 ms 596 KB Output is correct
25 Correct 2 ms 724 KB Output is correct
26 Correct 2 ms 724 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 2 ms 724 KB Output is correct
29 Correct 2 ms 724 KB Output is correct
30 Correct 1 ms 596 KB Output is correct
31 Correct 3 ms 724 KB Output is correct
32 Correct 2 ms 724 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 2 ms 724 KB Output is correct
43 Correct 3 ms 724 KB Output is correct
44 Correct 3 ms 724 KB Output is correct
45 Correct 2 ms 724 KB Output is correct
46 Correct 3 ms 724 KB Output is correct
47 Correct 1 ms 596 KB Output is correct
48 Correct 1 ms 596 KB Output is correct
49 Correct 1 ms 596 KB Output is correct
50 Correct 1 ms 596 KB Output is correct
51 Correct 1 ms 596 KB Output is correct
52 Correct 1 ms 596 KB Output is correct
53 Correct 1 ms 596 KB Output is correct
54 Correct 1 ms 596 KB Output is correct
55 Correct 1 ms 596 KB Output is correct
56 Correct 1 ms 596 KB Output is correct
57 Correct 1 ms 596 KB Output is correct
58 Correct 2 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 1 ms 296 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 0 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 0 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 356 KB Output is correct
47 Correct 0 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 0 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 0 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 0 ms 340 KB Output is correct
55 Correct 0 ms 340 KB Output is correct
56 Correct 0 ms 340 KB Output is correct
57 Correct 1 ms 596 KB Output is correct
58 Correct 2 ms 596 KB Output is correct
59 Correct 2 ms 596 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 0 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 3 ms 724 KB Output is correct
65 Correct 2 ms 724 KB Output is correct
66 Correct 2 ms 724 KB Output is correct
67 Correct 2 ms 724 KB Output is correct
68 Correct 2 ms 724 KB Output is correct
69 Correct 3 ms 728 KB Output is correct
70 Correct 3 ms 724 KB Output is correct
71 Correct 2 ms 596 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 0 ms 340 KB Output is correct
75 Correct 0 ms 340 KB Output is correct
76 Correct 0 ms 340 KB Output is correct
77 Correct 1 ms 596 KB Output is correct
78 Correct 2 ms 732 KB Output is correct
79 Correct 3 ms 724 KB Output is correct
80 Correct 3 ms 724 KB Output is correct
81 Correct 2 ms 724 KB Output is correct
82 Correct 1 ms 468 KB Output is correct
83 Correct 2 ms 724 KB Output is correct
84 Correct 1 ms 724 KB Output is correct
85 Correct 2 ms 724 KB Output is correct
86 Correct 1 ms 596 KB Output is correct
87 Correct 0 ms 340 KB Output is correct
88 Correct 0 ms 340 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 0 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 0 ms 340 KB Output is correct
95 Correct 1 ms 360 KB Output is correct
96 Correct 0 ms 340 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 468 KB Output is correct
99 Correct 1 ms 468 KB Output is correct
100 Correct 1 ms 468 KB Output is correct
101 Correct 1 ms 468 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 0 ms 340 KB Output is correct
104 Correct 0 ms 340 KB Output is correct
105 Correct 1 ms 340 KB Output is correct
106 Correct 0 ms 340 KB Output is correct
107 Correct 1 ms 596 KB Output is correct
108 Correct 3 ms 724 KB Output is correct
109 Correct 4 ms 724 KB Output is correct
110 Correct 3 ms 724 KB Output is correct
111 Correct 3 ms 724 KB Output is correct
112 Correct 3 ms 792 KB Output is correct
113 Correct 2 ms 724 KB Output is correct
114 Correct 3 ms 724 KB Output is correct
115 Correct 2 ms 724 KB Output is correct
116 Correct 1 ms 596 KB Output is correct
117 Correct 3 ms 724 KB Output is correct
118 Correct 1 ms 596 KB Output is correct
119 Correct 2 ms 724 KB Output is correct
120 Correct 2 ms 724 KB Output is correct
121 Correct 2 ms 724 KB Output is correct
122 Correct 3 ms 724 KB Output is correct
123 Correct 1 ms 468 KB Output is correct
124 Correct 2 ms 724 KB Output is correct
125 Correct 3 ms 760 KB Output is correct
126 Correct 2 ms 724 KB Output is correct
127 Correct 2 ms 800 KB Output is correct
128 Correct 2 ms 744 KB Output is correct
129 Correct 1 ms 596 KB Output is correct
130 Correct 2 ms 724 KB Output is correct
131 Correct 2 ms 724 KB Output is correct
132 Correct 1 ms 596 KB Output is correct
133 Correct 2 ms 724 KB Output is correct
134 Correct 2 ms 724 KB Output is correct
135 Correct 1 ms 596 KB Output is correct
136 Correct 3 ms 724 KB Output is correct
137 Correct 2 ms 724 KB Output is correct
138 Correct 1 ms 340 KB Output is correct
139 Correct 0 ms 340 KB Output is correct
140 Correct 0 ms 340 KB Output is correct
141 Correct 0 ms 340 KB Output is correct
142 Correct 0 ms 340 KB Output is correct
143 Correct 0 ms 340 KB Output is correct
144 Correct 1 ms 340 KB Output is correct
145 Correct 1 ms 340 KB Output is correct
146 Correct 0 ms 340 KB Output is correct
147 Correct 2 ms 724 KB Output is correct
148 Correct 3 ms 724 KB Output is correct
149 Correct 3 ms 724 KB Output is correct
150 Correct 2 ms 724 KB Output is correct
151 Correct 3 ms 724 KB Output is correct
152 Correct 1 ms 596 KB Output is correct
153 Correct 1 ms 596 KB Output is correct
154 Correct 1 ms 596 KB Output is correct
155 Correct 1 ms 596 KB Output is correct
156 Correct 1 ms 596 KB Output is correct
157 Correct 1 ms 596 KB Output is correct
158 Correct 1 ms 596 KB Output is correct
159 Correct 1 ms 596 KB Output is correct
160 Correct 1 ms 596 KB Output is correct
161 Correct 1 ms 596 KB Output is correct
162 Correct 1 ms 596 KB Output is correct
163 Correct 2 ms 596 KB Output is correct
164 Correct 0 ms 340 KB Output is correct
165 Correct 246 ms 53276 KB Output is correct
166 Correct 638 ms 73212 KB Output is correct
167 Correct 753 ms 73212 KB Output is correct
168 Correct 3 ms 724 KB Output is correct
169 Correct 4 ms 724 KB Output is correct
170 Correct 34 ms 5052 KB Output is correct
171 Correct 45 ms 5072 KB Output is correct
172 Correct 617 ms 73132 KB Output is correct
173 Correct 931 ms 73160 KB Output is correct
174 Correct 632 ms 84712 KB Output is correct
175 Correct 2 ms 852 KB Output is correct
176 Correct 368 ms 84796 KB Output is correct
177 Correct 2 ms 724 KB Output is correct
178 Correct 339 ms 80908 KB Output is correct
179 Correct 2 ms 724 KB Output is correct
180 Correct 338 ms 80904 KB Output is correct
181 Correct 119 ms 19060 KB Output is correct
182 Correct 245 ms 37088 KB Output is correct
183 Correct 184 ms 29940 KB Output is correct
184 Correct 673 ms 84752 KB Output is correct
185 Correct 641 ms 84740 KB Output is correct
186 Correct 637 ms 84680 KB Output is correct
187 Correct 345 ms 62320 KB Output is correct
188 Correct 169 ms 32236 KB Output is correct
189 Correct 208 ms 35512 KB Output is correct
190 Correct 620 ms 84760 KB Output is correct
191 Correct 634 ms 84760 KB Output is correct
192 Correct 642 ms 84760 KB Output is correct
193 Correct 298 ms 39572 KB Output is correct
194 Correct 248 ms 36988 KB Output is correct
195 Correct 276 ms 38856 KB Output is correct
196 Correct 608 ms 84784 KB Output is correct
197 Correct 606 ms 84776 KB Output is correct
198 Correct 591 ms 84740 KB Output is correct
199 Correct 297 ms 63408 KB Output is correct
200 Correct 123 ms 23472 KB Output is correct
201 Correct 397 ms 69680 KB Output is correct
202 Correct 597 ms 84796 KB Output is correct
203 Correct 593 ms 84744 KB Output is correct
204 Correct 608 ms 84732 KB Output is correct
205 Correct 368 ms 73908 KB Output is correct
206 Correct 92 ms 21940 KB Output is correct
207 Correct 493 ms 84720 KB Output is correct
208 Correct 1 ms 340 KB Output is correct
209 Correct 1 ms 384 KB Output is correct
210 Correct 1 ms 340 KB Output is correct
211 Correct 1 ms 336 KB Output is correct
212 Correct 0 ms 340 KB Output is correct
213 Correct 1 ms 336 KB Output is correct
214 Correct 0 ms 340 KB Output is correct
215 Correct 1 ms 340 KB Output is correct
216 Correct 0 ms 344 KB Output is correct
217 Correct 617 ms 84864 KB Output is correct
218 Correct 672 ms 84716 KB Output is correct
219 Correct 612 ms 84780 KB Output is correct
220 Correct 667 ms 84704 KB Output is correct
221 Correct 598 ms 84788 KB Output is correct
222 Correct 94 ms 32184 KB Output is correct
223 Correct 112 ms 32260 KB Output is correct
224 Correct 152 ms 34488 KB Output is correct
225 Correct 121 ms 32056 KB Output is correct
226 Correct 231 ms 59060 KB Output is correct
227 Correct 146 ms 59048 KB Output is correct
228 Correct 163 ms 59108 KB Output is correct
229 Correct 130 ms 59064 KB Output is correct
230 Correct 258 ms 59120 KB Output is correct
231 Correct 273 ms 59052 KB Output is correct
232 Correct 221 ms 59040 KB Output is correct
233 Correct 206 ms 59060 KB Output is correct