Submission #891340

# Submission time Handle Problem Language Result Execution time Memory
891340 2023-12-22T19:10:57 Z iskhakkutbilim Council (JOI23_council) C++17
100 / 100
2707 ms 58408 KB
#include <bits/stdc++.h>
using namespace std;

#define ff first
#define ss second
#define all(a) a.begin(), a.end()
const int N = 3e5;

signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	int a[n][m];
	pair<int, int> dp[2][1024][1024];
	for(int i = 0;i < n; i++){
		for(int j = 0;j < m; j++){
			cin >> a[i][j];
		}
	}
	vector<int> cnt(m,0);
	vector<int> bits(n, 0);
	int bpc[1<<20];
	
	for(int i = 0;i < 1<<20; i++){
		bpc[i] = __builtin_popcount(i);
	}
	for(int i = 0;i < 2; i++){
		for(int j = 0;j < 1024; j++){
			for(int k = 0;k < 1024; k++){
				dp[i][j][k] = {-1, -1};
			}
		}
	}
	for(int i = 0;i < n; i++){
		for(int j = 0;j < m; j++){
			bits[i]+= (a[i][j] << j);
			cnt[j]+= a[i][j];
		}
		int m0  = bits[i] & 1023;
		int m1 = bits[i]>>10;		
		for(int j = 0;j < 1024; j++){
			int c = bpc[m1 & j];
			if(dp[0][m0][j].ff == -1){
				dp[0][m0][j] = {c, i};
			}else{
				if(dp[0][m0][j].ff >= c){
					dp[1][m0][j] = dp[0][m0][j];
					dp[0][m0][j] = {c, i};
				}else if(dp[1][m0][j].ff == -1 || dp[1][m0][j].ff >= c){
					dp[1][m0][j] = {c, i};
				}
			}
		}
		
	}
	
	for(int i = 0;i < n; i++){
		int mask = 0, bc = 0;
		for(int j = 0;j < m; j++){
			if(bits[i] & (1<<j)){
				if(cnt[j] == n/2 + 1){
					bc++;
					mask+= (1<<j);
				}else if(cnt[j] > n/2+1){
					bc++;
				}
			}else{
				if(cnt[j] > n / 2) bc++;
				else if(cnt[j] == n / 2){
					mask+= (1<<j);
					bc++;
				}
			}
		}
		int mn = m;
		int m0 = mask & 1023;
		int m1 = mask >> 10;
		for(int j = 0;j < 1024; j++){
			int c = bpc[m0 & j];
			if(dp[0][j][m1].ff == -1) continue;
			int kek = 20;
			if(dp[0][j][m1].ss != i && dp[0][j][m1].ss != -1){
				kek = min(kek, dp[0][j][m1].ff);
			}
			else if(dp[1][j][m1].ss != i && dp[1][j][m1].ss != -1){
				kek = min(kek, dp[1][j][m1].ff);
			}
			mn = min(mn, kek + c);
		}
		cout << bc-mn << '\n';
	}
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 15 ms 20828 KB Output is correct
3 Correct 15 ms 20824 KB Output is correct
4 Correct 15 ms 20828 KB Output is correct
5 Correct 16 ms 20972 KB Output is correct
6 Correct 18 ms 20828 KB Output is correct
7 Correct 15 ms 20928 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 17 ms 21080 KB Output is correct
10 Correct 15 ms 20972 KB Output is correct
11 Correct 15 ms 20828 KB Output is correct
12 Correct 18 ms 20828 KB Output is correct
13 Correct 16 ms 20828 KB Output is correct
14 Correct 15 ms 20828 KB Output is correct
15 Correct 15 ms 20856 KB Output is correct
16 Correct 15 ms 20824 KB Output is correct
17 Correct 19 ms 20824 KB Output is correct
18 Correct 16 ms 20828 KB Output is correct
19 Correct 15 ms 20824 KB Output is correct
20 Correct 15 ms 20828 KB Output is correct
21 Correct 17 ms 20828 KB Output is correct
22 Correct 15 ms 20828 KB Output is correct
23 Correct 15 ms 20828 KB Output is correct
24 Correct 15 ms 20828 KB Output is correct
25 Correct 15 ms 20948 KB Output is correct
26 Correct 16 ms 20824 KB Output is correct
27 Correct 21 ms 21080 KB Output is correct
28 Correct 15 ms 20824 KB Output is correct
29 Correct 15 ms 20968 KB Output is correct
30 Correct 16 ms 20828 KB Output is correct
31 Correct 17 ms 20824 KB Output is correct
32 Correct 15 ms 20828 KB Output is correct
33 Correct 16 ms 20784 KB Output is correct
34 Correct 15 ms 20828 KB Output is correct
35 Correct 16 ms 20864 KB Output is correct
36 Correct 15 ms 20896 KB Output is correct
37 Correct 16 ms 20824 KB Output is correct
38 Correct 15 ms 20828 KB Output is correct
39 Correct 15 ms 20828 KB Output is correct
40 Correct 17 ms 20824 KB Output is correct
41 Correct 15 ms 20828 KB Output is correct
42 Correct 16 ms 20828 KB Output is correct
43 Correct 15 ms 20828 KB Output is correct
44 Correct 15 ms 20828 KB Output is correct
45 Correct 15 ms 20744 KB Output is correct
46 Correct 15 ms 20828 KB Output is correct
47 Correct 15 ms 20828 KB Output is correct
48 Correct 16 ms 20828 KB Output is correct
49 Correct 16 ms 20828 KB Output is correct
50 Correct 15 ms 20828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 15 ms 20828 KB Output is correct
3 Correct 15 ms 20824 KB Output is correct
4 Correct 15 ms 20828 KB Output is correct
5 Correct 16 ms 20972 KB Output is correct
6 Correct 18 ms 20828 KB Output is correct
7 Correct 15 ms 20928 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 17 ms 21080 KB Output is correct
10 Correct 15 ms 20972 KB Output is correct
11 Correct 15 ms 20828 KB Output is correct
12 Correct 18 ms 20828 KB Output is correct
13 Correct 16 ms 20828 KB Output is correct
14 Correct 15 ms 20828 KB Output is correct
15 Correct 15 ms 20856 KB Output is correct
16 Correct 15 ms 20824 KB Output is correct
17 Correct 19 ms 20824 KB Output is correct
18 Correct 16 ms 20828 KB Output is correct
19 Correct 15 ms 20824 KB Output is correct
20 Correct 15 ms 20828 KB Output is correct
21 Correct 17 ms 20828 KB Output is correct
22 Correct 15 ms 20828 KB Output is correct
23 Correct 15 ms 20828 KB Output is correct
24 Correct 15 ms 20828 KB Output is correct
25 Correct 15 ms 20948 KB Output is correct
26 Correct 16 ms 20824 KB Output is correct
27 Correct 21 ms 21080 KB Output is correct
28 Correct 15 ms 20824 KB Output is correct
29 Correct 15 ms 20968 KB Output is correct
30 Correct 16 ms 20828 KB Output is correct
31 Correct 17 ms 20824 KB Output is correct
32 Correct 15 ms 20828 KB Output is correct
33 Correct 16 ms 20784 KB Output is correct
34 Correct 15 ms 20828 KB Output is correct
35 Correct 16 ms 20864 KB Output is correct
36 Correct 15 ms 20896 KB Output is correct
37 Correct 16 ms 20824 KB Output is correct
38 Correct 15 ms 20828 KB Output is correct
39 Correct 15 ms 20828 KB Output is correct
40 Correct 17 ms 20824 KB Output is correct
41 Correct 15 ms 20828 KB Output is correct
42 Correct 16 ms 20828 KB Output is correct
43 Correct 15 ms 20828 KB Output is correct
44 Correct 15 ms 20828 KB Output is correct
45 Correct 15 ms 20744 KB Output is correct
46 Correct 15 ms 20828 KB Output is correct
47 Correct 15 ms 20828 KB Output is correct
48 Correct 16 ms 20828 KB Output is correct
49 Correct 16 ms 20828 KB Output is correct
50 Correct 15 ms 20828 KB Output is correct
51 Correct 41 ms 21204 KB Output is correct
52 Correct 42 ms 21084 KB Output is correct
53 Correct 36 ms 21080 KB Output is correct
54 Correct 39 ms 21080 KB Output is correct
55 Correct 45 ms 20988 KB Output is correct
56 Correct 34 ms 21084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 2352 ms 25076 KB Output is correct
3 Correct 2461 ms 25432 KB Output is correct
4 Correct 2400 ms 23888 KB Output is correct
5 Correct 2487 ms 25088 KB Output is correct
6 Correct 2403 ms 23872 KB Output is correct
7 Correct 2459 ms 25380 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 15 ms 20960 KB Output is correct
10 Correct 17 ms 21084 KB Output is correct
11 Correct 15 ms 20972 KB Output is correct
12 Correct 18 ms 20972 KB Output is correct
13 Correct 16 ms 20968 KB Output is correct
14 Correct 16 ms 20828 KB Output is correct
15 Correct 16 ms 20824 KB Output is correct
16 Correct 17 ms 20824 KB Output is correct
17 Correct 39 ms 20956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 2352 ms 25076 KB Output is correct
3 Correct 2461 ms 25432 KB Output is correct
4 Correct 2400 ms 23888 KB Output is correct
5 Correct 2487 ms 25088 KB Output is correct
6 Correct 2403 ms 23872 KB Output is correct
7 Correct 2459 ms 25380 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 15 ms 20960 KB Output is correct
10 Correct 17 ms 21084 KB Output is correct
11 Correct 15 ms 20972 KB Output is correct
12 Correct 18 ms 20972 KB Output is correct
13 Correct 16 ms 20968 KB Output is correct
14 Correct 16 ms 20828 KB Output is correct
15 Correct 16 ms 20824 KB Output is correct
16 Correct 17 ms 20824 KB Output is correct
17 Correct 39 ms 20956 KB Output is correct
18 Correct 15 ms 20828 KB Output is correct
19 Correct 15 ms 20952 KB Output is correct
20 Correct 2268 ms 34932 KB Output is correct
21 Correct 2343 ms 33472 KB Output is correct
22 Correct 2343 ms 33668 KB Output is correct
23 Correct 2547 ms 35140 KB Output is correct
24 Correct 2585 ms 34672 KB Output is correct
25 Correct 1830 ms 34652 KB Output is correct
26 Correct 1657 ms 34424 KB Output is correct
27 Correct 15 ms 20828 KB Output is correct
28 Correct 15 ms 20828 KB Output is correct
29 Correct 15 ms 20940 KB Output is correct
30 Correct 15 ms 20900 KB Output is correct
31 Correct 16 ms 20828 KB Output is correct
32 Correct 15 ms 20968 KB Output is correct
33 Correct 14 ms 20828 KB Output is correct
34 Correct 15 ms 20828 KB Output is correct
35 Correct 15 ms 20728 KB Output is correct
36 Correct 17 ms 20824 KB Output is correct
37 Correct 19 ms 20828 KB Output is correct
38 Correct 16 ms 20828 KB Output is correct
39 Correct 17 ms 20828 KB Output is correct
40 Correct 17 ms 20896 KB Output is correct
41 Correct 15 ms 20828 KB Output is correct
42 Correct 16 ms 20828 KB Output is correct
43 Correct 16 ms 20828 KB Output is correct
44 Correct 15 ms 20828 KB Output is correct
45 Correct 17 ms 20980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 2352 ms 25076 KB Output is correct
3 Correct 2461 ms 25432 KB Output is correct
4 Correct 2400 ms 23888 KB Output is correct
5 Correct 2487 ms 25088 KB Output is correct
6 Correct 2403 ms 23872 KB Output is correct
7 Correct 2459 ms 25380 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 15 ms 20960 KB Output is correct
10 Correct 17 ms 21084 KB Output is correct
11 Correct 15 ms 20972 KB Output is correct
12 Correct 18 ms 20972 KB Output is correct
13 Correct 16 ms 20968 KB Output is correct
14 Correct 16 ms 20828 KB Output is correct
15 Correct 16 ms 20824 KB Output is correct
16 Correct 17 ms 20824 KB Output is correct
17 Correct 39 ms 20956 KB Output is correct
18 Correct 15 ms 20828 KB Output is correct
19 Correct 15 ms 20952 KB Output is correct
20 Correct 2268 ms 34932 KB Output is correct
21 Correct 2343 ms 33472 KB Output is correct
22 Correct 2343 ms 33668 KB Output is correct
23 Correct 2547 ms 35140 KB Output is correct
24 Correct 2585 ms 34672 KB Output is correct
25 Correct 1830 ms 34652 KB Output is correct
26 Correct 1657 ms 34424 KB Output is correct
27 Correct 15 ms 20828 KB Output is correct
28 Correct 15 ms 20828 KB Output is correct
29 Correct 15 ms 20940 KB Output is correct
30 Correct 15 ms 20900 KB Output is correct
31 Correct 16 ms 20828 KB Output is correct
32 Correct 15 ms 20968 KB Output is correct
33 Correct 14 ms 20828 KB Output is correct
34 Correct 15 ms 20828 KB Output is correct
35 Correct 15 ms 20728 KB Output is correct
36 Correct 17 ms 20824 KB Output is correct
37 Correct 19 ms 20828 KB Output is correct
38 Correct 16 ms 20828 KB Output is correct
39 Correct 17 ms 20828 KB Output is correct
40 Correct 17 ms 20896 KB Output is correct
41 Correct 15 ms 20828 KB Output is correct
42 Correct 16 ms 20828 KB Output is correct
43 Correct 16 ms 20828 KB Output is correct
44 Correct 15 ms 20828 KB Output is correct
45 Correct 17 ms 20980 KB Output is correct
46 Correct 17 ms 21080 KB Output is correct
47 Correct 1658 ms 39644 KB Output is correct
48 Correct 1826 ms 38044 KB Output is correct
49 Correct 1831 ms 37984 KB Output is correct
50 Correct 2604 ms 39424 KB Output is correct
51 Correct 2547 ms 39232 KB Output is correct
52 Correct 1841 ms 39172 KB Output is correct
53 Correct 2089 ms 39384 KB Output is correct
54 Correct 15 ms 20828 KB Output is correct
55 Correct 15 ms 20828 KB Output is correct
56 Correct 15 ms 20920 KB Output is correct
57 Correct 20 ms 20828 KB Output is correct
58 Correct 15 ms 20824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 2352 ms 25076 KB Output is correct
3 Correct 2461 ms 25432 KB Output is correct
4 Correct 2400 ms 23888 KB Output is correct
5 Correct 2487 ms 25088 KB Output is correct
6 Correct 2403 ms 23872 KB Output is correct
7 Correct 2459 ms 25380 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 15 ms 20960 KB Output is correct
10 Correct 17 ms 21084 KB Output is correct
11 Correct 15 ms 20972 KB Output is correct
12 Correct 18 ms 20972 KB Output is correct
13 Correct 16 ms 20968 KB Output is correct
14 Correct 16 ms 20828 KB Output is correct
15 Correct 16 ms 20824 KB Output is correct
16 Correct 17 ms 20824 KB Output is correct
17 Correct 39 ms 20956 KB Output is correct
18 Correct 15 ms 20828 KB Output is correct
19 Correct 15 ms 20952 KB Output is correct
20 Correct 2268 ms 34932 KB Output is correct
21 Correct 2343 ms 33472 KB Output is correct
22 Correct 2343 ms 33668 KB Output is correct
23 Correct 2547 ms 35140 KB Output is correct
24 Correct 2585 ms 34672 KB Output is correct
25 Correct 1830 ms 34652 KB Output is correct
26 Correct 1657 ms 34424 KB Output is correct
27 Correct 15 ms 20828 KB Output is correct
28 Correct 15 ms 20828 KB Output is correct
29 Correct 15 ms 20940 KB Output is correct
30 Correct 15 ms 20900 KB Output is correct
31 Correct 16 ms 20828 KB Output is correct
32 Correct 15 ms 20968 KB Output is correct
33 Correct 14 ms 20828 KB Output is correct
34 Correct 15 ms 20828 KB Output is correct
35 Correct 15 ms 20728 KB Output is correct
36 Correct 17 ms 20824 KB Output is correct
37 Correct 19 ms 20828 KB Output is correct
38 Correct 16 ms 20828 KB Output is correct
39 Correct 17 ms 20828 KB Output is correct
40 Correct 17 ms 20896 KB Output is correct
41 Correct 15 ms 20828 KB Output is correct
42 Correct 16 ms 20828 KB Output is correct
43 Correct 16 ms 20828 KB Output is correct
44 Correct 15 ms 20828 KB Output is correct
45 Correct 17 ms 20980 KB Output is correct
46 Correct 17 ms 21080 KB Output is correct
47 Correct 1658 ms 39644 KB Output is correct
48 Correct 1826 ms 38044 KB Output is correct
49 Correct 1831 ms 37984 KB Output is correct
50 Correct 2604 ms 39424 KB Output is correct
51 Correct 2547 ms 39232 KB Output is correct
52 Correct 1841 ms 39172 KB Output is correct
53 Correct 2089 ms 39384 KB Output is correct
54 Correct 15 ms 20828 KB Output is correct
55 Correct 15 ms 20828 KB Output is correct
56 Correct 15 ms 20920 KB Output is correct
57 Correct 20 ms 20828 KB Output is correct
58 Correct 15 ms 20824 KB Output is correct
59 Correct 1852 ms 41992 KB Output is correct
60 Correct 715 ms 29320 KB Output is correct
61 Correct 781 ms 30036 KB Output is correct
62 Correct 818 ms 30464 KB Output is correct
63 Correct 1736 ms 41696 KB Output is correct
64 Correct 1861 ms 42644 KB Output is correct
65 Correct 1969 ms 42556 KB Output is correct
66 Correct 2631 ms 43608 KB Output is correct
67 Correct 2567 ms 42624 KB Output is correct
68 Correct 1864 ms 42552 KB Output is correct
69 Correct 1932 ms 42952 KB Output is correct
70 Correct 15 ms 20828 KB Output is correct
71 Correct 15 ms 20968 KB Output is correct
72 Correct 15 ms 20828 KB Output is correct
73 Correct 14 ms 20800 KB Output is correct
74 Correct 16 ms 20828 KB Output is correct
75 Correct 33 ms 21080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 20828 KB Output is correct
2 Correct 15 ms 20828 KB Output is correct
3 Correct 15 ms 20824 KB Output is correct
4 Correct 15 ms 20828 KB Output is correct
5 Correct 16 ms 20972 KB Output is correct
6 Correct 18 ms 20828 KB Output is correct
7 Correct 15 ms 20928 KB Output is correct
8 Correct 15 ms 20828 KB Output is correct
9 Correct 17 ms 21080 KB Output is correct
10 Correct 15 ms 20972 KB Output is correct
11 Correct 15 ms 20828 KB Output is correct
12 Correct 18 ms 20828 KB Output is correct
13 Correct 16 ms 20828 KB Output is correct
14 Correct 15 ms 20828 KB Output is correct
15 Correct 15 ms 20856 KB Output is correct
16 Correct 15 ms 20824 KB Output is correct
17 Correct 19 ms 20824 KB Output is correct
18 Correct 16 ms 20828 KB Output is correct
19 Correct 15 ms 20824 KB Output is correct
20 Correct 15 ms 20828 KB Output is correct
21 Correct 17 ms 20828 KB Output is correct
22 Correct 15 ms 20828 KB Output is correct
23 Correct 15 ms 20828 KB Output is correct
24 Correct 15 ms 20828 KB Output is correct
25 Correct 15 ms 20948 KB Output is correct
26 Correct 16 ms 20824 KB Output is correct
27 Correct 21 ms 21080 KB Output is correct
28 Correct 15 ms 20824 KB Output is correct
29 Correct 15 ms 20968 KB Output is correct
30 Correct 16 ms 20828 KB Output is correct
31 Correct 17 ms 20824 KB Output is correct
32 Correct 15 ms 20828 KB Output is correct
33 Correct 16 ms 20784 KB Output is correct
34 Correct 15 ms 20828 KB Output is correct
35 Correct 16 ms 20864 KB Output is correct
36 Correct 15 ms 20896 KB Output is correct
37 Correct 16 ms 20824 KB Output is correct
38 Correct 15 ms 20828 KB Output is correct
39 Correct 15 ms 20828 KB Output is correct
40 Correct 17 ms 20824 KB Output is correct
41 Correct 15 ms 20828 KB Output is correct
42 Correct 16 ms 20828 KB Output is correct
43 Correct 15 ms 20828 KB Output is correct
44 Correct 15 ms 20828 KB Output is correct
45 Correct 15 ms 20744 KB Output is correct
46 Correct 15 ms 20828 KB Output is correct
47 Correct 15 ms 20828 KB Output is correct
48 Correct 16 ms 20828 KB Output is correct
49 Correct 16 ms 20828 KB Output is correct
50 Correct 15 ms 20828 KB Output is correct
51 Correct 41 ms 21204 KB Output is correct
52 Correct 42 ms 21084 KB Output is correct
53 Correct 36 ms 21080 KB Output is correct
54 Correct 39 ms 21080 KB Output is correct
55 Correct 45 ms 20988 KB Output is correct
56 Correct 34 ms 21084 KB Output is correct
57 Correct 15 ms 20828 KB Output is correct
58 Correct 2352 ms 25076 KB Output is correct
59 Correct 2461 ms 25432 KB Output is correct
60 Correct 2400 ms 23888 KB Output is correct
61 Correct 2487 ms 25088 KB Output is correct
62 Correct 2403 ms 23872 KB Output is correct
63 Correct 2459 ms 25380 KB Output is correct
64 Correct 15 ms 20828 KB Output is correct
65 Correct 15 ms 20960 KB Output is correct
66 Correct 17 ms 21084 KB Output is correct
67 Correct 15 ms 20972 KB Output is correct
68 Correct 18 ms 20972 KB Output is correct
69 Correct 16 ms 20968 KB Output is correct
70 Correct 16 ms 20828 KB Output is correct
71 Correct 16 ms 20824 KB Output is correct
72 Correct 17 ms 20824 KB Output is correct
73 Correct 39 ms 20956 KB Output is correct
74 Correct 15 ms 20828 KB Output is correct
75 Correct 15 ms 20952 KB Output is correct
76 Correct 2268 ms 34932 KB Output is correct
77 Correct 2343 ms 33472 KB Output is correct
78 Correct 2343 ms 33668 KB Output is correct
79 Correct 2547 ms 35140 KB Output is correct
80 Correct 2585 ms 34672 KB Output is correct
81 Correct 1830 ms 34652 KB Output is correct
82 Correct 1657 ms 34424 KB Output is correct
83 Correct 15 ms 20828 KB Output is correct
84 Correct 15 ms 20828 KB Output is correct
85 Correct 15 ms 20940 KB Output is correct
86 Correct 15 ms 20900 KB Output is correct
87 Correct 16 ms 20828 KB Output is correct
88 Correct 15 ms 20968 KB Output is correct
89 Correct 14 ms 20828 KB Output is correct
90 Correct 15 ms 20828 KB Output is correct
91 Correct 15 ms 20728 KB Output is correct
92 Correct 17 ms 20824 KB Output is correct
93 Correct 19 ms 20828 KB Output is correct
94 Correct 16 ms 20828 KB Output is correct
95 Correct 17 ms 20828 KB Output is correct
96 Correct 17 ms 20896 KB Output is correct
97 Correct 15 ms 20828 KB Output is correct
98 Correct 16 ms 20828 KB Output is correct
99 Correct 16 ms 20828 KB Output is correct
100 Correct 15 ms 20828 KB Output is correct
101 Correct 17 ms 20980 KB Output is correct
102 Correct 17 ms 21080 KB Output is correct
103 Correct 1658 ms 39644 KB Output is correct
104 Correct 1826 ms 38044 KB Output is correct
105 Correct 1831 ms 37984 KB Output is correct
106 Correct 2604 ms 39424 KB Output is correct
107 Correct 2547 ms 39232 KB Output is correct
108 Correct 1841 ms 39172 KB Output is correct
109 Correct 2089 ms 39384 KB Output is correct
110 Correct 15 ms 20828 KB Output is correct
111 Correct 15 ms 20828 KB Output is correct
112 Correct 15 ms 20920 KB Output is correct
113 Correct 20 ms 20828 KB Output is correct
114 Correct 15 ms 20824 KB Output is correct
115 Correct 1852 ms 41992 KB Output is correct
116 Correct 715 ms 29320 KB Output is correct
117 Correct 781 ms 30036 KB Output is correct
118 Correct 818 ms 30464 KB Output is correct
119 Correct 1736 ms 41696 KB Output is correct
120 Correct 1861 ms 42644 KB Output is correct
121 Correct 1969 ms 42556 KB Output is correct
122 Correct 2631 ms 43608 KB Output is correct
123 Correct 2567 ms 42624 KB Output is correct
124 Correct 1864 ms 42552 KB Output is correct
125 Correct 1932 ms 42952 KB Output is correct
126 Correct 15 ms 20828 KB Output is correct
127 Correct 15 ms 20968 KB Output is correct
128 Correct 15 ms 20828 KB Output is correct
129 Correct 14 ms 20800 KB Output is correct
130 Correct 16 ms 20828 KB Output is correct
131 Correct 33 ms 21080 KB Output is correct
132 Correct 1960 ms 46500 KB Output is correct
133 Correct 1973 ms 46340 KB Output is correct
134 Correct 1990 ms 58408 KB Output is correct
135 Correct 2095 ms 58212 KB Output is correct
136 Correct 2093 ms 58108 KB Output is correct
137 Correct 2090 ms 56292 KB Output is correct
138 Correct 1944 ms 56400 KB Output is correct
139 Correct 2642 ms 58216 KB Output is correct
140 Correct 2707 ms 58032 KB Output is correct
141 Correct 1993 ms 57772 KB Output is correct
142 Correct 2090 ms 58008 KB Output is correct