Submission #1088800

# Submission time Handle Problem Language Result Execution time Memory
1088800 2024-09-15T06:13:18 Z modwwe Painting Walls (APIO20_paint) C++17
100 / 100
366 ms 261060 KB
#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
//#define int long long
//#define ll long long
#define down cout<<'\n';
#define debug cout<<" cucuucucuuu",down
#define NHP     ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
#define modwwe  int t;cin>>t; while(t--)
#define bit(i,j) (i>>j&1)
#define sobit(a) __builtin_popcountll(a)
#define task "test"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".ans","w",stdout)
#define pb push_back
#define checktime   cerr << (double)clock() / CLOCKS_PER_SEC * 1000  << " ms";
using namespace std;
#define getchar_unlocked getchar

inline int scan()
{
    char c = getchar_unlocked();
    int x = 0;
    while(c<'0'||c>'9')
    {
        c=getchar_unlocked();
    }
    while(c>='0'&&c<='9')
    {
        x=(x<<1)+(x<<3)+c-'0';
        c=getchar_unlocked();
    }
    return x;
}

void phongbeo();
const int inf=1e9;
const int mod2=1e9+9;
const int  mod1=998244353;
struct icd
{
    long double a;
    int b;
};
struct ib
{
    int a;
    int b;
};
struct ic
{
    int a,b,c;
};
struct id
{
    int a,b,c,d;
};
struct ie
{
    int a,b,c,d,e;

};

int n,m,s1,s2,s4,s3,sf,k,s5,s6,mx,s7,s8,s9,mx2,res,dem2=0,dem=0,s33,dem3,dem4,l,r,mid,l2,r2,center;
int  i,s10,s12;
int kk;
int el=29;

