Submission #1085513

# Submission time Handle Problem Language Result Execution time Memory
1085513 2024-09-08T11:09:52 Z I_am_Polish_Girl Maze (JOI23_ho_t3) C++14
51 / 100
2000 ms 205332 KB
#pragma target("arch=icelake-server")

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack> 
#include <queue>
#include <cmath>
#include <random>
#include <chrono>
#include <iomanip>
#include <bitset>

using namespace std;

#define int long long

typedef long long ll;
typedef long double ld;

int log_ = 21;
int inf = 4000000007000000007;

long long mod = 998244353;

int p = 499;

int NADIYA = 39;

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n, m, k;
	cin >> n >> m >> k;

	int i_st, j_st;
	cin >> i_st >> j_st;

	i_st--;
	j_st--;

	int i_f, j_f;
	cin >> i_f >> j_f;

	i_f--;
	j_f--;


	vector <vector <int>> deep(n);
	vector <vector <int>> t(n);

	for (int i = 0; i < n; i++)
	{
		deep[i].resize(m , inf);
		t[i].resize(m, false);
	}

	vector <string> vs(n);
	for (int i = 0; i < n; i++)
		cin >> vs[i];
	

	vector <vector < pair <int, int>>> q(n*m+2);

	q[0].push_back({i_st , j_st});
	deep[i_st][j_st] = 0;

	vector <pair <int, int>> go;

	go.push_back({ 1 , 0 });
	go.push_back({ -1 , 0 });
	go.push_back({ 0 , 1 });
	go.push_back({ 0 , -1 });


	vector <pair <int, int>> go2;

	for (int i = -n; i <= n; i++)
	{
		for (int j = -n; j <= n; j++)
		{
			go2.push_back({ i , j });
		}
	}
	


	for (int d = 0 ; d < n*m+1  ; d++)
	{
		if (q[d].size() == 0)
			break;

		for (int ind = 0; ind < q[d].size(); ind++)
		{
			int i_ = q[d][ind].first;
			int j_ = q[d][ind].second;


			for (int i = 0; i < 4; i++)
			{
				int i__ = i_ + go[i].first;
				int j__ = j_ + go[i].second;

				if ((i__ >= 0) and (i__ < n))
				{
					if ((j__ >= 0) and (j__ < m))
					{
						if (deep[i__][j__] > d)
						{
							if (vs[i__][j__] == '.')
							{
								deep[i__][j__] = d;
								q[d].push_back({i__ , j__});
							}
						}
					}
				}
			}
		}

		for (int ind = 0; ind < q[d].size(); ind++)
		{
			int i_ = q[d][ind].first;
			int j_ = q[d][ind].second;

			for (int i = -k; i <= k; i++)
			{
				for (int j = -k; j <= k; j += 2 * k)
				{
					if (abs(i) + abs(j) == 2 * k)
						continue;

					int i__ = i_ + i;
					int j__ = j_ + j;

					if ((i__ >= 0) and (i__ < n))
					{
						if ((j__ >= 0) and (j__ < m))
						{
							if (deep[i__][j__] == inf)
							{
								deep[i__][j__] = d + 1;
								q[d+1].push_back({i__ , j__});
							}
						}
					}
				}
			}


			for (int i = -k ; i <= k ; i += 2*k)
			{
				for (int j = -k; j <= k; j ++)
				{
					if (abs(i) + abs(j) == 2 * k)
						continue;

					int i__ = i_ + i;
					int j__ = j_ + j;

					if ((i__ >= 0) and (i__ < n))
					{
						if ((j__ >= 0) and (j__ < m))
						{
							if (deep[i__][j__] == inf)
							{
								deep[i__][j__] = d + 1;
								q[d + 1].push_back({ i__ , j__ });
							}
						}
					}
				}
			}
		}	
	}


	//cout << deep[i_f][j_f] << "\n";

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			if (abs(i - i_f) <= k)
			{
				if (abs(j - j_f) <= k)
				{
					if ((abs(i - i_f) + abs(j - j_f)) != 2 * k)
					{
						deep[i_f][j_f] = min(deep[i_f][j_f], deep[i][j] + 1);
					}
				}
			}
		}
	}

	cout << deep[i_f][j_f];
}

