#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define F first
#define S second
using namespace std;
typedef int ll;
typedef pair<ll,ll>pll;
const ll oo=3e5+9;
ll n,m,c[20];
bool b[20][oo];
pll dp[2][1<<20];
void solve()
{
cin>>n>>m;
for(ll i=0; i<(1<<m); i++)
dp[0][i]=dp[1][i]= {-1,-1};
for(ll i=0; i<n; i++)
{
ll mask=0;
for(ll j=0; j<m; j++)
{
cin>>b[j][i];
if(!b[j][i])
mask|=(1<<j);
c[j]+=b[j][i];
}
if(dp[0][mask].F== -1)
dp[0][mask]= {1,i};
else
dp[1][mask]= {1,i};
}
for(ll j=m-1; j>=0; j--)
for(ll i=(1<<m)-1; i>=0; i--)
{
if(!((1<<j)&i))
{
if(dp[0][i|(1<<j)].F!= -1)
{
if(dp[0][i].F== -1)
dp[0][i]=dp[0][i|(1<<j)];
else if(dp[0][i].S!=dp[0][i|(1<<j)].S)
dp[1][i]=dp[0][i|(1<<j)];
}
if(dp[1][i|(1<<j)].F!= -1)
{
if(dp[0][i].F== -1)
dp[0][i]=dp[1][i|(1<<j)];
else if(dp[0][i].S!=dp[1][i|(1<<j)].S)
dp[1][i]=dp[1][i|(1<<j)];
}
}
}
for(ll i=0; i<(1<<m); i++)
for(ll j=0; j<2; j++)
if(dp[j][i].F != -1)
{
ll x=__builtin_popcountll(i);
dp[j][i].F=x;
}
for(ll j=0; j<m; j++)
for(ll i=0; i<(1<<m); i++)
{
if(!((1<<j)&i))
continue;
pll a[4];
a[0]=dp[0][i];
a[1]=dp[1][i];
a[2]=dp[0][i^(1<<j)];
a[3]=dp[1][i^(1<<j)];
sort(a,a+4,greater<pll>());
dp[0][i]=a[0];
dp[1][i]={-1,-1};
for(ll k=1;k<4;k++)
if(a[0].S!=a[k].S)
{
dp[1][i]=a[k];
break;
}
}
// for(ll i=0;i<(1<<m);i++)
// {
// cout<<dp[0][i].F<<" "<<dp[1][i].F<<"\n";
// cout<<dp[0][i].S<<" ?? "<<dp[1][i].S<<"\n";
// }
for(ll i=0; i<n; i++)
{
ll mask=(1<<m)-1,ans=0;
for(ll j=0; j<m; j++)
{
c[j]-=b[j][i];
if(c[j]-1>=n/2)
ans++,mask^=(1<<j);
if(c[j]<n/2)
mask^=(1<<j);
// cout<<ans<<" ";
}
// cout<<"\n";
// cout<<mask<<" "<<ans<<" "<<"!\n";
// cout<<dp[0][mask].F<<" "<<dp[0][mask].S<<"\n";
// cout<<dp[1][mask].F<<" "<<dp[1][mask].S<<"\n";
if(dp[0][mask].S==i)
cout<<ans+dp[1][mask].F<<"\n";
else
cout<<ans+dp[0][mask].F<<"\n";
for(ll j=0;j<m;j++)
c[j]+=b[j][i];
}
}
int main()
{
ios_base::sync_with_stdio(0),cin.tie(0);
ll tt=1;
// cin>>tt;
while(tt--)
solve();
return 0;
}
//3
//3
//3
//2
//3
//2
//2
//1
//3
//2
//2
//1
//2
//1
//1
//0
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
119 ms |
16732 KB |
Output is correct |
6 |
Correct |
115 ms |
16952 KB |
Output is correct |
7 |
Correct |
124 ms |
16732 KB |
Output is correct |
8 |
Correct |
135 ms |
16940 KB |
Output is correct |
9 |
Correct |
183 ms |
16952 KB |
Output is correct |
10 |
Correct |
123 ms |
16728 KB |
Output is correct |
11 |
Correct |
145 ms |
16728 KB |
Output is correct |
12 |
Correct |
199 ms |
16728 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
360 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
2 ms |
720 KB |
Output is correct |
42 |
Correct |
2 ms |
604 KB |
Output is correct |
43 |
Correct |
2 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
2 ms |
604 KB |
Output is correct |
46 |
Correct |
13 ms |
2612 KB |
Output is correct |
47 |
Correct |
14 ms |
2608 KB |
Output is correct |
48 |
Correct |
15 ms |
2608 KB |
Output is correct |
49 |
Correct |
13 ms |
2612 KB |
Output is correct |
50 |
Correct |
17 ms |
2392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
119 ms |
16732 KB |
Output is correct |
6 |
Correct |
115 ms |
16952 KB |
Output is correct |
7 |
Correct |
124 ms |
16732 KB |
Output is correct |
8 |
Correct |
135 ms |
16940 KB |
Output is correct |
9 |
Correct |
183 ms |
16952 KB |
Output is correct |
10 |
Correct |
123 ms |
16728 KB |
Output is correct |
11 |
Correct |
145 ms |
16728 KB |
Output is correct |
12 |
Correct |
199 ms |
16728 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
360 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
2 ms |
720 KB |
Output is correct |
42 |
Correct |
2 ms |
604 KB |
Output is correct |
43 |
Correct |
2 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
2 ms |
604 KB |
Output is correct |
46 |
Correct |
13 ms |
2612 KB |
Output is correct |
47 |
Correct |
14 ms |
2608 KB |
Output is correct |
48 |
Correct |
15 ms |
2608 KB |
Output is correct |
49 |
Correct |
13 ms |
2612 KB |
Output is correct |
50 |
Correct |
17 ms |
2392 KB |
Output is correct |
51 |
Correct |
123 ms |
16988 KB |
Output is correct |
52 |
Correct |
121 ms |
16988 KB |
Output is correct |
53 |
Correct |
170 ms |
17240 KB |
Output is correct |
54 |
Correct |
185 ms |
16984 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
23 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
356 KB |
Output is correct |
2 |
Correct |
38 ms |
2660 KB |
Output is correct |
3 |
Correct |
37 ms |
2572 KB |
Output is correct |
4 |
Correct |
28 ms |
1884 KB |
Output is correct |
5 |
Correct |
41 ms |
2640 KB |
Output is correct |
6 |
Correct |
30 ms |
1928 KB |
Output is correct |
7 |
Correct |
43 ms |
2672 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
464 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
356 KB |
Output is correct |
2 |
Correct |
38 ms |
2660 KB |
Output is correct |
3 |
Correct |
37 ms |
2572 KB |
Output is correct |
4 |
Correct |
28 ms |
1884 KB |
Output is correct |
5 |
Correct |
41 ms |
2640 KB |
Output is correct |
6 |
Correct |
30 ms |
1928 KB |
Output is correct |
7 |
Correct |
43 ms |
2672 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
464 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
171 ms |
9680 KB |
Output is correct |
21 |
Correct |
136 ms |
8788 KB |
Output is correct |
22 |
Correct |
138 ms |
8784 KB |
Output is correct |
23 |
Correct |
139 ms |
10136 KB |
Output is correct |
24 |
Correct |
142 ms |
9812 KB |
Output is correct |
25 |
Correct |
151 ms |
9748 KB |
Output is correct |
26 |
Correct |
163 ms |
9812 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
356 KB |
Output is correct |
2 |
Correct |
38 ms |
2660 KB |
Output is correct |
3 |
Correct |
37 ms |
2572 KB |
Output is correct |
4 |
Correct |
28 ms |
1884 KB |
Output is correct |
5 |
Correct |
41 ms |
2640 KB |
Output is correct |
6 |
Correct |
30 ms |
1928 KB |
Output is correct |
7 |
Correct |
43 ms |
2672 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
464 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
171 ms |
9680 KB |
Output is correct |
21 |
Correct |
136 ms |
8788 KB |
Output is correct |
22 |
Correct |
138 ms |
8784 KB |
Output is correct |
23 |
Correct |
139 ms |
10136 KB |
Output is correct |
24 |
Correct |
142 ms |
9812 KB |
Output is correct |
25 |
Correct |
151 ms |
9748 KB |
Output is correct |
26 |
Correct |
163 ms |
9812 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Correct |
1 ms |
604 KB |
Output is correct |
47 |
Correct |
209 ms |
13648 KB |
Output is correct |
48 |
Correct |
191 ms |
12444 KB |
Output is correct |
49 |
Correct |
195 ms |
12396 KB |
Output is correct |
50 |
Correct |
188 ms |
13904 KB |
Output is correct |
51 |
Correct |
172 ms |
13652 KB |
Output is correct |
52 |
Correct |
210 ms |
13652 KB |
Output is correct |
53 |
Correct |
219 ms |
13888 KB |
Output is correct |
54 |
Correct |
2 ms |
604 KB |
Output is correct |
55 |
Correct |
2 ms |
604 KB |
Output is correct |
56 |
Correct |
2 ms |
604 KB |
Output is correct |
57 |
Correct |
2 ms |
604 KB |
Output is correct |
58 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
356 KB |
Output is correct |
2 |
Correct |
38 ms |
2660 KB |
Output is correct |
3 |
Correct |
37 ms |
2572 KB |
Output is correct |
4 |
Correct |
28 ms |
1884 KB |
Output is correct |
5 |
Correct |
41 ms |
2640 KB |
Output is correct |
6 |
Correct |
30 ms |
1928 KB |
Output is correct |
7 |
Correct |
43 ms |
2672 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
464 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
468 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
171 ms |
9680 KB |
Output is correct |
21 |
Correct |
136 ms |
8788 KB |
Output is correct |
22 |
Correct |
138 ms |
8784 KB |
Output is correct |
23 |
Correct |
139 ms |
10136 KB |
Output is correct |
24 |
Correct |
142 ms |
9812 KB |
Output is correct |
25 |
Correct |
151 ms |
9748 KB |
Output is correct |
26 |
Correct |
163 ms |
9812 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
344 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Correct |
1 ms |
604 KB |
Output is correct |
47 |
Correct |
209 ms |
13648 KB |
Output is correct |
48 |
Correct |
191 ms |
12444 KB |
Output is correct |
49 |
Correct |
195 ms |
12396 KB |
Output is correct |
50 |
Correct |
188 ms |
13904 KB |
Output is correct |
51 |
Correct |
172 ms |
13652 KB |
Output is correct |
52 |
Correct |
210 ms |
13652 KB |
Output is correct |
53 |
Correct |
219 ms |
13888 KB |
Output is correct |
54 |
Correct |
2 ms |
604 KB |
Output is correct |
55 |
Correct |
2 ms |
604 KB |
Output is correct |
56 |
Correct |
2 ms |
604 KB |
Output is correct |
57 |
Correct |
2 ms |
604 KB |
Output is correct |
58 |
Correct |
2 ms |
604 KB |
Output is correct |
59 |
Correct |
237 ms |
16468 KB |
Output is correct |
60 |
Correct |
117 ms |
8556 KB |
Output is correct |
61 |
Correct |
130 ms |
9040 KB |
Output is correct |
62 |
Correct |
124 ms |
9300 KB |
Output is correct |
63 |
Correct |
247 ms |
15956 KB |
Output is correct |
64 |
Correct |
268 ms |
18000 KB |
Output is correct |
65 |
Correct |
268 ms |
18004 KB |
Output is correct |
66 |
Correct |
242 ms |
18336 KB |
Output is correct |
67 |
Correct |
222 ms |
18004 KB |
Output is correct |
68 |
Correct |
265 ms |
18000 KB |
Output is correct |
69 |
Correct |
278 ms |
18228 KB |
Output is correct |
70 |
Correct |
14 ms |
2392 KB |
Output is correct |
71 |
Correct |
13 ms |
2396 KB |
Output is correct |
72 |
Correct |
15 ms |
2396 KB |
Output is correct |
73 |
Correct |
14 ms |
2648 KB |
Output is correct |
74 |
Correct |
15 ms |
2600 KB |
Output is correct |
75 |
Correct |
23 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
119 ms |
16732 KB |
Output is correct |
6 |
Correct |
115 ms |
16952 KB |
Output is correct |
7 |
Correct |
124 ms |
16732 KB |
Output is correct |
8 |
Correct |
135 ms |
16940 KB |
Output is correct |
9 |
Correct |
183 ms |
16952 KB |
Output is correct |
10 |
Correct |
123 ms |
16728 KB |
Output is correct |
11 |
Correct |
145 ms |
16728 KB |
Output is correct |
12 |
Correct |
199 ms |
16728 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
360 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
2 ms |
720 KB |
Output is correct |
42 |
Correct |
2 ms |
604 KB |
Output is correct |
43 |
Correct |
2 ms |
604 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
2 ms |
604 KB |
Output is correct |
46 |
Correct |
13 ms |
2612 KB |
Output is correct |
47 |
Correct |
14 ms |
2608 KB |
Output is correct |
48 |
Correct |
15 ms |
2608 KB |
Output is correct |
49 |
Correct |
13 ms |
2612 KB |
Output is correct |
50 |
Correct |
17 ms |
2392 KB |
Output is correct |
51 |
Correct |
123 ms |
16988 KB |
Output is correct |
52 |
Correct |
121 ms |
16988 KB |
Output is correct |
53 |
Correct |
170 ms |
17240 KB |
Output is correct |
54 |
Correct |
185 ms |
16984 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
23 ms |
2652 KB |
Output is correct |
57 |
Correct |
0 ms |
356 KB |
Output is correct |
58 |
Correct |
38 ms |
2660 KB |
Output is correct |
59 |
Correct |
37 ms |
2572 KB |
Output is correct |
60 |
Correct |
28 ms |
1884 KB |
Output is correct |
61 |
Correct |
41 ms |
2640 KB |
Output is correct |
62 |
Correct |
30 ms |
1928 KB |
Output is correct |
63 |
Correct |
43 ms |
2672 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
464 KB |
Output is correct |
67 |
Correct |
0 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
348 KB |
Output is correct |
70 |
Correct |
0 ms |
348 KB |
Output is correct |
71 |
Correct |
1 ms |
468 KB |
Output is correct |
72 |
Correct |
1 ms |
348 KB |
Output is correct |
73 |
Correct |
1 ms |
348 KB |
Output is correct |
74 |
Correct |
1 ms |
348 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
171 ms |
9680 KB |
Output is correct |
77 |
Correct |
136 ms |
8788 KB |
Output is correct |
78 |
Correct |
138 ms |
8784 KB |
Output is correct |
79 |
Correct |
139 ms |
10136 KB |
Output is correct |
80 |
Correct |
142 ms |
9812 KB |
Output is correct |
81 |
Correct |
151 ms |
9748 KB |
Output is correct |
82 |
Correct |
163 ms |
9812 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
0 ms |
348 KB |
Output is correct |
87 |
Correct |
0 ms |
344 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
1 ms |
348 KB |
Output is correct |
90 |
Correct |
0 ms |
348 KB |
Output is correct |
91 |
Correct |
1 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
0 ms |
348 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
0 ms |
348 KB |
Output is correct |
96 |
Correct |
0 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
348 KB |
Output is correct |
99 |
Correct |
0 ms |
344 KB |
Output is correct |
100 |
Correct |
1 ms |
348 KB |
Output is correct |
101 |
Correct |
1 ms |
348 KB |
Output is correct |
102 |
Correct |
1 ms |
604 KB |
Output is correct |
103 |
Correct |
209 ms |
13648 KB |
Output is correct |
104 |
Correct |
191 ms |
12444 KB |
Output is correct |
105 |
Correct |
195 ms |
12396 KB |
Output is correct |
106 |
Correct |
188 ms |
13904 KB |
Output is correct |
107 |
Correct |
172 ms |
13652 KB |
Output is correct |
108 |
Correct |
210 ms |
13652 KB |
Output is correct |
109 |
Correct |
219 ms |
13888 KB |
Output is correct |
110 |
Correct |
2 ms |
604 KB |
Output is correct |
111 |
Correct |
2 ms |
604 KB |
Output is correct |
112 |
Correct |
2 ms |
604 KB |
Output is correct |
113 |
Correct |
2 ms |
604 KB |
Output is correct |
114 |
Correct |
2 ms |
604 KB |
Output is correct |
115 |
Correct |
237 ms |
16468 KB |
Output is correct |
116 |
Correct |
117 ms |
8556 KB |
Output is correct |
117 |
Correct |
130 ms |
9040 KB |
Output is correct |
118 |
Correct |
124 ms |
9300 KB |
Output is correct |
119 |
Correct |
247 ms |
15956 KB |
Output is correct |
120 |
Correct |
268 ms |
18000 KB |
Output is correct |
121 |
Correct |
268 ms |
18004 KB |
Output is correct |
122 |
Correct |
242 ms |
18336 KB |
Output is correct |
123 |
Correct |
222 ms |
18004 KB |
Output is correct |
124 |
Correct |
265 ms |
18000 KB |
Output is correct |
125 |
Correct |
278 ms |
18228 KB |
Output is correct |
126 |
Correct |
14 ms |
2392 KB |
Output is correct |
127 |
Correct |
13 ms |
2396 KB |
Output is correct |
128 |
Correct |
15 ms |
2396 KB |
Output is correct |
129 |
Correct |
14 ms |
2648 KB |
Output is correct |
130 |
Correct |
15 ms |
2600 KB |
Output is correct |
131 |
Correct |
23 ms |
2652 KB |
Output is correct |
132 |
Correct |
447 ms |
35172 KB |
Output is correct |
133 |
Correct |
417 ms |
35152 KB |
Output is correct |
134 |
Correct |
447 ms |
35156 KB |
Output is correct |
135 |
Correct |
511 ms |
35156 KB |
Output is correct |
136 |
Correct |
512 ms |
35152 KB |
Output is correct |
137 |
Correct |
365 ms |
26320 KB |
Output is correct |
138 |
Correct |
369 ms |
26132 KB |
Output is correct |
139 |
Correct |
389 ms |
35156 KB |
Output is correct |
140 |
Correct |
358 ms |
34900 KB |
Output is correct |
141 |
Correct |
450 ms |
34852 KB |
Output is correct |
142 |
Correct |
467 ms |
35156 KB |
Output is correct |