vector<int> v[100001];
int dp[100001][633];
int a[100001];
bool b[100001];
int c[100001];
vector<int> v2;
int minimumInstructions(int _n, int _m, int _K, vector<int> _C, vector<int> _A, vector<vector<int>> _B)
{
    n=_n;
    m=_m;
    k=_K;
    for(int i=1; i<=n; i++)
        a[i]=_C[i-1];
    for(int j=1; j<=m; j++)
    {
        l=_A[j-1];
        for(int i=1; i<=l; i++)
        {
            r=_B[j-1][i-1];
            v[r].pb(j);
        }
    }
    for(int i=1; i<=n; i++)
    {
        l=0;
        dem=0;
        if(v[a[i]].size()==0)
        {
            return -1;
        }
        for(auto x:v[a[i]])
        {
            dp[i][dem]=i;
            if(i!=1)
            {
                s10=v[a[i-1]].size();
                while(l<s10&&v[a[i-1]][l]<x)
                {
                    l++;
                }
                if(l>=1)
                    if(v[a[i-1]][l-1]==x-1)
                        dp[i][dem]=min(dp[i][dem],dp[i-1][l-1]);
                s8=v[a[i-1]].size()-1;
                if(x==1&&v[a[i-1]].back()==m)dp[i][dem]=min(dp[i][dem],dp[i-1][s8]);
            }
            if(dp[i][dem]<=i-m+1)
                b[i-m+1]=1;
            dem++;
        }

    }
    s5=-m;
    s4=0;
    for(int i=1; i<=n; i++)
    {
        c[i]+=c[i-1];
        if(b[i])s5=i;
        if(c[i]==0&&s5+m<=i)
        {
            return -1;
        }
        else if(c[i]==0) s4++,c[i]=1,c[s5+m]--;
    }
    return s4;
}
/*
main()
{
cout<<minimumInstructions(8, 3, 5, {3, 3, 1, 3, 4, 4, 2, 2}, {3, 2, 2}, {{0, 1, 2}, {2, 3}, {3, 4}});
}*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2604 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 2 ms 3932 KB Output is correct
8 Correct 2 ms 3932 KB Output is correct
9 Correct 2 ms 3932 KB Output is correct
10 Correct 2 ms 3940 KB Output is correct
11 Correct 2 ms 3932 KB Output is correct
12 Correct 3 ms 3932 KB Output is correct
13 Correct 3 ms 3980 KB Output is correct
14 Correct 2 ms 3932 KB Output is correct
15 Correct 2 ms 3932 KB Output is correct
16 Correct 2 ms 3928 KB Output is correct
17 Correct 2 ms 3932 KB Output is correct
18 Correct 2 ms 3932 KB Output is correct
19 Correct 2 ms 2648 KB Output is correct
20 Correct 2 ms 2652 KB Output is correct
21 Correct 2 ms 2716 KB Output is correct
22 Correct 14 ms 7772 KB Output is correct
23 Correct 16 ms 7772 KB Output is correct
24 Correct 16 ms 7768 KB Output is correct
25 Correct 16 ms 52572 KB Output is correct
26 Correct 16 ms 52668 KB Output is correct
27 Correct 23 ms 52568 KB Output is correct
28 Correct 18 ms 52568 KB Output is correct
29 Correct 19 ms 52392 KB Output is correct
30 Correct 18 ms 52388 KB Output is correct
31 Correct 24 ms 53596 KB Output is correct
32 Correct 24 ms 53596 KB Output is correct
33 Correct 23 ms 53596 KB Output is correct
34 Correct 22 ms 53596 KB Output is correct
35 Correct 22 ms 53596 KB Output is correct
36 Correct 23 ms 53596 KB Output is correct
37 Correct 34 ms 56400 KB Output is correct
38 Correct 32 ms 56408 KB Output is correct
39 Correct 31 ms 56408 KB Output is correct
40 Correct 70 ms 229040 KB Output is correct
41 Correct 48 ms 144212 KB Output is correct
42 Correct 82 ms 247892 KB Output is correct
43 Correct 55 ms 165460 KB Output is correct
44 Correct 54 ms 150612 KB Output is correct
45 Correct 85 ms 251216 KB Output is correct
46 Correct 97 ms 226128 KB Output is correct
47 Correct 63 ms 145708 KB Output is correct
48 Correct 67 ms 148568 KB Output is correct
49 Correct 81 ms 160732 KB Output is correct
50 Correct 78 ms 183636 KB Output is correct
51 Correct 72 ms 190804 KB Output is correct
52 Correct 96 ms 251988 KB Output is correct
53 Correct 87 ms 251984 KB Output is correct
54 Correct 93 ms 251988 KB Output is correct
55 Correct 84 ms 251728 KB Output is correct
56 Correct 82 ms 251732 KB Output is correct
57 Correct 81 ms 251728 KB Output is correct
58 Correct 131 ms 260944 KB Output is correct
59 Correct 121 ms 260944 KB Output is correct
60 Correct 114 ms 260976 KB Output is correct
61 Correct 111 ms 260944 KB Output is correct
62 Correct 110 ms 261060 KB Output is correct
63 Correct 123 ms 260948 KB Output is correct
64 Correct 115 ms 259752 KB Output is correct
65 Correct 116 ms 259816 KB Output is correct
66 Correct 112 ms 259700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2604 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 2 ms 3932 KB Output is correct
8 Correct 2 ms 3932 KB Output is correct
9 Correct 2 ms 3932 KB Output is correct
10 Correct 2 ms 3940 KB Output is correct
11 Correct 2 ms 3932 KB Output is correct
12 Correct 3 ms 3932 KB Output is correct
13 Correct 3 ms 3980 KB Output is correct
14 Correct 2 ms 3932 KB Output is correct
15 Correct 2 ms 3932 KB Output is correct
16 Correct 2 ms 3928 KB Output is correct
17 Correct 2 ms 3932 KB Output is correct
18 Correct 2 ms 3932 KB Output is correct
19 Correct 2 ms 2648 KB Output is correct
20 Correct 2 ms 2652 KB Output is correct
21 Correct 2 ms 2716 KB Output is correct
22 Correct 2 ms 2648 KB Output is correct
23 Correct 2 ms 2652 KB Output is correct
24 Correct 1 ms 2652 KB Output is correct
25 Correct 2 ms 2656 KB Output is correct
26 Correct 2 ms 2652 KB Output is correct
27 Correct 2 ms 3420 KB Output is correct
28 Correct 2 ms 3420 KB Output is correct
29 Correct 2 ms 3420 KB Output is correct
30 Correct 2 ms 3420 KB Output is correct
31 Correct 2 ms 3676 KB Output is correct
32 Correct 2 ms 3676 KB Output is correct
33 Correct 2 ms 3676 KB Output is correct
34 Correct 2 ms 3720 KB Output is correct
35 Correct 2 ms 3420 KB Output is correct
36 Correct 2 ms 3676 KB Output is correct
37 Correct 2 ms 3420 KB Output is correct
38 Correct 1 ms 2652 KB Output is correct
39 Correct 2 ms 3416 KB Output is correct
40 Correct 3 ms 2652 KB Output is correct
41 Correct 2 ms 3420 KB Output is correct
42 Correct 1 ms 2652 KB Output is correct
43 Correct 2 ms 3420 KB Output is correct
44 Correct 2 ms 3932 KB Output is correct
45 Correct 2 ms 3928 KB Output is correct
46 Correct 2 ms 3808 KB Output is correct
47 Correct 2 ms 3852 KB Output is correct
48 Correct 3 ms 3932 KB Output is correct
49 Correct 2 ms 3932 KB Output is correct
50 Correct 2 ms 3928 KB Output is correct
51 Correct 2 ms 3932 KB Output is correct
52 Correct 2 ms 4084 KB Output is correct
53 Correct 2 ms 3932 KB Output is correct
54 Correct 2 ms 3932 KB Output is correct
55 Correct 2 ms 3932 KB Output is correct
56 Correct 1 ms 2652 KB Output is correct
57 Correct 2 ms 4024 KB Output is correct
58 Correct 2 ms 2652 KB Output is correct
59 Correct 3 ms 3932 KB Output is correct
60 Correct 2 ms 2652 KB Output is correct
61 Correct 2 ms 3932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2648 KB Output is correct
2 Correct 2 ms 2652 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2604 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 2 ms 3932 KB Output is correct
10 Correct 2 ms 3932 KB Output is correct
11 Correct 2 ms 3932 KB Output is correct
12 Correct 2 ms 3940 KB Output is correct
13 Correct 2 ms 3932 KB Output is correct
14 Correct 3 ms 3932 KB Output is correct
15 Correct 3 ms 3980 KB Output is correct
16 Correct 2 ms 3932 KB Output is correct
17 Correct 2 ms 3932 KB Output is correct
18 Correct 2 ms 3928 KB Output is correct
19 Correct 2 ms 3932 KB Output is correct
20 Correct 2 ms 3932 KB Output is correct
21 Correct 2 ms 2648 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2716 KB Output is correct
24 Correct 14 ms 7772 KB Output is correct
25 Correct 16 ms 7772 KB Output is correct
26 Correct 16 ms 7768 KB Output is correct
27 Correct 1 ms 2652 KB Output is correct
28 Correct 2 ms 2656 KB Output is correct
29 Correct 2 ms 2652 KB Output is correct
30 Correct 2 ms 3420 KB Output is correct
31 Correct 2 ms 3420 KB Output is correct
32 Correct 2 ms 3420 KB Output is correct
33 Correct 2 ms 3420 KB Output is correct
34 Correct 2 ms 3676 KB Output is correct
35 Correct 2 ms 3676 KB Output is correct
36 Correct 2 ms 3676 KB Output is correct
37 Correct 2 ms 3720 KB Output is correct
38 Correct 2 ms 3420 KB Output is correct
39 Correct 2 ms 3676 KB Output is correct
40 Correct 2 ms 3420 KB Output is correct
41 Correct 1 ms 2652 KB Output is correct
42 Correct 2 ms 3416 KB Output is correct
43 Correct 3 ms 2652 KB Output is correct
44 Correct 2 ms 3420 KB Output is correct
45 Correct 1 ms 2652 KB Output is correct
46 Correct 2 ms 3420 KB Output is correct
47 Correct 2 ms 3932 KB Output is correct
48 Correct 2 ms 3928 KB Output is correct
49 Correct 2 ms 3808 KB Output is correct
50 Correct 2 ms 3852 KB Output is correct
51 Correct 3 ms 3932 KB Output is correct
52 Correct 2 ms 3932 KB Output is correct
53 Correct 2 ms 3928 KB Output is correct
54 Correct 2 ms 3932 KB Output is correct
55 Correct 2 ms 4084 KB Output is correct
56 Correct 2 ms 3932 KB Output is correct
57 Correct 2 ms 3932 KB Output is correct
58 Correct 2 ms 3932 KB Output is correct
59 Correct 1 ms 2652 KB Output is correct
60 Correct 2 ms 4024 KB Output is correct
61 Correct 2 ms 2652 KB Output is correct
62 Correct 3 ms 3932 KB Output is correct
63 Correct 2 ms 2652 KB Output is correct
64 Correct 2 ms 3932 KB Output is correct
65 Correct 2 ms 3420 KB Output is correct
66 Correct 2 ms 3932 KB Output is correct
67 Correct 2 ms 3932 KB Output is correct
68 Correct 2 ms 3932 KB Output is correct
69 Correct 2 ms 3932 KB Output is correct
70 Correct 3 ms 3932 KB Output is correct
71 Correct 3 ms 3932 KB Output is correct
72 Correct 3 ms 3932 KB Output is correct
73 Correct 2 ms 3672 KB Output is correct
74 Correct 2 ms 3676 KB Output is correct
75 Correct 2 ms 3672 KB Output is correct
76 Correct 15 ms 5468 KB Output is correct
77 Correct 12 ms 5788 KB Output is correct
78 Correct 20 ms 6236 KB Output is correct
79 Correct 3 ms 4184 KB Output is correct
80 Correct 3 ms 3932 KB Output is correct
81 Correct 2 ms 3932 KB Output is correct
82 Correct 2 ms 4032 KB Output is correct
83 Correct 2 ms 3872 KB Output is correct
84 Correct 3 ms 4188 KB Output is correct
85 Correct 3 ms 4188 KB Output is correct
86 Correct 3 ms 4104 KB Output is correct
87 Correct 3 ms 4188 KB Output is correct
88 Correct 3 ms 4188 KB Output is correct
89 Correct 3 ms 4076 KB Output is correct
90 Correct 18 ms 6312 KB Output is correct
91 Correct 22 ms 6440 KB Output is correct
92 Correct 20 ms 6488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2648 KB Output is correct
2 Correct 2 ms 2652 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2604 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 2 ms 3932 KB Output is correct
10 Correct 2 ms 3932 KB Output is correct
11 Correct 2 ms 3932 KB Output is correct
12 Correct 2 ms 3940 KB Output is correct
13 Correct 2 ms 3932 KB Output is correct
14 Correct 3 ms 3932 KB Output is correct
15 Correct 3 ms 3980 KB Output is correct
16 Correct 2 ms 3932 KB Output is correct
17 Correct 2 ms 3932 KB Output is correct
18 Correct 2 ms 3928 KB Output is correct
19 Correct 2 ms 3932 KB Output is correct
20 Correct 2 ms 3932 KB Output is correct
21 Correct 2 ms 2648 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2716 KB Output is correct
24 Correct 14 ms 7772 KB Output is correct
25 Correct 16 ms 7772 KB Output is correct
26 Correct 16 ms 7768 KB Output is correct
27 Correct 16 ms 52572 KB Output is correct
28 Correct 16 ms 52668 KB Output is correct
29 Correct 23 ms 52568 KB Output is correct
30 Correct 18 ms 52568 KB Output is correct
31 Correct 19 ms 52392 KB Output is correct
32 Correct 18 ms 52388 KB Output is correct
33 Correct 24 ms 53596 KB Output is correct
34 Correct 24 ms 53596 KB Output is correct
35 Correct 23 ms 53596 KB Output is correct
36 Correct 22 ms 53596 KB Output is correct
37 Correct 22 ms 53596 KB Output is correct
38 Correct 23 ms 53596 KB Output is correct
39 Correct 34 ms 56400 KB Output is correct
40 Correct 32 ms 56408 KB Output is correct
41 Correct 31 ms 56408 KB Output is correct
42 Correct 1 ms 2652 KB Output is correct
43 Correct 2 ms 2656 KB Output is correct
44 Correct 2 ms 2652 KB Output is correct
45 Correct 2 ms 3420 KB Output is correct
46 Correct 2 ms 3420 KB Output is correct
47 Correct 2 ms 3420 KB Output is correct
48 Correct 2 ms 3420 KB Output is correct
49 Correct 2 ms 3676 KB Output is correct
50 Correct 2 ms 3676 KB Output is correct
51 Correct 2 ms 3676 KB Output is correct
52 Correct 2 ms 3720 KB Output is correct
53 Correct 2 ms 3420 KB Output is correct
54 Correct 2 ms 3676 KB Output is correct
55 Correct 2 ms 3420 KB Output is correct
56 Correct 1 ms 2652 KB Output is correct
57 Correct 2 ms 3416 KB Output is correct
58 Correct 3 ms 2652 KB Output is correct
59 Correct 2 ms 3420 KB Output is correct
60 Correct 1 ms 2652 KB Output is correct
61 Correct 2 ms 3420 KB Output is correct
62 Correct 2 ms 3932 KB Output is correct
63 Correct 2 ms 3928 KB Output is correct
64 Correct 2 ms 3808 KB Output is correct
65 Correct 2 ms 3852 KB Output is correct
66 Correct 3 ms 3932 KB Output is correct
67 Correct 2 ms 3932 KB Output is correct
68 Correct 2 ms 3928 KB Output is correct
69 Correct 2 ms 3932 KB Output is correct
70 Correct 2 ms 4084 KB Output is correct
71 Correct 2 ms 3932 KB Output is correct
72 Correct 2 ms 3932 KB Output is correct
73 Correct 2 ms 3932 KB Output is correct
74 Correct 1 ms 2652 KB Output is correct
75 Correct 2 ms 4024 KB Output is correct
76 Correct 2 ms 2652 KB Output is correct
77 Correct 3 ms 3932 KB Output is correct
78 Correct 2 ms 2652 KB Output is correct
79 Correct 2 ms 3932 KB Output is correct
80 Correct 2 ms 3420 KB Output is correct
81 Correct 2 ms 3932 KB Output is correct
82 Correct 2 ms 3932 KB Output is correct
83 Correct 2 ms 3932 KB Output is correct
84 Correct 2 ms 3932 KB Output is correct
85 Correct 3 ms 3932 KB Output is correct
86 Correct 3 ms 3932 KB Output is correct
87 Correct 3 ms 3932 KB Output is correct
88 Correct 2 ms 3672 KB Output is correct
89 Correct 2 ms 3676 KB Output is correct
90 Correct 2 ms 3672 KB Output is correct
91 Correct 15 ms 5468 KB Output is correct
92 Correct 12 ms 5788 KB Output is correct
93 Correct 20 ms 6236 KB Output is correct
94 Correct 3 ms 4184 KB Output is correct
95 Correct 3 ms 3932 KB Output is correct
96 Correct 2 ms 3932 KB Output is correct
97 Correct 2 ms 4032 KB Output is correct
98 Correct 2 ms 3872 KB Output is correct
99 Correct 3 ms 4188 KB Output is correct
100 Correct 3 ms 4188 KB Output is correct
101 Correct 3 ms 4104 KB Output is correct
102 Correct 3 ms 4188 KB Output is correct
103 Correct 3 ms 4188 KB Output is correct
104 Correct 3 ms 4076 KB Output is correct
105 Correct 18 ms 6312 KB Output is correct
106 Correct 22 ms 6440 KB Output is correct
107 Correct 20 ms 6488 KB Output is correct
108 Correct 17 ms 52316 KB Output is correct
109 Correct 52 ms 38912 KB Output is correct
110 Correct 35 ms 33364 KB Output is correct
111 Correct 28 ms 31324 KB Output is correct
112 Correct 35 ms 41012 KB Output is correct
113 Correct 28 ms 29520 KB Output is correct
114 Correct 19 ms 31580 KB Output is correct
115 Correct 18 ms 28764 KB Output is correct
116 Correct 25 ms 49092 KB Output is correct
117 Correct 17 ms 30812 KB Output is correct
118 Correct 21 ms 35200 KB Output is correct
119 Correct 20 ms 39212 KB Output is correct
120 Correct 15 ms 5212 KB Output is correct
121 Correct 14 ms 32604 KB Output is correct
122 Correct 22 ms 5468 KB Output is correct
123 Correct 18 ms 31504 KB Output is correct
124 Correct 16 ms 5980 KB Output is correct
125 Correct 21 ms 49752 KB Output is correct
126 Correct 18 ms 42076 KB Output is correct
127 Correct 22 ms 49816 KB Output is correct
128 Correct 16 ms 36956 KB Output is correct
129 Correct 18 ms 38236 KB Output is correct
130 Correct 18 ms 52428 KB Output is correct
131 Correct 77 ms 52564 KB Output is correct
132 Correct 61 ms 52648 KB Output is correct
133 Correct 60 ms 52504 KB Output is correct
134 Correct 54 ms 52560 KB Output is correct
135 Correct 56 ms 52608 KB Output is correct
136 Correct 29 ms 53840 KB Output is correct
137 Correct 27 ms 53936 KB Output is correct
138 Correct 28 ms 53848 KB Output is correct
139 Correct 28 ms 53852 KB Output is correct
140 Correct 35 ms 54076 KB Output is correct
141 Correct 26 ms 53852 KB Output is correct
142 Correct 22 ms 6736 KB Output is correct
143 Correct 23 ms 53340 KB Output is correct
144 Correct 22 ms 6744 KB Output is correct
145 Correct 20 ms 53220 KB Output is correct
146 Correct 23 ms 6728 KB Output is correct
147 Correct 28 ms 53340 KB Output is correct
148 Correct 21 ms 53596 KB Output is correct
149 Correct 24 ms 53392 KB Output is correct
150 Correct 23 ms 53332 KB Output is correct
151 Correct 24 ms 53340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2648 KB Output is correct
2 Correct 2 ms 2652 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2604 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2652 KB Output is correct
9 Correct 2 ms 3932 KB Output is correct
10 Correct 2 ms 3932 KB Output is correct
11 Correct 2 ms 3932 KB Output is correct
12 Correct 2 ms 3940 KB Output is correct
13 Correct 2 ms 3932 KB Output is correct
14 Correct 3 ms 3932 KB Output is correct
15 Correct 3 ms 3980 KB Output is correct
16 Correct 2 ms 3932 KB Output is correct
17 Correct 2 ms 3932 KB Output is correct
18 Correct 2 ms 3928 KB Output is correct
19 Correct 2 ms 3932 KB Output is correct
20 Correct 2 ms 3932 KB Output is correct
21 Correct 2 ms 2648 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2716 KB Output is correct
24 Correct 14 ms 7772 KB Output is correct
25 Correct 16 ms 7772 KB Output is correct
26 Correct 16 ms 7768 KB Output is correct
27 Correct 16 ms 52572 KB Output is correct
28 Correct 16 ms 52668 KB Output is correct
29 Correct 23 ms 52568 KB Output is correct
30 Correct 18 ms 52568 KB Output is correct
31 Correct 19 ms 52392 KB Output is correct
32 Correct 18 ms 52388 KB Output is correct
33 Correct 24 ms 53596 KB Output is correct
34 Correct 24 ms 53596 KB Output is correct
35 Correct 23 ms 53596 KB Output is correct
36 Correct 22 ms 53596 KB Output is correct
37 Correct 22 ms 53596 KB Output is correct
38 Correct 23 ms 53596 KB Output is correct
39 Correct 34 ms 56400 KB Output is correct
40 Correct 32 ms 56408 KB Output is correct
41 Correct 31 ms 56408 KB Output is correct
42 Correct 70 ms 229040 KB Output is correct
43 Correct 48 ms 144212 KB Output is correct
44 Correct 82 ms 247892 KB Output is correct
45 Correct 55 ms 165460 KB Output is correct
46 Correct 54 ms 150612 KB Output is correct
47 Correct 85 ms 251216 KB Output is correct
48 Correct 97 ms 226128 KB Output is correct
49 Correct 63 ms 145708 KB Output is correct
50 Correct 67 ms 148568 KB Output is correct
51 Correct 81 ms 160732 KB Output is correct
52 Correct 78 ms 183636 KB Output is correct
53 Correct 72 ms 190804 KB Output is correct
54 Correct 96 ms 251988 KB Output is correct
55 Correct 87 ms 251984 KB Output is correct
56 Correct 93 ms 251988 KB Output is correct
57 Correct 84 ms 251728 KB Output is correct
58 Correct 82 ms 251732 KB Output is correct
59 Correct 81 ms 251728 KB Output is correct
60 Correct 131 ms 260944 KB Output is correct
61 Correct 121 ms 260944 KB Output is correct
62 Correct 114 ms 260976 KB Output is correct
63 Correct 111 ms 260944 KB Output is correct
64 Correct 110 ms 261060 KB Output is correct
65 Correct 123 ms 260948 KB Output is correct
66 Correct 115 ms 259752 KB Output is correct
67 Correct 116 ms 259816 KB Output is correct
68 Correct 112 ms 259700 KB Output is correct
69 Correct 1 ms 2652 KB Output is correct
70 Correct 2 ms 2656 KB Output is correct
71 Correct 2 ms 2652 KB Output is correct
72 Correct 2 ms 3420 KB Output is correct
73 Correct 2 ms 3420 KB Output is correct
74 Correct 2 ms 3420 KB Output is correct
75 Correct 2 ms 3420 KB Output is correct
76 Correct 2 ms 3676 KB Output is correct
77 Correct 2 ms 3676 KB Output is correct
78 Correct 2 ms 3676 KB Output is correct
79 Correct 2 ms 3720 KB Output is correct
80 Correct 2 ms 3420 KB Output is correct
81 Correct 2 ms 3676 KB Output is correct
82 Correct 2 ms 3420 KB Output is correct
83 Correct 1 ms 2652 KB Output is correct
84 Correct 2 ms 3416 KB Output is correct
85 Correct 3 ms 2652 KB Output is correct
86 Correct 2 ms 3420 KB Output is correct
87 Correct 1 ms 2652 KB Output is correct
88 Correct 2 ms 3420 KB Output is correct
89 Correct 2 ms 3932 KB Output is correct
90 Correct 2 ms 3928 KB Output is correct
91 Correct 2 ms 3808 KB Output is correct
92 Correct 2 ms 3852 KB Output is correct
93 Correct 3 ms 3932 KB Output is correct
94 Correct 2 ms 3932 KB Output is correct
95 Correct 2 ms 3928 KB Output is correct
96 Correct 2 ms 3932 KB Output is correct
97 Correct 2 ms 4084 KB Output is correct
98 Correct 2 ms 3932 KB Output is correct
99 Correct 2 ms 3932 KB Output is correct
100 Correct 2 ms 3932 KB Output is correct
101 Correct 1 ms 2652 KB Output is correct
102 Correct 2 ms 4024 KB Output is correct
103 Correct 2 ms 2652 KB Output is correct
104 Correct 3 ms 3932 KB Output is correct
105 Correct 2 ms 2652 KB Output is correct
106 Correct 2 ms 3932 KB Output is correct
107 Correct 2 ms 3420 KB Output is correct
108 Correct 2 ms 3932 KB Output is correct
109 Correct 2 ms 3932 KB Output is correct
110 Correct 2 ms 3932 KB Output is correct
111 Correct 2 ms 3932 KB Output is correct
112 Correct 3 ms 3932 KB Output is correct
113 Correct 3 ms 3932 KB Output is correct
114 Correct 3 ms 3932 KB Output is correct
115 Correct 2 ms 3672 KB Output is correct
116 Correct 2 ms 3676 KB Output is correct
117 Correct 2 ms 3672 KB Output is correct
118 Correct 15 ms 5468 KB Output is correct
119 Correct 12 ms 5788 KB Output is correct
120 Correct 20 ms 6236 KB Output is correct
121 Correct 3 ms 4184 KB Output is correct
122 Correct 3 ms 3932 KB Output is correct
123 Correct 2 ms 3932 KB Output is correct
124 Correct 2 ms 4032 KB Output is correct
125 Correct 2 ms 3872 KB Output is correct
126 Correct 3 ms 4188 KB Output is correct
127 Correct 3 ms 4188 KB Output is correct
128 Correct 3 ms 4104 KB Output is correct
129 Correct 3 ms 4188 KB Output is correct
130 Correct 3 ms 4188 KB Output is correct
131 Correct 3 ms 4076 KB Output is correct
132 Correct 18 ms 6312 KB Output is correct
133 Correct 22 ms 6440 KB Output is correct
134 Correct 20 ms 6488 KB Output is correct
135 Correct 17 ms 52316 KB Output is correct
136 Correct 52 ms 38912 KB Output is correct
137 Correct 35 ms 33364 KB Output is correct
138 Correct 28 ms 31324 KB Output is correct
139 Correct 35 ms 41012 KB Output is correct
140 Correct 28 ms 29520 KB Output is correct
141 Correct 19 ms 31580 KB Output is correct
142 Correct 18 ms 28764 KB Output is correct
143 Correct 25 ms 49092 KB Output is correct
144 Correct 17 ms 30812 KB Output is correct
145 Correct 21 ms 35200 KB Output is correct
146 Correct 20 ms 39212 KB Output is correct
147 Correct 15 ms 5212 KB Output is correct
148 Correct 14 ms 32604 KB Output is correct
149 Correct 22 ms 5468 KB Output is correct
150 Correct 18 ms 31504 KB Output is correct
151 Correct 16 ms 5980 KB Output is correct
152 Correct 21 ms 49752 KB Output is correct
153 Correct 18 ms 42076 KB Output is correct
154 Correct 22 ms 49816 KB Output is correct
155 Correct 16 ms 36956 KB Output is correct
156 Correct 18 ms 38236 KB Output is correct
157 Correct 18 ms 52428 KB Output is correct
158 Correct 77 ms 52564 KB Output is correct
159 Correct 61 ms 52648 KB Output is correct
160 Correct 60 ms 52504 KB Output is correct
161 Correct 54 ms 52560 KB Output is correct
162 Correct 56 ms 52608 KB Output is correct
163 Correct 29 ms 53840 KB Output is correct
164 Correct 27 ms 53936 KB Output is correct
165 Correct 28 ms 53848 KB Output is correct
166 Correct 28 ms 53852 KB Output is correct
167 Correct 35 ms 54076 KB Output is correct
168 Correct 26 ms 53852 KB Output is correct
169 Correct 22 ms 6736 KB Output is correct
170 Correct 23 ms 53340 KB Output is correct
171 Correct 22 ms 6744 KB Output is correct
172 Correct 20 ms 53220 KB Output is correct
173 Correct 23 ms 6728 KB Output is correct
174 Correct 28 ms 53340 KB Output is correct
175 Correct 21 ms 53596 KB Output is correct
176 Correct 24 ms 53392 KB Output is correct
177 Correct 23 ms 53332 KB Output is correct
178 Correct 24 ms 53340 KB Output is correct
179 Correct 49 ms 157272 KB Output is correct
180 Correct 155 ms 132436 KB Output is correct
181 Correct 214 ms 190116 KB Output is correct
182 Correct 258 ms 249428 KB Output is correct
183 Correct 143 ms 164732 KB Output is correct
184 Correct 136 ms 158128 KB Output is correct
185 Correct 68 ms 134480 KB Output is correct
186 Correct 62 ms 165864 KB Output is correct
187 Correct 67 ms 158548 KB Output is correct
188 Correct 25 ms 6480 KB Output is correct
189 Correct 93 ms 224532 KB Output is correct
190 Correct 23 ms 7504 KB Output is correct
191 Correct 73 ms 200016 KB Output is correct
192 Correct 15 ms 5720 KB Output is correct
193 Correct 62 ms 169508 KB Output is correct
194 Correct 79 ms 251984 KB Output is correct
195 Correct 366 ms 252088 KB Output is correct
196 Correct 310 ms 251728 KB Output is correct
197 Correct 281 ms 251664 KB Output is correct
198 Correct 254 ms 251732 KB Output is correct
199 Correct 255 ms 251696 KB Output is correct
200 Correct 124 ms 260944 KB Output is correct
201 Correct 118 ms 261036 KB Output is correct
202 Correct 121 ms 260948 KB Output is correct
203 Correct 128 ms 261044 KB Output is correct
204 Correct 121 ms 260948 KB Output is correct
205 Correct 126 ms 260948 KB Output is correct
206 Correct 38 ms 12116 KB Output is correct
207 Correct 131 ms 259972 KB Output is correct
208 Correct 35 ms 12116 KB Output is correct
209 Correct 105 ms 259960 KB Output is correct
210 Correct 38 ms 12112 KB Output is correct
211 Correct 132 ms 259948 KB Output is correct
212 Correct 120 ms 260952 KB Output is correct
213 Correct 107 ms 257996 KB Output is correct
214 Correct 106 ms 257616 KB Output is correct
215 Correct 112 ms 257360 KB Output is correct