// created by Dinh Manh Hung
// tht.onepunchac168
// THPT CHUYEN HA TINH
// HA TINH, VIET NAM
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("O3,unroll-loops,no-stack-protector")
//#pragma GCC target("sse4,avx2,fma")
#define task ""
#define ldb long double
#define pb push_back
#define fi first
#define se second
#define pc pop_back()
#define all(x) begin(x),end(x)
#define uniquev(v) v.resize(unique(all(v))-v.begin())
#define FOR(i,a,b) for (int i=a;i<=b;i++)
#define cntbit(v) __builtin_popcountll(v)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) ((1LL*a*b)/__gcd(a,b))
#define mask(x) (1LL<<(x))
#define readbit(x,i) ((x>>i)&1)
#define ins insert
typedef int ll;
typedef pair <ll,ll> ii;
typedef pair <ll,ii> iii;
typedef pair <ii,ii> iiii;
ll dx[]= {1,-1,0,0,1,-1,1,-1};
ll dy[]= {0,0,-1,1,1,-1,-1,1};
const ldb PI = acos (-1);
//const ll mod=978846151;
//const ll base=29;
const int maxn=1e6+5;
const ll mod=1e9+7;
const char nl = '\n';
inline int ReadInt()
{
char co;
for (co = getchar(); co < '0' || co > '9'; co = getchar());
int xo = co - '0';
for (co = getchar(); co >= '0' && co <= '9'; co = getchar())
xo = xo * 10 + co - '0';
return xo;
}
void WriteInt(int xo)
{
if (xo > 9)
WriteInt(xo / 10);
putchar(xo % 10 + '0');
}
/* END OF TEMPLATE*/
// ================= Solution =================//
const int N=3e5+5;
const int M=20+5;
ll n,m;
ll a[N][M];
ii dp[mask(20)+5][2];
ll dd[25];
void optmushnpr()
{
cin>>n>>m;
for (int i=0; i<mask(m); i++)
{
for (int j=0; j<=1; j++)
{
dp[i][j]= {-1e9-5,-1};
}
}
deque <ii> dq;
for (int i=1; i<=n; i++)
{
ll MASK=0;
ll cnt=0;
for (int j=0; j<m; j++)
{
cin>>a[i][j];
if (a[i][j]==0)
{
MASK+=mask(j);
cnt++;
}
else
{
dd[j]++;
}
}
if (dp[MASK][0].fi==-1e9-5)
{
dp[MASK][0]= {cnt,i};
dq.pb({MASK,0});
}
else if (dp[MASK][1].fi==-1e9-5)
{
dp[MASK][1]= {cnt,i};
dq.pb({MASK,1});
}
}
while (!dq.empty())
{
ii aa=dq.front();
dq.pop_front();
ii bb=dp[aa.fi][aa.se];
for (int i=0; i<m; i++)
{
if (readbit(aa.fi,i)==1)
{
ll newMASK=aa.fi-mask(i);
if (dp[newMASK][0].fi==-1e9-5)
{
dp[newMASK][0]= {bb.fi-1,bb.se};
dq.pb({newMASK,0});
}
else if (dp[newMASK][1].fi==-1e9-5&&bb.se!=dp[newMASK][0].se)
{
dp[newMASK][1]= {bb.fi-1,bb.se};
dq.pb({newMASK,1});
}
}
}
}
for(int MASK = 0; MASK < mask(m); MASK++)
{
for (int j=0;j<m;j++)
{
if(readbit(MASK,j)==1)
{
ll nxt=MASK^mask(j);
// first
if (dp[MASK][0].fi<dp[nxt][0].fi)
{
if (dp[MASK][0].se==dp[nxt][0].se)
{
dp[MASK][0]=dp[nxt][0];
}
else
{
dp[MASK][1]=dp[MASK][0];
dp[MASK][0]=dp[nxt][0];
}
}
else if (dp[MASK][1].fi<dp[nxt][0].fi&&dp[nxt][0].se!=dp[MASK][0].se)
{
dp[MASK][1]=dp[nxt][0];
}
// second
if (dp[MASK][0].fi<dp[nxt][1].fi)
{
if (dp[MASK][0].se==dp[nxt][1].se)
{
dp[MASK][0]=dp[nxt][1];
}
else
{
dp[MASK][1]=dp[MASK][0];
dp[MASK][0]=dp[nxt][1];
}
}
else if (dp[MASK][1].fi<dp[nxt][1].fi&&dp[nxt][1].se!=dp[MASK][0].se)
{
dp[MASK][1]=dp[nxt][1];
}
}
}
}
ll opt=n/2;
for (int i=1;i<=n;i++)
{
ll res=0;
ll MASK=0;
for (int j=0;j<m;j++)
{
if (dd[j]>=opt+2)
{
res++;
continue;
}
if (dd[j]<opt)
{
continue;
}
if (dd[j]==opt&&a[i][j]==1)
{
continue;
}
if (dd[j]==opt+1&&a[i][j]==0)
{
res++;
continue;
}
MASK+=mask(j);
}
if (dp[MASK][0].se!=i)
{
res+=dp[MASK][0].fi;
}
else
{
res+=dp[MASK][1].fi;
}
cout<<res<<nl;
}
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
if (fopen(task".inp","r"))
{
freopen(task".inp","r",stdin);
freopen(task".out","w",stdout);
}
int tests;
tests=1;
//cin>>tests;
while (tests--)
{
optmushnpr();
}
}
// goodbye see ya
Compilation message
council.cpp: In function 'int main()':
council.cpp:221:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
221 | freopen(task".inp","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
council.cpp:222:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
222 | freopen(task".out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
328 KB |
Output is correct |
5 |
Correct |
165 ms |
18392 KB |
Output is correct |
6 |
Correct |
89 ms |
16768 KB |
Output is correct |
7 |
Correct |
116 ms |
16824 KB |
Output is correct |
8 |
Correct |
114 ms |
16692 KB |
Output is correct |
9 |
Correct |
152 ms |
17872 KB |
Output is correct |
10 |
Correct |
106 ms |
16768 KB |
Output is correct |
11 |
Correct |
110 ms |
16800 KB |
Output is correct |
12 |
Correct |
144 ms |
17852 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
0 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
328 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
3 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
2 ms |
596 KB |
Output is correct |
44 |
Correct |
2 ms |
596 KB |
Output is correct |
45 |
Correct |
2 ms |
596 KB |
Output is correct |
46 |
Correct |
20 ms |
2624 KB |
Output is correct |
47 |
Correct |
13 ms |
2388 KB |
Output is correct |
48 |
Correct |
14 ms |
2388 KB |
Output is correct |
49 |
Correct |
13 ms |
2380 KB |
Output is correct |
50 |
Correct |
14 ms |
2388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
328 KB |
Output is correct |
5 |
Correct |
165 ms |
18392 KB |
Output is correct |
6 |
Correct |
89 ms |
16768 KB |
Output is correct |
7 |
Correct |
116 ms |
16824 KB |
Output is correct |
8 |
Correct |
114 ms |
16692 KB |
Output is correct |
9 |
Correct |
152 ms |
17872 KB |
Output is correct |
10 |
Correct |
106 ms |
16768 KB |
Output is correct |
11 |
Correct |
110 ms |
16800 KB |
Output is correct |
12 |
Correct |
144 ms |
17852 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
0 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
328 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
3 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
2 ms |
596 KB |
Output is correct |
44 |
Correct |
2 ms |
596 KB |
Output is correct |
45 |
Correct |
2 ms |
596 KB |
Output is correct |
46 |
Correct |
20 ms |
2624 KB |
Output is correct |
47 |
Correct |
13 ms |
2388 KB |
Output is correct |
48 |
Correct |
14 ms |
2388 KB |
Output is correct |
49 |
Correct |
13 ms |
2380 KB |
Output is correct |
50 |
Correct |
14 ms |
2388 KB |
Output is correct |
51 |
Correct |
86 ms |
17156 KB |
Output is correct |
52 |
Correct |
257 ms |
20236 KB |
Output is correct |
53 |
Correct |
306 ms |
21196 KB |
Output is correct |
54 |
Correct |
260 ms |
21232 KB |
Output is correct |
55 |
Correct |
1 ms |
596 KB |
Output is correct |
56 |
Correct |
33 ms |
3580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
48 ms |
31372 KB |
Output is correct |
3 |
Correct |
49 ms |
31356 KB |
Output is correct |
4 |
Correct |
39 ms |
30804 KB |
Output is correct |
5 |
Correct |
52 ms |
31428 KB |
Output is correct |
6 |
Correct |
42 ms |
30860 KB |
Output is correct |
7 |
Correct |
57 ms |
31320 KB |
Output is correct |
8 |
Correct |
0 ms |
332 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 |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
48 ms |
31372 KB |
Output is correct |
3 |
Correct |
49 ms |
31356 KB |
Output is correct |
4 |
Correct |
39 ms |
30804 KB |
Output is correct |
5 |
Correct |
52 ms |
31428 KB |
Output is correct |
6 |
Correct |
42 ms |
30860 KB |
Output is correct |
7 |
Correct |
57 ms |
31320 KB |
Output is correct |
8 |
Correct |
0 ms |
332 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 |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
328 KB |
Output is correct |
20 |
Correct |
173 ms |
36056 KB |
Output is correct |
21 |
Correct |
152 ms |
35436 KB |
Output is correct |
22 |
Correct |
153 ms |
35520 KB |
Output is correct |
23 |
Correct |
142 ms |
36392 KB |
Output is correct |
24 |
Correct |
135 ms |
36044 KB |
Output is correct |
25 |
Correct |
155 ms |
36044 KB |
Output is correct |
26 |
Correct |
188 ms |
36172 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
328 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
336 KB |
Output is correct |
38 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
48 ms |
31372 KB |
Output is correct |
3 |
Correct |
49 ms |
31356 KB |
Output is correct |
4 |
Correct |
39 ms |
30804 KB |
Output is correct |
5 |
Correct |
52 ms |
31428 KB |
Output is correct |
6 |
Correct |
42 ms |
30860 KB |
Output is correct |
7 |
Correct |
57 ms |
31320 KB |
Output is correct |
8 |
Correct |
0 ms |
332 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 |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
328 KB |
Output is correct |
20 |
Correct |
173 ms |
36056 KB |
Output is correct |
21 |
Correct |
152 ms |
35436 KB |
Output is correct |
22 |
Correct |
153 ms |
35520 KB |
Output is correct |
23 |
Correct |
142 ms |
36392 KB |
Output is correct |
24 |
Correct |
135 ms |
36044 KB |
Output is correct |
25 |
Correct |
155 ms |
36044 KB |
Output is correct |
26 |
Correct |
188 ms |
36172 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
328 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
336 KB |
Output is correct |
38 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
332 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 |
340 KB |
Output is correct |
47 |
Correct |
231 ms |
38836 KB |
Output is correct |
48 |
Correct |
212 ms |
38036 KB |
Output is correct |
49 |
Correct |
215 ms |
37964 KB |
Output is correct |
50 |
Correct |
189 ms |
38960 KB |
Output is correct |
51 |
Correct |
183 ms |
38788 KB |
Output is correct |
52 |
Correct |
218 ms |
38904 KB |
Output is correct |
53 |
Correct |
232 ms |
39160 KB |
Output is correct |
54 |
Correct |
3 ms |
596 KB |
Output is correct |
55 |
Correct |
2 ms |
588 KB |
Output is correct |
56 |
Correct |
2 ms |
596 KB |
Output is correct |
57 |
Correct |
2 ms |
588 KB |
Output is correct |
58 |
Correct |
2 ms |
596 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
48 ms |
31372 KB |
Output is correct |
3 |
Correct |
49 ms |
31356 KB |
Output is correct |
4 |
Correct |
39 ms |
30804 KB |
Output is correct |
5 |
Correct |
52 ms |
31428 KB |
Output is correct |
6 |
Correct |
42 ms |
30860 KB |
Output is correct |
7 |
Correct |
57 ms |
31320 KB |
Output is correct |
8 |
Correct |
0 ms |
332 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 |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
328 KB |
Output is correct |
20 |
Correct |
173 ms |
36056 KB |
Output is correct |
21 |
Correct |
152 ms |
35436 KB |
Output is correct |
22 |
Correct |
153 ms |
35520 KB |
Output is correct |
23 |
Correct |
142 ms |
36392 KB |
Output is correct |
24 |
Correct |
135 ms |
36044 KB |
Output is correct |
25 |
Correct |
155 ms |
36044 KB |
Output is correct |
26 |
Correct |
188 ms |
36172 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
328 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
336 KB |
Output is correct |
38 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
332 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 |
340 KB |
Output is correct |
47 |
Correct |
231 ms |
38836 KB |
Output is correct |
48 |
Correct |
212 ms |
38036 KB |
Output is correct |
49 |
Correct |
215 ms |
37964 KB |
Output is correct |
50 |
Correct |
189 ms |
38960 KB |
Output is correct |
51 |
Correct |
183 ms |
38788 KB |
Output is correct |
52 |
Correct |
218 ms |
38904 KB |
Output is correct |
53 |
Correct |
232 ms |
39160 KB |
Output is correct |
54 |
Correct |
3 ms |
596 KB |
Output is correct |
55 |
Correct |
2 ms |
588 KB |
Output is correct |
56 |
Correct |
2 ms |
596 KB |
Output is correct |
57 |
Correct |
2 ms |
588 KB |
Output is correct |
58 |
Correct |
2 ms |
596 KB |
Output is correct |
59 |
Correct |
255 ms |
41564 KB |
Output is correct |
60 |
Correct |
145 ms |
19308 KB |
Output is correct |
61 |
Correct |
145 ms |
20556 KB |
Output is correct |
62 |
Correct |
149 ms |
21112 KB |
Output is correct |
63 |
Correct |
268 ms |
40948 KB |
Output is correct |
64 |
Correct |
321 ms |
42956 KB |
Output is correct |
65 |
Correct |
301 ms |
42896 KB |
Output is correct |
66 |
Correct |
231 ms |
42532 KB |
Output is correct |
67 |
Correct |
248 ms |
42608 KB |
Output is correct |
68 |
Correct |
294 ms |
44068 KB |
Output is correct |
69 |
Correct |
322 ms |
44452 KB |
Output is correct |
70 |
Correct |
21 ms |
2516 KB |
Output is correct |
71 |
Correct |
14 ms |
2388 KB |
Output is correct |
72 |
Correct |
14 ms |
2388 KB |
Output is correct |
73 |
Correct |
13 ms |
2388 KB |
Output is correct |
74 |
Correct |
14 ms |
2440 KB |
Output is correct |
75 |
Correct |
32 ms |
3540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
328 KB |
Output is correct |
5 |
Correct |
165 ms |
18392 KB |
Output is correct |
6 |
Correct |
89 ms |
16768 KB |
Output is correct |
7 |
Correct |
116 ms |
16824 KB |
Output is correct |
8 |
Correct |
114 ms |
16692 KB |
Output is correct |
9 |
Correct |
152 ms |
17872 KB |
Output is correct |
10 |
Correct |
106 ms |
16768 KB |
Output is correct |
11 |
Correct |
110 ms |
16800 KB |
Output is correct |
12 |
Correct |
144 ms |
17852 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
0 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
328 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
3 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
2 ms |
596 KB |
Output is correct |
44 |
Correct |
2 ms |
596 KB |
Output is correct |
45 |
Correct |
2 ms |
596 KB |
Output is correct |
46 |
Correct |
20 ms |
2624 KB |
Output is correct |
47 |
Correct |
13 ms |
2388 KB |
Output is correct |
48 |
Correct |
14 ms |
2388 KB |
Output is correct |
49 |
Correct |
13 ms |
2380 KB |
Output is correct |
50 |
Correct |
14 ms |
2388 KB |
Output is correct |
51 |
Correct |
86 ms |
17156 KB |
Output is correct |
52 |
Correct |
257 ms |
20236 KB |
Output is correct |
53 |
Correct |
306 ms |
21196 KB |
Output is correct |
54 |
Correct |
260 ms |
21232 KB |
Output is correct |
55 |
Correct |
1 ms |
596 KB |
Output is correct |
56 |
Correct |
33 ms |
3580 KB |
Output is correct |
57 |
Correct |
1 ms |
212 KB |
Output is correct |
58 |
Correct |
48 ms |
31372 KB |
Output is correct |
59 |
Correct |
49 ms |
31356 KB |
Output is correct |
60 |
Correct |
39 ms |
30804 KB |
Output is correct |
61 |
Correct |
52 ms |
31428 KB |
Output is correct |
62 |
Correct |
42 ms |
30860 KB |
Output is correct |
63 |
Correct |
57 ms |
31320 KB |
Output is correct |
64 |
Correct |
0 ms |
332 KB |
Output is correct |
65 |
Correct |
1 ms |
340 KB |
Output is correct |
66 |
Correct |
1 ms |
340 KB |
Output is correct |
67 |
Correct |
0 ms |
340 KB |
Output is correct |
68 |
Correct |
1 ms |
340 KB |
Output is correct |
69 |
Correct |
1 ms |
336 KB |
Output is correct |
70 |
Correct |
1 ms |
340 KB |
Output is correct |
71 |
Correct |
1 ms |
340 KB |
Output is correct |
72 |
Correct |
1 ms |
340 KB |
Output is correct |
73 |
Correct |
1 ms |
600 KB |
Output is correct |
74 |
Correct |
1 ms |
332 KB |
Output is correct |
75 |
Correct |
1 ms |
328 KB |
Output is correct |
76 |
Correct |
173 ms |
36056 KB |
Output is correct |
77 |
Correct |
152 ms |
35436 KB |
Output is correct |
78 |
Correct |
153 ms |
35520 KB |
Output is correct |
79 |
Correct |
142 ms |
36392 KB |
Output is correct |
80 |
Correct |
135 ms |
36044 KB |
Output is correct |
81 |
Correct |
155 ms |
36044 KB |
Output is correct |
82 |
Correct |
188 ms |
36172 KB |
Output is correct |
83 |
Correct |
1 ms |
340 KB |
Output is correct |
84 |
Correct |
1 ms |
328 KB |
Output is correct |
85 |
Correct |
1 ms |
340 KB |
Output is correct |
86 |
Correct |
1 ms |
340 KB |
Output is correct |
87 |
Correct |
1 ms |
340 KB |
Output is correct |
88 |
Correct |
0 ms |
340 KB |
Output is correct |
89 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
93 |
Correct |
1 ms |
336 KB |
Output is correct |
94 |
Correct |
1 ms |
340 KB |
Output is correct |
95 |
Correct |
1 ms |
340 KB |
Output is correct |
96 |
Correct |
1 ms |
340 KB |
Output is correct |
97 |
Correct |
1 ms |
340 KB |
Output is correct |
98 |
Correct |
1 ms |
340 KB |
Output is correct |
99 |
Correct |
1 ms |
332 KB |
Output is correct |
100 |
Correct |
1 ms |
340 KB |
Output is correct |
101 |
Correct |
1 ms |
340 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
231 ms |
38836 KB |
Output is correct |
104 |
Correct |
212 ms |
38036 KB |
Output is correct |
105 |
Correct |
215 ms |
37964 KB |
Output is correct |
106 |
Correct |
189 ms |
38960 KB |
Output is correct |
107 |
Correct |
183 ms |
38788 KB |
Output is correct |
108 |
Correct |
218 ms |
38904 KB |
Output is correct |
109 |
Correct |
232 ms |
39160 KB |
Output is correct |
110 |
Correct |
3 ms |
596 KB |
Output is correct |
111 |
Correct |
2 ms |
588 KB |
Output is correct |
112 |
Correct |
2 ms |
596 KB |
Output is correct |
113 |
Correct |
2 ms |
588 KB |
Output is correct |
114 |
Correct |
2 ms |
596 KB |
Output is correct |
115 |
Correct |
255 ms |
41564 KB |
Output is correct |
116 |
Correct |
145 ms |
19308 KB |
Output is correct |
117 |
Correct |
145 ms |
20556 KB |
Output is correct |
118 |
Correct |
149 ms |
21112 KB |
Output is correct |
119 |
Correct |
268 ms |
40948 KB |
Output is correct |
120 |
Correct |
321 ms |
42956 KB |
Output is correct |
121 |
Correct |
301 ms |
42896 KB |
Output is correct |
122 |
Correct |
231 ms |
42532 KB |
Output is correct |
123 |
Correct |
248 ms |
42608 KB |
Output is correct |
124 |
Correct |
294 ms |
44068 KB |
Output is correct |
125 |
Correct |
322 ms |
44452 KB |
Output is correct |
126 |
Correct |
21 ms |
2516 KB |
Output is correct |
127 |
Correct |
14 ms |
2388 KB |
Output is correct |
128 |
Correct |
14 ms |
2388 KB |
Output is correct |
129 |
Correct |
13 ms |
2388 KB |
Output is correct |
130 |
Correct |
14 ms |
2440 KB |
Output is correct |
131 |
Correct |
32 ms |
3540 KB |
Output is correct |
132 |
Correct |
674 ms |
62580 KB |
Output is correct |
133 |
Correct |
647 ms |
62932 KB |
Output is correct |
134 |
Correct |
680 ms |
63476 KB |
Output is correct |
135 |
Correct |
628 ms |
62284 KB |
Output is correct |
136 |
Correct |
713 ms |
61884 KB |
Output is correct |
137 |
Correct |
470 ms |
51684 KB |
Output is correct |
138 |
Correct |
461 ms |
51780 KB |
Output is correct |
139 |
Correct |
343 ms |
58680 KB |
Output is correct |
140 |
Correct |
522 ms |
61112 KB |
Output is correct |
141 |
Correct |
743 ms |
70596 KB |
Output is correct |
142 |
Correct |
819 ms |
70540 KB |
Output is correct |