Submission #584632

# Submission time Handle Problem Language Result Execution time Memory
584632 2022-06-27T17:51:32 Z rainboy Mars (APIO22_mars) C++17
100 / 100
1442 ms 4716 KB
#include "mars.h"
#include <string.h>
#include <stdio.h>
 
using namespace std;
 
typedef vector<string> vs;
typedef vector<vs> vvs;
 
const int N = 20, N_ = N * 2 + 1;
 
int find(int *ds, int i) {
	return ds[i] < 0 ? i : (ds[i] = find(ds, ds[i]));
}
 
int join(int *ds, int i, int j) {
	i = find(ds, i);
	j = find(ds, j);
	if (i == j)
		return 0;
	if (ds[i] > ds[j])
		ds[i] = j;
	else {
		if (ds[i] == ds[j])
			ds[i]--;
		ds[j] = i;
	}
	return 1;
}
 
string process(vvs ss, int i, int j, int k, int n) {
	int n_ = (k + 1) * 2 + 1, m = (n + 1) / 2, l = (m + 1) / 3;
	if (n == 1) {
		int ds[N_ * N_];
		memset(ds, -1, n_ * n_ * sizeof *ds);
		for (i = 0; i < n_; i++)
			for (j = 0; j < n_; j++)
				if (ss[i][j][0] == '1') {
					if (i > 0 && ss[i - 1][j][0] == '1')
						join(ds, i * n_ + j, (i - 1) * n_ + j);
					if (j > 0 && ss[i][j - 1][0] == '1')
						join(ds, i * n_ + j, i * n_ + (j - 1));
				}
		int c = 0;
		for (i = 0; i < n_ * n_; i++)
			if (ds[i] < 0 && ss[i / n_][i % n_][0] == '1')
				c++;
		string t(100, '0');
		for (int h = 0; h < 10; h++)
			t[h] = (c >> h & 1) + '0';
		return t;
	} else {
		if (k < l) {
			string s(100, '0');
			for (int i1 = 0; i1 < 3; i1++)
				for (int j1 = 0; j1 < 3; j1++)
					for (int i2 = 0; i2 < n_ - 2; i2++)
						for (int j2 = 0; j2 < n_ - 2; j2++)
							s[(i1 + i2) * n_ + (j1 + j2)] = ss[i1][j1][i2 * (n_ - 2) + j2];
			return s;
		} else if (k < m - 1) {
			for (int i1 = 0; i1 < 2; i1++)
				for (int j1 = 0; j1 < 2; j1++)
					for (int i2 = 0; i2 < 3; i2++)
						for (int j2 = 0; j2 < 3; j2++)
							if (i == i1 * (n - m) * 2 + i2 * (m - 1 - k) && j == j1 * (n - m) * 2 + j2 * (m - 1 - k))
								return ss[i2][j2];
			return ss[0][0];
		} else if (k == m - 1) {
			int i0, j0;
			for (i0 = 0; i0 < 2; i0++)
				for (j0 = 0; j0 < 2; j0++)
					if (i == i0 * (n - m) * 2 && j == j0 * (n - m) * 2)
						goto out;
out:
			if (i0 == 2)
				return ss[0][0];
			int m_ = m * 2 + 1, l_ = l * 2 + 1;
			string s_(m_ * m_, '0');
			for (int i1 = 0; i1 < 3; i1++)
				for (int j1 = 0; j1 < 3; j1++)
					for (int i2 = 0; i2 < l_; i2++)
						for (int j2 = 0; j2 < l_; j2++)
							s_[(i1 * (m - l) + i2) * m_ + (j1 * (m - l) + j2)] = ss[i1][j1][i2 * l_ + j2];
			string s((n + 1) * (n + 1), '0');
			for (i = 0; i <= n; i++)
				for (j = 0; j <= n; j++)
					s[i * (n + 1) + j] = s_[(i + i0 * n % 2) * m_ + (j + j0 * n % 2)];
			int ds[(N + 1) * (N + 1)];
			memset(ds, -1, (n + 1) * (n + 1) * sizeof *ds);
			for (i = 0; i <= n; i++)
				for (j = 0; j <= n; j++)
					if (s[i * (n + 1) + j] == '1') {
						if (i > 0 && s[(i - 1) * (n + 1) + j] == '1')
							join(ds, i * (n + 1) + j, (i - 1) * (n + 1) + j);
						if (j > 0 && s[i * (n + 1) + (j - 1)] == '1')
							join(ds, i * (n + 1) + j, i * (n + 1) + (j - 1));
					}
			int rr_[N * 4];
			for (i = 0, j = 0; i < n; i++)
				rr_[i] = find(ds, i * (n + 1) + j);
			for (i = n, j = 0; j < n; j++)
				rr_[n + j] = find(ds, i * (n + 1) + j);
			for (i = n, j = n; i > 0; i--)
				rr_[n * 3 - i] = find(ds, i * (n + 1) + j);
			for (i = 0, j = n; j > 0; j--)
				rr_[n * 4 - j] = find(ds, i * (n + 1) + j);
			int c = 0;
			for (i = 0; i < (n + 1) * (n + 1); i++)
				if (ds[i] < 0 && s[i] == '1')
					c++;
			string t(100, '0');
			int rr[N_];
			if (i0 == 0 && j0 == 0)
				for (int h = 0; h <= n * 2; h++)
					rr[h] = rr_[(h + n) % (n * 4)];
			else if (i0 == 0 && j0 == 1)
				for (int h = 0; h <= n * 2; h++)
					rr[h] = rr_[(h + 0) % (n * 4)];
			else if (i0 == 1 && j0 == 1)
				for (int h = 0; h <= n * 2; h++)
					rr[h] = rr_[(h + n * 3) % (n * 4)];
			else
				for (int h = 0; h <= n * 2; h++)
					rr[h] = rr_[(h + n * 2) % (n * 4)];
			for (int h = 0; h <= n; h++)
				if (s[rr[h]] == '0')
					c++;
			if (i0 == 0 && j0 == 0 && s[rr[n]] == '0')
				c--;
			char used[(N + 1) * (N + 1)];
			for (int h = 0; h < 10; h++)
				t[h] = (c >> h & 1) + '0';
			memset(used, 0, sizeof used);
			for (int h = 0; h <= n * 2; h++)
				if (!used[rr[h]])
					used[rr[h]] = 1, t[10 + (h << 1 | 0)] = '1';
			memset(used, 0, sizeof used);
			for (int h = n * 2; h >= 0; h--)
				if (!used[rr[h]])
					used[rr[h]] = 1, t[10 + (h << 1 | 1)] = '1';
			return t;
		} else if (k < n - 1) {
			if (i == (n - 1 - k) * 2 && j == 0)
				return ss[2][0];
			else if (i == 0 && j == (n - 1 - k) * 2)
				return ss[0][2];
			if (i == (n - 1 - k) * 2 && j == (n - 1 - k) * 2)
				return ss[2][2];
			return ss[0][0];
		} else {
			int ds[N_ * 4], qu[N_];
			int c_, cnt;
 
			memset(ds, -1, n_ * 4 * sizeof *ds);
			c_ = 0;
			for (int i0 = 0; i0 < 2; i0++)
				for (int j0 = 0; j0 < 2; j0++) {
					string t = ss[i0 * 2][j0 * 2];
					int g = 0;
					if (i0 == 0 && j0 == 0)
						g = 0;
					else if (i0 == 0 && j0 == 1)
						g = 1;
					else if (i0 == 1 && j0 == 1)
						g = 2;
					else
						g = 3;
					int c = 0;
					for (int h = 0; h < 10; h++)
						if (t[h] == '1')
							c |= 1 << h;
					c_ += c;
					cnt = 0;
					for (int h = 0; h <= n * 2; h++) {
						if (t[10 + (h << 1 | 0)] == '1')
							qu[cnt++] = g * n_ + h;
						else
							join(ds, qu[cnt - 1], g * n_ + h);
						if (t[10 + (h << 1 | 1)] == '1')
							cnt--;
					}
				}
			for (int g = 0; g < 4; g++)
				for (int h = n; h <= n * 2; h++)
					if (join(ds, g * n_ + h, (g + 1) % 4 * n_ + n_ - 1 - h))
						c_--;
			string t(100, '0');
			for (int h = 0; h < 10; h++)
				t[h] = (c_ >> h & 1) + '0';
			return t;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
29 Correct 137 ms 2740 KB Output is correct
30 Correct 183 ms 2864 KB Output is correct
31 Correct 172 ms 2932 KB Output is correct
32 Correct 178 ms 2832 KB Output is correct
33 Correct 174 ms 2896 KB Output is correct
34 Correct 182 ms 2832 KB Output is correct
35 Correct 187 ms 2832 KB Output is correct
36 Correct 168 ms 2880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
29 Correct 137 ms 2740 KB Output is correct
30 Correct 183 ms 2864 KB Output is correct
31 Correct 172 ms 2932 KB Output is correct
32 Correct 178 ms 2832 KB Output is correct
33 Correct 174 ms 2896 KB Output is correct
34 Correct 182 ms 2832 KB Output is correct
35 Correct 187 ms 2832 KB Output is correct
36 Correct 168 ms 2880 KB Output is correct
37 Correct 256 ms 3188 KB Output is correct
38 Correct 303 ms 3208 KB Output is correct
39 Correct 293 ms 3200 KB Output is correct
40 Correct 323 ms 3188 KB Output is correct
41 Correct 287 ms 3204 KB Output is correct
42 Correct 324 ms 3248 KB Output is correct
43 Correct 291 ms 3172 KB Output is correct
44 Correct 328 ms 3252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
29 Correct 137 ms 2740 KB Output is correct
30 Correct 183 ms 2864 KB Output is correct
31 Correct 172 ms 2932 KB Output is correct
32 Correct 178 ms 2832 KB Output is correct
33 Correct 174 ms 2896 KB Output is correct
34 Correct 182 ms 2832 KB Output is correct
35 Correct 187 ms 2832 KB Output is correct
36 Correct 168 ms 2880 KB Output is correct
37 Correct 256 ms 3188 KB Output is correct
38 Correct 303 ms 3208 KB Output is correct
39 Correct 293 ms 3200 KB Output is correct
40 Correct 323 ms 3188 KB Output is correct
41 Correct 287 ms 3204 KB Output is correct
42 Correct 324 ms 3248 KB Output is correct
43 Correct 291 ms 3172 KB Output is correct
44 Correct 328 ms 3252 KB Output is correct
45 Correct 401 ms 3280 KB Output is correct
46 Correct 449 ms 3496 KB Output is correct
47 Correct 473 ms 3380 KB Output is correct
48 Correct 490 ms 3444 KB Output is correct
49 Correct 440 ms 3496 KB Output is correct
50 Correct 448 ms 3448 KB Output is correct
51 Correct 472 ms 3608 KB Output is correct
52 Correct 435 ms 3376 KB Output is correct
53 Correct 453 ms 3700 KB Output is correct
54 Correct 450 ms 3568 KB Output is correct
55 Correct 460 ms 3476 KB Output is correct
56 Correct 457 ms 3640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
29 Correct 137 ms 2740 KB Output is correct
30 Correct 183 ms 2864 KB Output is correct
31 Correct 172 ms 2932 KB Output is correct
32 Correct 178 ms 2832 KB Output is correct
33 Correct 174 ms 2896 KB Output is correct
34 Correct 182 ms 2832 KB Output is correct
35 Correct 187 ms 2832 KB Output is correct
36 Correct 168 ms 2880 KB Output is correct
37 Correct 256 ms 3188 KB Output is correct
38 Correct 303 ms 3208 KB Output is correct
39 Correct 293 ms 3200 KB Output is correct
40 Correct 323 ms 3188 KB Output is correct
41 Correct 287 ms 3204 KB Output is correct
42 Correct 324 ms 3248 KB Output is correct
43 Correct 291 ms 3172 KB Output is correct
44 Correct 328 ms 3252 KB Output is correct
45 Correct 401 ms 3280 KB Output is correct
46 Correct 449 ms 3496 KB Output is correct
47 Correct 473 ms 3380 KB Output is correct
48 Correct 490 ms 3444 KB Output is correct
49 Correct 440 ms 3496 KB Output is correct
50 Correct 448 ms 3448 KB Output is correct
51 Correct 472 ms 3608 KB Output is correct
52 Correct 435 ms 3376 KB Output is correct
53 Correct 453 ms 3700 KB Output is correct
54 Correct 450 ms 3568 KB Output is correct
55 Correct 460 ms 3476 KB Output is correct
56 Correct 457 ms 3640 KB Output is correct
57 Correct 578 ms 3972 KB Output is correct
58 Correct 641 ms 4120 KB Output is correct
59 Correct 676 ms 4108 KB Output is correct
60 Correct 674 ms 4136 KB Output is correct
61 Correct 697 ms 4196 KB Output is correct
62 Correct 668 ms 4168 KB Output is correct
63 Correct 687 ms 4144 KB Output is correct
64 Correct 720 ms 4112 KB Output is correct
65 Correct 711 ms 4124 KB Output is correct
66 Correct 690 ms 4052 KB Output is correct
67 Correct 686 ms 4164 KB Output is correct
68 Correct 676 ms 4080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
29 Correct 137 ms 2740 KB Output is correct
30 Correct 183 ms 2864 KB Output is correct
31 Correct 172 ms 2932 KB Output is correct
32 Correct 178 ms 2832 KB Output is correct
33 Correct 174 ms 2896 KB Output is correct
34 Correct 182 ms 2832 KB Output is correct
35 Correct 187 ms 2832 KB Output is correct
36 Correct 168 ms 2880 KB Output is correct
37 Correct 256 ms 3188 KB Output is correct
38 Correct 303 ms 3208 KB Output is correct
39 Correct 293 ms 3200 KB Output is correct
40 Correct 323 ms 3188 KB Output is correct
41 Correct 287 ms 3204 KB Output is correct
42 Correct 324 ms 3248 KB Output is correct
43 Correct 291 ms 3172 KB Output is correct
44 Correct 328 ms 3252 KB Output is correct
45 Correct 401 ms 3280 KB Output is correct
46 Correct 449 ms 3496 KB Output is correct
47 Correct 473 ms 3380 KB Output is correct
48 Correct 490 ms 3444 KB Output is correct
49 Correct 440 ms 3496 KB Output is correct
50 Correct 448 ms 3448 KB Output is correct
51 Correct 472 ms 3608 KB Output is correct
52 Correct 435 ms 3376 KB Output is correct
53 Correct 453 ms 3700 KB Output is correct
54 Correct 450 ms 3568 KB Output is correct
55 Correct 460 ms 3476 KB Output is correct
56 Correct 457 ms 3640 KB Output is correct
57 Correct 578 ms 3972 KB Output is correct
58 Correct 641 ms 4120 KB Output is correct
59 Correct 676 ms 4108 KB Output is correct
60 Correct 674 ms 4136 KB Output is correct
61 Correct 697 ms 4196 KB Output is correct
62 Correct 668 ms 4168 KB Output is correct
63 Correct 687 ms 4144 KB Output is correct
64 Correct 720 ms 4112 KB Output is correct
65 Correct 711 ms 4124 KB Output is correct
66 Correct 690 ms 4052 KB Output is correct
67 Correct 686 ms 4164 KB Output is correct
68 Correct 676 ms 4080 KB Output is correct
69 Correct 860 ms 4308 KB Output is correct
70 Correct 957 ms 4356 KB Output is correct
71 Correct 941 ms 4180 KB Output is correct
72 Correct 968 ms 4168 KB Output is correct
73 Correct 1002 ms 4168 KB Output is correct
74 Correct 1008 ms 4252 KB Output is correct
75 Correct 1024 ms 4248 KB Output is correct
76 Correct 917 ms 4364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1944 KB Output is correct
2 Correct 8 ms 2016 KB Output is correct
3 Correct 8 ms 2032 KB Output is correct
4 Correct 8 ms 1848 KB Output is correct
5 Correct 8 ms 1804 KB Output is correct
6 Correct 8 ms 1980 KB Output is correct
7 Correct 10 ms 1988 KB Output is correct
8 Correct 16 ms 2064 KB Output is correct
9 Correct 16 ms 2068 KB Output is correct
10 Correct 16 ms 2240 KB Output is correct
11 Correct 16 ms 2092 KB Output is correct
12 Correct 16 ms 2216 KB Output is correct
13 Correct 16 ms 1868 KB Output is correct
14 Correct 28 ms 2492 KB Output is correct
15 Correct 43 ms 2572 KB Output is correct
16 Correct 47 ms 2556 KB Output is correct
17 Correct 40 ms 2532 KB Output is correct
18 Correct 41 ms 2564 KB Output is correct
19 Correct 45 ms 2568 KB Output is correct
20 Correct 43 ms 2552 KB Output is correct
21 Correct 64 ms 2576 KB Output is correct
22 Correct 92 ms 2688 KB Output is correct
23 Correct 91 ms 2680 KB Output is correct
24 Correct 89 ms 2668 KB Output is correct
25 Correct 95 ms 2704 KB Output is correct
26 Correct 95 ms 2676 KB Output is correct
27 Correct 94 ms 2684 KB Output is correct
28 Correct 90 ms 2768 KB Output is correct
29 Correct 137 ms 2740 KB Output is correct
30 Correct 183 ms 2864 KB Output is correct
31 Correct 172 ms 2932 KB Output is correct
32 Correct 178 ms 2832 KB Output is correct
33 Correct 174 ms 2896 KB Output is correct
34 Correct 182 ms 2832 KB Output is correct
35 Correct 187 ms 2832 KB Output is correct
36 Correct 168 ms 2880 KB Output is correct
37 Correct 256 ms 3188 KB Output is correct
38 Correct 303 ms 3208 KB Output is correct
39 Correct 293 ms 3200 KB Output is correct
40 Correct 323 ms 3188 KB Output is correct
41 Correct 287 ms 3204 KB Output is correct
42 Correct 324 ms 3248 KB Output is correct
43 Correct 291 ms 3172 KB Output is correct
44 Correct 328 ms 3252 KB Output is correct
45 Correct 401 ms 3280 KB Output is correct
46 Correct 449 ms 3496 KB Output is correct
47 Correct 473 ms 3380 KB Output is correct
48 Correct 490 ms 3444 KB Output is correct
49 Correct 440 ms 3496 KB Output is correct
50 Correct 448 ms 3448 KB Output is correct
51 Correct 472 ms 3608 KB Output is correct
52 Correct 435 ms 3376 KB Output is correct
53 Correct 453 ms 3700 KB Output is correct
54 Correct 450 ms 3568 KB Output is correct
55 Correct 460 ms 3476 KB Output is correct
56 Correct 457 ms 3640 KB Output is correct
57 Correct 578 ms 3972 KB Output is correct
58 Correct 641 ms 4120 KB Output is correct
59 Correct 676 ms 4108 KB Output is correct
60 Correct 674 ms 4136 KB Output is correct
61 Correct 697 ms 4196 KB Output is correct
62 Correct 668 ms 4168 KB Output is correct
63 Correct 687 ms 4144 KB Output is correct
64 Correct 720 ms 4112 KB Output is correct
65 Correct 711 ms 4124 KB Output is correct
66 Correct 690 ms 4052 KB Output is correct
67 Correct 686 ms 4164 KB Output is correct
68 Correct 676 ms 4080 KB Output is correct
69 Correct 860 ms 4308 KB Output is correct
70 Correct 957 ms 4356 KB Output is correct
71 Correct 941 ms 4180 KB Output is correct
72 Correct 968 ms 4168 KB Output is correct
73 Correct 1002 ms 4168 KB Output is correct
74 Correct 1008 ms 4252 KB Output is correct
75 Correct 1024 ms 4248 KB Output is correct
76 Correct 917 ms 4364 KB Output is correct
77 Correct 1012 ms 4376 KB Output is correct
78 Correct 1310 ms 4716 KB Output is correct
79 Correct 1295 ms 4680 KB Output is correct
80 Correct 1317 ms 4552 KB Output is correct
81 Correct 1408 ms 4704 KB Output is correct
82 Correct 1377 ms 4592 KB Output is correct
83 Correct 1442 ms 4572 KB Output is correct
84 Correct 1411 ms 4592 KB Output is correct