#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n,m;
cin >> n >> m;
vector<vector<int>> a(n+1,vector<int>(m+1));
vector<int> votes(m+1);
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>a[i][j];
if(a[i][j])votes[j]++;
}
}
int majority = n/2;
vector<vector<int>> arr(n+1); // this is processed
int offset = 0;
vector<int> voters;
for(int i=1;i<=m;i++){
if(majority+1<votes[i])offset++;
if(votes[i]<majority or majority+1<votes[i])continue;
voters.emplace_back(votes[i]);
}
auto combine = [&](pair<int,int> &a,pair<int,int> b){
pair<int,int> ans = {-1,-1};
if(a.first<b.first){
ans.first = b.first;
swap(b.first,b.second);
} else {
ans.first = a.first;
swap(a.first,a.second);
}
if(a.first<b.first){
ans.second = b.first;
swap(b.first,b.second);
} else {
ans.second = a.first;
swap(a.first,a.second);
}
return ans;
};
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(votes[j]<majority or majority+1<votes[j])continue;
arr[i].emplace_back(a[i][j]);
}
}
m = arr[1].size(); // this is processed
vector<pair<int,int>> DPfront(1<<m,{-1,-1});
for(int i=1;i<=n;i++){
int curr = 0;
for(int j=0;j<m;j++)if(arr[i][j]==0)curr|=(1<<j);
DPfront[curr] = combine(DPfront[curr],{i,-1});
}
for(int bit=0;bit<m;bit++)for(int i=(1<<m)-1;i>=0;i--)if((i&(1<<bit))==0){
DPfront[i]=combine(DPfront[i],DPfront[i|(1<<bit)]);
}
vector<pair<pair<int,int>,pair<int,int>>> DPback(1<<m,{{0,-1},{0,-1}});
auto combine_good = [&](pair<pair<int,int>,pair<int,int>> &a,pair<pair<int,int>,pair<int,int>> &b){
pair<pair<int,int>,pair<int,int>> ans = {{0,-1},{0,-1}};
vector<pair<int,int>> things = {a.first,a.second,b.first,b.second};
sort(things.rbegin(),things.rend());
ans.first = things[0];
for(int i=1;i<4;i++){
if(things[i].second!=ans.first.second){ans.second=things[i];break;}
}
return ans;
};
for(int i=0;i<(1<<m);i++){
if(DPfront[i].first!=-1){
DPback[i].first={__builtin_popcount(i),DPfront[i].first};
if(DPfront[i].second!=-1){
DPback[i].second={__builtin_popcount(i),DPfront[i].second};
}
}
}
for(int bit=0;bit<m;bit++)for(int i=0;i<(1<<m);i++)if(i&(1<<bit)){
DPback[i] = combine_good(DPback[i],DPback[i^(1<<bit)]);
}
for(int i=1;i<=n;i++){
int curr = 0;
int my = 0;
for(int j=0;j<m;j++){
if(voters[j]==majority){
if(arr[i][j]==0)curr|=(1<<j);
} else if (voters[j]==majority+1){
if(arr[i][j]==1)curr|=(1<<j);
else my++;
}
}
int ans;
if(DPback[curr].first.second!=i)ans=DPback[curr].first.first;
else ans=DPback[curr].second.first;
cout << offset+ans+my << '\n';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
347 ms |
49724 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
406 ms |
49656 KB |
Output is correct |
11 |
Correct |
346 ms |
49708 KB |
Output is correct |
12 |
Correct |
363 ms |
49756 KB |
Output is correct |
13 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
600 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
452 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
4 ms |
1116 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
4 ms |
1116 KB |
Output is correct |
45 |
Correct |
5 ms |
1220 KB |
Output is correct |
46 |
Correct |
37 ms |
6492 KB |
Output is correct |
47 |
Correct |
1 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
38 ms |
6636 KB |
Output is correct |
50 |
Correct |
44 ms |
6620 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
347 ms |
49724 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
406 ms |
49656 KB |
Output is correct |
11 |
Correct |
346 ms |
49708 KB |
Output is correct |
12 |
Correct |
363 ms |
49756 KB |
Output is correct |
13 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
600 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
452 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
4 ms |
1116 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
4 ms |
1116 KB |
Output is correct |
45 |
Correct |
5 ms |
1220 KB |
Output is correct |
46 |
Correct |
37 ms |
6492 KB |
Output is correct |
47 |
Correct |
1 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
38 ms |
6636 KB |
Output is correct |
50 |
Correct |
44 ms |
6620 KB |
Output is correct |
51 |
Correct |
4 ms |
1372 KB |
Output is correct |
52 |
Correct |
3 ms |
1116 KB |
Output is correct |
53 |
Correct |
3 ms |
1116 KB |
Output is correct |
54 |
Correct |
346 ms |
51232 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
46 ms |
8008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
48 ms |
25488 KB |
Output is correct |
3 |
Correct |
41 ms |
25684 KB |
Output is correct |
4 |
Correct |
35 ms |
25024 KB |
Output is correct |
5 |
Correct |
47 ms |
25556 KB |
Output is correct |
6 |
Correct |
48 ms |
34520 KB |
Output is correct |
7 |
Correct |
79 ms |
35008 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 |
348 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 |
1 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 |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
48 ms |
25488 KB |
Output is correct |
3 |
Correct |
41 ms |
25684 KB |
Output is correct |
4 |
Correct |
35 ms |
25024 KB |
Output is correct |
5 |
Correct |
47 ms |
25556 KB |
Output is correct |
6 |
Correct |
48 ms |
34520 KB |
Output is correct |
7 |
Correct |
79 ms |
35008 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 |
348 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 |
1 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 |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
212 ms |
91396 KB |
Output is correct |
21 |
Correct |
199 ms |
90832 KB |
Output is correct |
22 |
Correct |
198 ms |
90824 KB |
Output is correct |
23 |
Correct |
174 ms |
49480 KB |
Output is correct |
24 |
Correct |
128 ms |
48988 KB |
Output is correct |
25 |
Correct |
146 ms |
48976 KB |
Output is correct |
26 |
Correct |
234 ms |
91476 KB |
Output is correct |
27 |
Correct |
1 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 |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
456 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 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 |
1 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 |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
48 ms |
25488 KB |
Output is correct |
3 |
Correct |
41 ms |
25684 KB |
Output is correct |
4 |
Correct |
35 ms |
25024 KB |
Output is correct |
5 |
Correct |
47 ms |
25556 KB |
Output is correct |
6 |
Correct |
48 ms |
34520 KB |
Output is correct |
7 |
Correct |
79 ms |
35008 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 |
348 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 |
1 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 |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
212 ms |
91396 KB |
Output is correct |
21 |
Correct |
199 ms |
90832 KB |
Output is correct |
22 |
Correct |
198 ms |
90824 KB |
Output is correct |
23 |
Correct |
174 ms |
49480 KB |
Output is correct |
24 |
Correct |
128 ms |
48988 KB |
Output is correct |
25 |
Correct |
146 ms |
48976 KB |
Output is correct |
26 |
Correct |
234 ms |
91476 KB |
Output is correct |
27 |
Correct |
1 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 |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
456 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 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 |
1 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 |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
460 KB |
Output is correct |
46 |
Correct |
1 ms |
348 KB |
Output is correct |
47 |
Correct |
279 ms |
103936 KB |
Output is correct |
48 |
Correct |
250 ms |
102776 KB |
Output is correct |
49 |
Correct |
246 ms |
102880 KB |
Output is correct |
50 |
Correct |
188 ms |
61012 KB |
Output is correct |
51 |
Correct |
174 ms |
60928 KB |
Output is correct |
52 |
Correct |
179 ms |
60756 KB |
Output is correct |
53 |
Correct |
287 ms |
104184 KB |
Output is correct |
54 |
Correct |
5 ms |
1116 KB |
Output is correct |
55 |
Correct |
1 ms |
452 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
4 ms |
1116 KB |
Output is correct |
58 |
Correct |
5 ms |
1116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
48 ms |
25488 KB |
Output is correct |
3 |
Correct |
41 ms |
25684 KB |
Output is correct |
4 |
Correct |
35 ms |
25024 KB |
Output is correct |
5 |
Correct |
47 ms |
25556 KB |
Output is correct |
6 |
Correct |
48 ms |
34520 KB |
Output is correct |
7 |
Correct |
79 ms |
35008 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 |
348 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 |
1 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 |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
212 ms |
91396 KB |
Output is correct |
21 |
Correct |
199 ms |
90832 KB |
Output is correct |
22 |
Correct |
198 ms |
90824 KB |
Output is correct |
23 |
Correct |
174 ms |
49480 KB |
Output is correct |
24 |
Correct |
128 ms |
48988 KB |
Output is correct |
25 |
Correct |
146 ms |
48976 KB |
Output is correct |
26 |
Correct |
234 ms |
91476 KB |
Output is correct |
27 |
Correct |
1 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 |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
456 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 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 |
1 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 |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
460 KB |
Output is correct |
46 |
Correct |
1 ms |
348 KB |
Output is correct |
47 |
Correct |
279 ms |
103936 KB |
Output is correct |
48 |
Correct |
250 ms |
102776 KB |
Output is correct |
49 |
Correct |
246 ms |
102880 KB |
Output is correct |
50 |
Correct |
188 ms |
61012 KB |
Output is correct |
51 |
Correct |
174 ms |
60928 KB |
Output is correct |
52 |
Correct |
179 ms |
60756 KB |
Output is correct |
53 |
Correct |
287 ms |
104184 KB |
Output is correct |
54 |
Correct |
5 ms |
1116 KB |
Output is correct |
55 |
Correct |
1 ms |
452 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
4 ms |
1116 KB |
Output is correct |
58 |
Correct |
5 ms |
1116 KB |
Output is correct |
59 |
Correct |
217 ms |
67036 KB |
Output is correct |
60 |
Correct |
191 ms |
64540 KB |
Output is correct |
61 |
Correct |
178 ms |
68692 KB |
Output is correct |
62 |
Correct |
185 ms |
70812 KB |
Output is correct |
63 |
Correct |
312 ms |
112080 KB |
Output is correct |
64 |
Correct |
385 ms |
157956 KB |
Output is correct |
65 |
Correct |
356 ms |
158000 KB |
Output is correct |
66 |
Correct |
223 ms |
72376 KB |
Output is correct |
67 |
Correct |
197 ms |
72020 KB |
Output is correct |
68 |
Correct |
233 ms |
72024 KB |
Output is correct |
69 |
Correct |
374 ms |
158292 KB |
Output is correct |
70 |
Correct |
48 ms |
6492 KB |
Output is correct |
71 |
Correct |
1 ms |
348 KB |
Output is correct |
72 |
Correct |
0 ms |
348 KB |
Output is correct |
73 |
Correct |
34 ms |
6492 KB |
Output is correct |
74 |
Correct |
41 ms |
6788 KB |
Output is correct |
75 |
Correct |
51 ms |
8028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
347 ms |
49724 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
406 ms |
49656 KB |
Output is correct |
11 |
Correct |
346 ms |
49708 KB |
Output is correct |
12 |
Correct |
363 ms |
49756 KB |
Output is correct |
13 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
600 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
452 KB |
Output is correct |
39 |
Correct |
1 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
4 ms |
1116 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
4 ms |
1116 KB |
Output is correct |
45 |
Correct |
5 ms |
1220 KB |
Output is correct |
46 |
Correct |
37 ms |
6492 KB |
Output is correct |
47 |
Correct |
1 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
38 ms |
6636 KB |
Output is correct |
50 |
Correct |
44 ms |
6620 KB |
Output is correct |
51 |
Correct |
4 ms |
1372 KB |
Output is correct |
52 |
Correct |
3 ms |
1116 KB |
Output is correct |
53 |
Correct |
3 ms |
1116 KB |
Output is correct |
54 |
Correct |
346 ms |
51232 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
46 ms |
8008 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
48 ms |
25488 KB |
Output is correct |
59 |
Correct |
41 ms |
25684 KB |
Output is correct |
60 |
Correct |
35 ms |
25024 KB |
Output is correct |
61 |
Correct |
47 ms |
25556 KB |
Output is correct |
62 |
Correct |
48 ms |
34520 KB |
Output is correct |
63 |
Correct |
79 ms |
35008 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 |
348 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 |
1 ms |
348 KB |
Output is correct |
71 |
Correct |
0 ms |
348 KB |
Output is correct |
72 |
Correct |
0 ms |
348 KB |
Output is correct |
73 |
Correct |
1 ms |
604 KB |
Output is correct |
74 |
Correct |
0 ms |
348 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
212 ms |
91396 KB |
Output is correct |
77 |
Correct |
199 ms |
90832 KB |
Output is correct |
78 |
Correct |
198 ms |
90824 KB |
Output is correct |
79 |
Correct |
174 ms |
49480 KB |
Output is correct |
80 |
Correct |
128 ms |
48988 KB |
Output is correct |
81 |
Correct |
146 ms |
48976 KB |
Output is correct |
82 |
Correct |
234 ms |
91476 KB |
Output is correct |
83 |
Correct |
1 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 |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
456 KB |
Output is correct |
89 |
Correct |
0 ms |
348 KB |
Output is correct |
90 |
Correct |
1 ms |
348 KB |
Output is correct |
91 |
Correct |
0 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 |
1 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 |
348 KB |
Output is correct |
100 |
Correct |
1 ms |
348 KB |
Output is correct |
101 |
Correct |
1 ms |
460 KB |
Output is correct |
102 |
Correct |
1 ms |
348 KB |
Output is correct |
103 |
Correct |
279 ms |
103936 KB |
Output is correct |
104 |
Correct |
250 ms |
102776 KB |
Output is correct |
105 |
Correct |
246 ms |
102880 KB |
Output is correct |
106 |
Correct |
188 ms |
61012 KB |
Output is correct |
107 |
Correct |
174 ms |
60928 KB |
Output is correct |
108 |
Correct |
179 ms |
60756 KB |
Output is correct |
109 |
Correct |
287 ms |
104184 KB |
Output is correct |
110 |
Correct |
5 ms |
1116 KB |
Output is correct |
111 |
Correct |
1 ms |
452 KB |
Output is correct |
112 |
Correct |
0 ms |
348 KB |
Output is correct |
113 |
Correct |
4 ms |
1116 KB |
Output is correct |
114 |
Correct |
5 ms |
1116 KB |
Output is correct |
115 |
Correct |
217 ms |
67036 KB |
Output is correct |
116 |
Correct |
191 ms |
64540 KB |
Output is correct |
117 |
Correct |
178 ms |
68692 KB |
Output is correct |
118 |
Correct |
185 ms |
70812 KB |
Output is correct |
119 |
Correct |
312 ms |
112080 KB |
Output is correct |
120 |
Correct |
385 ms |
157956 KB |
Output is correct |
121 |
Correct |
356 ms |
158000 KB |
Output is correct |
122 |
Correct |
223 ms |
72376 KB |
Output is correct |
123 |
Correct |
197 ms |
72020 KB |
Output is correct |
124 |
Correct |
233 ms |
72024 KB |
Output is correct |
125 |
Correct |
374 ms |
158292 KB |
Output is correct |
126 |
Correct |
48 ms |
6492 KB |
Output is correct |
127 |
Correct |
1 ms |
348 KB |
Output is correct |
128 |
Correct |
0 ms |
348 KB |
Output is correct |
129 |
Correct |
34 ms |
6492 KB |
Output is correct |
130 |
Correct |
41 ms |
6788 KB |
Output is correct |
131 |
Correct |
51 ms |
8028 KB |
Output is correct |
132 |
Correct |
718 ms |
207700 KB |
Output is correct |
133 |
Correct |
687 ms |
207776 KB |
Output is correct |
134 |
Correct |
808 ms |
207700 KB |
Output is correct |
135 |
Correct |
830 ms |
207956 KB |
Output is correct |
136 |
Correct |
841 ms |
207700 KB |
Output is correct |
137 |
Correct |
540 ms |
182416 KB |
Output is correct |
138 |
Correct |
537 ms |
182552 KB |
Output is correct |
139 |
Correct |
231 ms |
78596 KB |
Output is correct |
140 |
Correct |
242 ms |
78524 KB |
Output is correct |
141 |
Correct |
270 ms |
78340 KB |
Output is correct |
142 |
Correct |
776 ms |
207884 KB |
Output is correct |