/*5
1 2 1
2 3 1
2 4 1
1 5 4
*/

Compilation message

Main.cpp:1: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
    1 | #pragma target("arch=icelake-server")
      | 
Main.cpp: In function 'int main()':
Main.cpp:100:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  100 |   for (int ind = 0; ind < q[d].size(); ind++)
      |                     ~~~~^~~~~~~~~~~~~
Main.cpp:128:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  128 |   for (int ind = 0; ind < q[d].size(); ind++)
      |                     ~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 1 ms 604 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 604 KB Output is correct
17 Correct 0 ms 604 KB Output is correct
18 Correct 1 ms 452 KB Output is correct
19 Correct 9 ms 7880 KB Output is correct
20 Correct 4 ms 3676 KB Output is correct
21 Correct 9 ms 8648 KB Output is correct
22 Correct 9 ms 7624 KB Output is correct
23 Correct 9 ms 8132 KB Output is correct
24 Correct 4 ms 4188 KB Output is correct
25 Correct 5 ms 4536 KB Output is correct
26 Correct 10 ms 7620 KB Output is correct
27 Correct 10 ms 7624 KB Output is correct
28 Correct 10 ms 7880 KB Output is correct
29 Correct 30 ms 22984 KB Output is correct
30 Correct 7 ms 4184 KB Output is correct
31 Correct 25 ms 22968 KB Output is correct
32 Correct 27 ms 23044 KB Output is correct
33 Correct 23 ms 23236 KB Output is correct
34 Correct 9 ms 9960 KB Output is correct
35 Correct 15 ms 10980 KB Output is correct
36 Correct 27 ms 23212 KB Output is correct
37 Correct 30 ms 23240 KB Output is correct
38 Correct 25 ms 23240 KB Output is correct
39 Correct 255 ms 193752 KB Output is correct
40 Correct 15 ms 11356 KB Output is correct
41 Correct 13 ms 12144 KB Output is correct
42 Correct 22 ms 16320 KB Output is correct
43 Correct 27 ms 15892 KB Output is correct
44 Correct 62 ms 47716 KB Output is correct
45 Correct 82 ms 51600 KB Output is correct
46 Correct 251 ms 205228 KB Output is correct
47 Correct 270 ms 193532 KB Output is correct
48 Correct 257 ms 193588 KB Output is correct
49 Correct 97 ms 95988 KB Output is correct
50 Correct 132 ms 105840 KB Output is correct
51 Correct 265 ms 193584 KB Output is correct
52 Correct 272 ms 193580 KB Output is correct
53 Correct 259 ms 193584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 460 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 600 KB Output is correct
11 Correct 0 ms 604 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 604 KB Output is correct
14 Correct 0 ms 456 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 460 KB Output is correct
22 Correct 1 ms 452 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 456 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 440 KB Output is correct
31 Correct 0 ms 604 KB Output is correct
32 Correct 0 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 460 KB Output is correct
5 Correct 0 ms 456 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 604 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 0 ms 452 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 396 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 604 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 388 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 5 ms 3032 KB Output is correct
26 Correct 9 ms 3924 KB Output is correct
27 Correct 8 ms 8488 KB Output is correct
28 Correct 173 ms 8540 KB Output is correct
29 Correct 6 ms 7112 KB Output is correct
30 Correct 7 ms 7368 KB Output is correct
31 Correct 47 ms 4100 KB Output is correct
32 Correct 13 ms 7620 KB Output is correct
33 Correct 10 ms 7600 KB Output is correct
34 Correct 117 ms 11460 KB Output is correct
35 Correct 23 ms 23240 KB Output is correct
36 Correct 654 ms 23020 KB Output is correct
37 Correct 19 ms 23236 KB Output is correct
38 Correct 17 ms 23172 KB Output is correct
39 Correct 262 ms 54080 KB Output is correct
40 Correct 1297 ms 81456 KB Output is correct
41 Correct 246 ms 205236 KB Output is correct
42 Execution timed out 2083 ms 205332 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 460 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 600 KB Output is correct
11 Correct 0 ms 604 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 604 KB Output is correct
14 Correct 0 ms 456 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 460 KB Output is correct
22 Correct 1 ms 452 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 456 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 440 KB Output is correct
31 Correct 0 ms 604 KB Output is correct
32 Correct 0 ms 604 KB Output is correct
33 Correct 10 ms 7880 KB Output is correct
34 Correct 1 ms 604 KB Output is correct
35 Correct 1 ms 852 KB Output is correct
36 Correct 4 ms 2944 KB Output is correct
37 Correct 4 ms 3676 KB Output is correct
38 Correct 8 ms 3904 KB Output is correct
39 Correct 9 ms 8648 KB Output is correct
40 Correct 10 ms 7624 KB Output is correct
41 Correct 8 ms 7880 KB Output is correct
42 Correct 163 ms 8648 KB Output is correct
43 Correct 6 ms 7012 KB Output is correct
44 Correct 6 ms 7028 KB Output is correct
45 Correct 4 ms 4184 KB Output is correct
46 Correct 6 ms 4636 KB Output is correct
47 Correct 6 ms 4184 KB Output is correct
48 Correct 15 ms 4184 KB Output is correct
49 Correct 24 ms 3932 KB Output is correct
50 Correct 31 ms 3920 KB Output is correct
51 Correct 49 ms 4168 KB Output is correct
52 Correct 11 ms 7620 KB Output is correct
53 Correct 9 ms 7624 KB Output is correct
54 Correct 10 ms 7808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 460 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 600 KB Output is correct
11 Correct 0 ms 604 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 604 KB Output is correct
14 Correct 0 ms 456 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 460 KB Output is correct
22 Correct 1 ms 452 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 456 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 440 KB Output is correct
31 Correct 0 ms 604 KB Output is correct
32 Correct 0 ms 604 KB Output is correct
33 Correct 10 ms 7880 KB Output is correct
34 Correct 1 ms 604 KB Output is correct
35 Correct 1 ms 852 KB Output is correct
36 Correct 4 ms 2944 KB Output is correct
37 Correct 4 ms 3676 KB Output is correct
38 Correct 8 ms 3904 KB Output is correct
39 Correct 9 ms 8648 KB Output is correct
40 Correct 10 ms 7624 KB Output is correct
41 Correct 8 ms 7880 KB Output is correct
42 Correct 163 ms 8648 KB Output is correct
43 Correct 6 ms 7012 KB Output is correct
44 Correct 6 ms 7028 KB Output is correct
45 Correct 4 ms 4184 KB Output is correct
46 Correct 6 ms 4636 KB Output is correct
47 Correct 6 ms 4184 KB Output is correct
48 Correct 15 ms 4184 KB Output is correct
49 Correct 24 ms 3932 KB Output is correct
50 Correct 31 ms 3920 KB Output is correct
51 Correct 49 ms 4168 KB Output is correct
52 Correct 11 ms 7620 KB Output is correct
53 Correct 9 ms 7624 KB Output is correct
54 Correct 10 ms 7808 KB Output is correct
55 Correct 24 ms 23236 KB Output is correct
56 Correct 6 ms 4188 KB Output is correct
57 Correct 117 ms 11460 KB Output is correct
58 Correct 16 ms 9308 KB Output is correct
59 Correct 34 ms 23084 KB Output is correct
60 Correct 26 ms 23240 KB Output is correct
61 Correct 26 ms 23236 KB Output is correct
62 Correct 654 ms 23024 KB Output is correct
63 Correct 17 ms 22984 KB Output is correct
64 Correct 16 ms 23240 KB Output is correct
65 Correct 9 ms 10024 KB Output is correct
66 Correct 14 ms 11204 KB Output is correct
67 Correct 15 ms 10072 KB Output is correct
68 Correct 53 ms 9532 KB Output is correct
69 Correct 69 ms 9296 KB Output is correct
70 Correct 101 ms 9292 KB Output is correct
71 Correct 153 ms 9424 KB Output is correct
72 Correct 29 ms 23240 KB Output is correct
73 Correct 28 ms 23236 KB Output is correct
74 Correct 24 ms 23156 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 1 ms 604 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 604 KB Output is correct
17 Correct 0 ms 604 KB Output is correct
18 Correct 1 ms 452 KB Output is correct
19 Correct 9 ms 7880 KB Output is correct
20 Correct 4 ms 3676 KB Output is correct
21 Correct 9 ms 8648 KB Output is correct
22 Correct 9 ms 7624 KB Output is correct
23 Correct 9 ms 8132 KB Output is correct
24 Correct 4 ms 4188 KB Output is correct
25 Correct 5 ms 4536 KB Output is correct
26 Correct 10 ms 7620 KB Output is correct
27 Correct 10 ms 7624 KB Output is correct
28 Correct 10 ms 7880 KB Output is correct
29 Correct 30 ms 22984 KB Output is correct
30 Correct 7 ms 4184 KB Output is correct
31 Correct 25 ms 22968 KB Output is correct
32 Correct 27 ms 23044 KB Output is correct
33 Correct 23 ms 23236 KB Output is correct
34 Correct 9 ms 9960 KB Output is correct
35 Correct 15 ms 10980 KB Output is correct
36 Correct 27 ms 23212 KB Output is correct
37 Correct 30 ms 23240 KB Output is correct
38 Correct 25 ms 23240 KB Output is correct
39 Correct 255 ms 193752 KB Output is correct
40 Correct 15 ms 11356 KB Output is correct
41 Correct 13 ms 12144 KB Output is correct
42 Correct 22 ms 16320 KB Output is correct
43 Correct 27 ms 15892 KB Output is correct
44 Correct 62 ms 47716 KB Output is correct
45 Correct 82 ms 51600 KB Output is correct
46 Correct 251 ms 205228 KB Output is correct
47 Correct 270 ms 193532 KB Output is correct
48 Correct 257 ms 193588 KB Output is correct
49 Correct 97 ms 95988 KB Output is correct
50 Correct 132 ms 105840 KB Output is correct
51 Correct 265 ms 193584 KB Output is correct
52 Correct 272 ms 193580 KB Output is correct
53 Correct 259 ms 193584 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 0 ms 604 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 1 ms 460 KB Output is correct
62 Correct 1 ms 600 KB Output is correct
63 Correct 1 ms 600 KB Output is correct
64 Correct 0 ms 604 KB Output is correct
65 Correct 1 ms 604 KB Output is correct
66 Correct 1 ms 604 KB Output is correct
67 Correct 0 ms 456 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 460 KB Output is correct
75 Correct 1 ms 452 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 456 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 440 KB Output is correct
84 Correct 0 ms 604 KB Output is correct
85 Correct 0 ms 604 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 348 KB Output is correct
89 Correct 0 ms 460 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 604 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 604 KB Output is correct
95 Correct 0 ms 452 KB Output is correct
96 Correct 1 ms 600 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 1 ms 396 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 604 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 344 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 1 ms 604 KB Output is correct
108 Correct 1 ms 388 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 5 ms 3032 KB Output is correct
111 Correct 9 ms 3924 KB Output is correct
112 Correct 8 ms 8488 KB Output is correct
113 Correct 173 ms 8540 KB Output is correct
114 Correct 6 ms 7112 KB Output is correct
115 Correct 7 ms 7368 KB Output is correct
116 Correct 47 ms 4100 KB Output is correct
117 Correct 13 ms 7620 KB Output is correct
118 Correct 10 ms 7600 KB Output is correct
119 Correct 117 ms 11460 KB Output is correct
120 Correct 23 ms 23240 KB Output is correct
121 Correct 654 ms 23020 KB Output is correct
122 Correct 19 ms 23236 KB Output is correct
123 Correct 17 ms 23172 KB Output is correct
124 Correct 262 ms 54080 KB Output is correct
125 Correct 1297 ms 81456 KB Output is correct
126 Correct 246 ms 205236 KB Output is correct
127 Execution timed out 2083 ms 205332 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 1 ms 604 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 604 KB Output is correct
17 Correct 0 ms 604 KB Output is correct
18 Correct 1 ms 452 KB Output is correct
19 Correct 9 ms 7880 KB Output is correct
20 Correct 4 ms 3676 KB Output is correct
21 Correct 9 ms 8648 KB Output is correct
22 Correct 9 ms 7624 KB Output is correct
23 Correct 9 ms 8132 KB Output is correct
24 Correct 4 ms 4188 KB Output is correct
25 Correct 5 ms 4536 KB Output is correct
26 Correct 10 ms 7620 KB Output is correct
27 Correct 10 ms 7624 KB Output is correct
28 Correct 10 ms 7880 KB Output is correct
29 Correct 30 ms 22984 KB Output is correct
30 Correct 7 ms 4184 KB Output is correct
31 Correct 25 ms 22968 KB Output is correct
32 Correct 27 ms 23044 KB Output is correct
33 Correct 23 ms 23236 KB Output is correct
34 Correct 9 ms 9960 KB Output is correct
35 Correct 15 ms 10980 KB Output is correct
36 Correct 27 ms 23212 KB Output is correct
37 Correct 30 ms 23240 KB Output is correct
38 Correct 25 ms 23240 KB Output is correct
39 Correct 255 ms 193752 KB Output is correct
40 Correct 15 ms 11356 KB Output is correct
41 Correct 13 ms 12144 KB Output is correct
42 Correct 22 ms 16320 KB Output is correct
43 Correct 27 ms 15892 KB Output is correct
44 Correct 62 ms 47716 KB Output is correct
45 Correct 82 ms 51600 KB Output is correct
46 Correct 251 ms 205228 KB Output is correct
47 Correct 270 ms 193532 KB Output is correct
48 Correct 257 ms 193588 KB Output is correct
49 Correct 97 ms 95988 KB Output is correct
50 Correct 132 ms 105840 KB Output is correct
51 Correct 265 ms 193584 KB Output is correct
52 Correct 272 ms 193580 KB Output is correct
53 Correct 259 ms 193584 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 0 ms 604 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 1 ms 460 KB Output is correct
62 Correct 1 ms 600 KB Output is correct
63 Correct 1 ms 600 KB Output is correct
64 Correct 0 ms 604 KB Output is correct
65 Correct 1 ms 604 KB Output is correct
66 Correct 1 ms 604 KB Output is correct
67 Correct 0 ms 456 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 460 KB Output is correct
75 Correct 1 ms 452 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 456 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 440 KB Output is correct
84 Correct 0 ms 604 KB Output is correct
85 Correct 0 ms 604 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 348 KB Output is correct
89 Correct 0 ms 460 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 604 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 604 KB Output is correct
95 Correct 0 ms 452 KB Output is correct
96 Correct 1 ms 600 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 1 ms 396 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 604 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 344 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 1 ms 604 KB Output is correct
108 Correct 1 ms 388 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 5 ms 3032 KB Output is correct
111 Correct 9 ms 3924 KB Output is correct
112 Correct 8 ms 8488 KB Output is correct
113 Correct 173 ms 8540 KB Output is correct
114 Correct 6 ms 7112 KB Output is correct
115 Correct 7 ms 7368 KB Output is correct
116 Correct 47 ms 4100 KB Output is correct
117 Correct 13 ms 7620 KB Output is correct
118 Correct 10 ms 7600 KB Output is correct
119 Correct 117 ms 11460 KB Output is correct
120 Correct 23 ms 23240 KB Output is correct
121 Correct 654 ms 23020 KB Output is correct
122 Correct 19 ms 23236 KB Output is correct
123 Correct 17 ms 23172 KB Output is correct
124 Correct 262 ms 54080 KB Output is correct
125 Correct 1297 ms 81456 KB Output is correct
126 Correct 246 ms 205236 KB Output is correct
127 Execution timed out 2083 ms 205332 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 1 ms 604 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 604 KB Output is correct
17 Correct 0 ms 604 KB Output is correct
18 Correct 1 ms 452 KB Output is correct
19 Correct 9 ms 7880 KB Output is correct
20 Correct 4 ms 3676 KB Output is correct
21 Correct 9 ms 8648 KB Output is correct
22 Correct 9 ms 7624 KB Output is correct
23 Correct 9 ms 8132 KB Output is correct
24 Correct 4 ms 4188 KB Output is correct
25 Correct 5 ms 4536 KB Output is correct
26 Correct 10 ms 7620 KB Output is correct
27 Correct 10 ms 7624 KB Output is correct
28 Correct 10 ms 7880 KB Output is correct
29 Correct 30 ms 22984 KB Output is correct
30 Correct 7 ms 4184 KB Output is correct
31 Correct 25 ms 22968 KB Output is correct
32 Correct 27 ms 23044 KB Output is correct
33 Correct 23 ms 23236 KB Output is correct
34 Correct 9 ms 9960 KB Output is correct
35 Correct 15 ms 10980 KB Output is correct
36 Correct 27 ms 23212 KB Output is correct
37 Correct 30 ms 23240 KB Output is correct
38 Correct 25 ms 23240 KB Output is correct
39 Correct 255 ms 193752 KB Output is correct
40 Correct 15 ms 11356 KB Output is correct
41 Correct 13 ms 12144 KB Output is correct
42 Correct 22 ms 16320 KB Output is correct
43 Correct 27 ms 15892 KB Output is correct
44 Correct 62 ms 47716 KB Output is correct
45 Correct 82 ms 51600 KB Output is correct
46 Correct 251 ms 205228 KB Output is correct
47 Correct 270 ms 193532 KB Output is correct
48 Correct 257 ms 193588 KB Output is correct
49 Correct 97 ms 95988 KB Output is correct
50 Correct 132 ms 105840 KB Output is correct
51 Correct 265 ms 193584 KB Output is correct
52 Correct 272 ms 193580 KB Output is correct
53 Correct 259 ms 193584 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 0 ms 604 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 1 ms 460 KB Output is correct
62 Correct 1 ms 600 KB Output is correct
63 Correct 1 ms 600 KB Output is correct
64 Correct 0 ms 604 KB Output is correct
65 Correct 1 ms 604 KB Output is correct
66 Correct 1 ms 604 KB Output is correct
67 Correct 0 ms 456 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 460 KB Output is correct
75 Correct 1 ms 452 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 1 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 456 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 440 KB Output is correct
84 Correct 0 ms 604 KB Output is correct
85 Correct 0 ms 604 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 348 KB Output is correct
89 Correct 0 ms 460 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 604 KB Output is correct
93 Correct 1 ms 604 KB Output is correct
94 Correct 1 ms 604 KB Output is correct
95 Correct 0 ms 452 KB Output is correct
96 Correct 1 ms 600 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 1 ms 396 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 604 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 348 KB Output is correct
105 Correct 1 ms 344 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 1 ms 604 KB Output is correct
108 Correct 1 ms 388 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 5 ms 3032 KB Output is correct
111 Correct 9 ms 3924 KB Output is correct
112 Correct 8 ms 8488 KB Output is correct
113 Correct 173 ms 8540 KB Output is correct
114 Correct 6 ms 7112 KB Output is correct
115 Correct 7 ms 7368 KB Output is correct
116 Correct 47 ms 4100 KB Output is correct
117 Correct 13 ms 7620 KB Output is correct
118 Correct 10 ms 7600 KB Output is correct
119 Correct 117 ms 11460 KB Output is correct
120 Correct 23 ms 23240 KB Output is correct
121 Correct 654 ms 23020 KB Output is correct
122 Correct 19 ms 23236 KB Output is correct
123 Correct 17 ms 23172 KB Output is correct
124 Correct 262 ms 54080 KB Output is correct
125 Correct 1297 ms 81456 KB Output is correct
126 Correct 246 ms 205236 KB Output is correct
127 Execution timed out 2083 ms 205332 KB Time limit exceeded
128 Halted 0 ms 0 KB -