Submission #396431

# Submission time Handle Problem Language Result Execution time Memory
396431 2021-04-30T00:28:06 Z arnold518 IOI Fever (JOI21_fever) C++17
100 / 100
869 ms 42184 KB
#pragma GCC optimize ("O3")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 1e6;
const int INF = 2147483647;

struct Point
{
	int x, y, p;
};

int N;
Point A[MAXN+10];

struct Queue
{
	int u, d; int w;
	bool operator < (const Queue &p) const
	{
		return w>p.w;
	}
};

int dist[MAXN+10];

int d(int u, int v)
{
	return (abs(A[u].x-A[v].x)+abs(A[u].y-A[v].y));
}

int ans;

unordered_map<int, vector<int>> M1, M2, M3, M4;

bool cmpx(int p, int q)
{
	return A[p].x<A[q].x;
}

bool cmpy(int p, int q)
{
	return A[p].y<A[q].y;
}

int norm(int x)
{
	x%=N;
	if(x==0) x=N;
	return x;
}

int main()
{
	scanf("%d", &N);
	for(int i=1; i<=N; i++)
	{
		scanf("%d%d", &A[i].x, &A[i].y);
		A[i].x*=2; A[i].y*=2;
		A[i].p=i;
	}

	for(int i=1; i<=N; i++)
	{
		M1[A[i].x-A[i].y].push_back(i);
		M2[A[i].x+A[i].y].push_back(i);
		M3[A[i].x].push_back(i);
		M4[A[i].y].push_back(i);
	}

	for(auto &it : M1)
	{
		sort(it.second.begin(), it.second.end(), cmpx);
	}

	for(auto &it : M2)
	{
		sort(it.second.begin(), it.second.end(), cmpy);
	}

	for(auto &it : M3)
	{
		sort(it.second.begin(), it.second.end(), cmpy);
	}

	for(auto &it : M4)
	{
		sort(it.second.begin(), it.second.end(), cmpx);
	}

	priority_queue<Queue> PQ;
	for(int p=0; p<4; p++)
	{
		for(int i=1; i<=N*9; i++) dist[i]=INF;

		PQ.push({1, p, 0});
		while(!PQ.empty())
		{
			Queue now=PQ.top(); PQ.pop();
			if(dist[now.u]<=now.w) continue;
			dist[now.u]=now.w;
			//printf("%d %d : %d\n", now.u, now.d, now.w);

			int u=norm(now.u);
			auto &V1=M1[A[u].x-A[u].y];
			auto &V2=M2[A[u].x+A[u].y];
			auto &V3=M3[A[u].x];
			auto &V4=M4[A[u].y];

			if(now.u<=N)
			{
				if(now.d==0)
				{
					{
						A[0].x=A[now.u].x+now.w/2;
						auto it=upper_bound(V1.begin(), V1.end(), 0, cmpx);
						if(it!=V1.end())
						{
							PQ.push({*it+N*1, 3, d(now.u, *it)});
						}
					}
					{
						A[0].y=A[now.u].y+now.w/2;
						auto it=upper_bound(V2.begin(), V2.end(), 0, cmpy);
						if(it!=V2.end())
						{
							PQ.push({*it+N*2, 1, d(now.u, *it)});
						}
					}
					{
						A[0].y=A[now.u].y+now.w;
						auto it=upper_bound(V3.begin(), V3.end(), 0, cmpy);
						if(it!=V3.end())
						{
							PQ.push({*it+N*3, 2, d(now.u, *it)});
						}
					}
				}
				if(now.d==3)
				{
					{
						A[0].y=A[now.u].y+now.w/2;
						auto it=upper_bound(V2.begin(), V2.end(), 0, cmpy);
						if(it!=V2.end())
						{
							PQ.push({*it+N*2, 2, d(now.u, *it)});
						}
					}
					{
						A[0].x=A[now.u].x-now.w/2;
						auto it=lower_bound(V1.begin(), V1.end(), 0, cmpx);
						if(it!=V1.begin())
						{
							it--;
							PQ.push({*it+N*5, 0, d(now.u, *it)});
						}
					}
					{
						A[0].x=A[now.u].x-now.w;
						auto it=lower_bound(V4.begin(), V4.end(), 0, cmpx);
						if(it!=V4.begin())
						{
							it--;
							PQ.push({*it+N*8, 1, d(now.u, *it)});
						}
					}
				}
				if(now.d==2)
				{
					{
						A[0].x=A[now.u].x-now.w/2;
						auto it=lower_bound(V1.begin(), V1.end(), 0, cmpx);
						if(it!=V1.begin())
						{
							it--;
							PQ.push({*it+N*5, 1, d(now.u, *it)});
						}
					}
					{
						A[0].y=A[now.u].y-now.w/2;
						auto it=lower_bound(V2.begin(), V2.end(), 0, cmpy);
						if(it!=V2.begin())
						{
							it--;
							PQ.push({*it+N*6, 3, d(now.u, *it)});
						}
					}
					{
						A[0].y=A[now.u].y-now.w;
						auto it=lower_bound(V3.begin(), V3.end(), 0, cmpy);
						if(it!=V3.begin())
						{
							it--;
							PQ.push({*it+N*7, 0, d(now.u, *it)});
						}
					}
				}
				if(now.d==1)
				{
					{
						A[0].y=A[now.u].y-now.w/2;
						auto it=lower_bound(V2.begin(), V2.end(), 0, cmpy);
						if(it!=V2.begin())
						{
							it--;
							PQ.push({*it+N*6, 0, d(now.u, *it)});
						}
					}
					{
						A[0].x=A[now.u].x+now.w/2;
						auto it=upper_bound(V1.begin(), V1.end(), 0, cmpx);
						if(it!=V1.end())
						{
							PQ.push({*it+N*1, 2, d(now.u, *it)});
						}
					}
					{
						A[0].x=A[now.u].x+now.w;
						auto it=upper_bound(V4.begin(), V4.end(), 0, cmpx);
						if(it!=V4.end())
						{
							PQ.push({*it+N*4, 3, d(now.u, *it)});
						}
					}
				}
			}
			else if(now.u<=N*2)
			{

				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V1.begin(), V1.end(), u, cmpx);
				it++;
				if(it!=V1.end())
				{
					PQ.push({*it+N, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*3)
			{
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V2.begin(), V2.end(), u, cmpy);
				it++;
				if(it!=V2.end())
				{
					PQ.push({*it+N*2, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*4)
			{
				//printf("%d %d %d\n", u, now.d, now.w);
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V3.begin(), V3.end(), u, cmpy);
				it++;
				if(it!=V3.end())
				{
					PQ.push({*it+N*3, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*5)
			{
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V4.begin(), V4.end(), u, cmpx);
				it++;
				if(it!=V4.end())
				{
					PQ.push({*it+N*4, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*6)
			{
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V1.begin(), V1.end(), u, cmpx);
				if(it!=V1.begin())
				{
					it--;
					PQ.push({*it+N*5, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*7)
			{
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V2.begin(), V2.end(), u, cmpy);
				if(it!=V2.begin())
				{
					it--;
					PQ.push({*it+N*6, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*8)
			{
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V3.begin(), V3.end(), u, cmpy);
				if(it!=V3.begin())
				{
					it--;
					PQ.push({*it+N*7, now.d, now.w+d(u, *it)});
				}
			}
			else if(now.u<=N*9)
			{
				PQ.push({u, now.d, now.w});
				auto it=lower_bound(V4.begin(), V4.end(), u, cmpx);
				if(it!=V4.begin())
				{
					it--;
					PQ.push({*it+N*8, now.d, now.w+d(u, *it)});
				}
			}
		}
		int cnt=0;
		for(int i=1; i<=N; i++)
		{
			if(dist[i]!=INF) cnt++;
			//printf("%d ", dist[i]);
		}
		//printf("%d\n", cnt);
		ans=max(ans, cnt);
	}

	printf("%d\n", ans);
}

Compilation message

fever.cpp: In function 'int main()':
fever.cpp:62:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   62 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
fever.cpp:65:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   65 |   scanf("%d%d", &A[i].x, &A[i].y);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 308 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 208 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 308 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 208 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 308 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 208 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 4 ms 1356 KB Output is correct
67 Correct 4 ms 1348 KB Output is correct
68 Correct 5 ms 1484 KB Output is correct
69 Correct 15 ms 664 KB Output is correct
70 Correct 5 ms 716 KB Output is correct
71 Correct 3 ms 716 KB Output is correct
72 Correct 4 ms 1228 KB Output is correct
73 Correct 5 ms 1484 KB Output is correct
74 Correct 5 ms 1228 KB Output is correct
75 Correct 8 ms 1228 KB Output is correct
76 Correct 5 ms 1356 KB Output is correct
77 Correct 4 ms 1228 KB Output is correct
78 Correct 5 ms 1356 KB Output is correct
79 Correct 5 ms 1356 KB Output is correct
80 Correct 5 ms 1472 KB Output is correct
81 Correct 5 ms 1348 KB Output is correct
82 Correct 6 ms 1220 KB Output is correct
83 Correct 7 ms 1232 KB Output is correct
84 Correct 3 ms 880 KB Output is correct
85 Correct 2 ms 588 KB Output is correct
86 Correct 3 ms 588 KB Output is correct
87 Correct 3 ms 716 KB Output is correct
88 Correct 5 ms 1392 KB Output is correct
89 Correct 5 ms 1232 KB Output is correct
90 Correct 5 ms 1228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 308 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 208 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 175 ms 29728 KB Output is correct
67 Correct 229 ms 37204 KB Output is correct
68 Correct 273 ms 42088 KB Output is correct
69 Correct 234 ms 33060 KB Output is correct
70 Correct 475 ms 33876 KB Output is correct
71 Correct 287 ms 42184 KB Output is correct
72 Correct 291 ms 41440 KB Output is correct
73 Correct 295 ms 33940 KB Output is correct
74 Correct 292 ms 42184 KB Output is correct
75 Correct 284 ms 41556 KB Output is correct
76 Correct 363 ms 33988 KB Output is correct
77 Correct 280 ms 42164 KB Output is correct
78 Correct 319 ms 33564 KB Output is correct
79 Correct 326 ms 33340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 308 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 208 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 4 ms 1356 KB Output is correct
67 Correct 4 ms 1348 KB Output is correct
68 Correct 5 ms 1484 KB Output is correct
69 Correct 15 ms 664 KB Output is correct
70 Correct 5 ms 716 KB Output is correct
71 Correct 3 ms 716 KB Output is correct
72 Correct 4 ms 1228 KB Output is correct
73 Correct 5 ms 1484 KB Output is correct
74 Correct 5 ms 1228 KB Output is correct
75 Correct 8 ms 1228 KB Output is correct
76 Correct 5 ms 1356 KB Output is correct
77 Correct 4 ms 1228 KB Output is correct
78 Correct 5 ms 1356 KB Output is correct
79 Correct 5 ms 1356 KB Output is correct
80 Correct 5 ms 1472 KB Output is correct
81 Correct 5 ms 1348 KB Output is correct
82 Correct 6 ms 1220 KB Output is correct
83 Correct 7 ms 1232 KB Output is correct
84 Correct 3 ms 880 KB Output is correct
85 Correct 2 ms 588 KB Output is correct
86 Correct 3 ms 588 KB Output is correct
87 Correct 3 ms 716 KB Output is correct
88 Correct 5 ms 1392 KB Output is correct
89 Correct 5 ms 1232 KB Output is correct
90 Correct 5 ms 1228 KB Output is correct
91 Correct 175 ms 29728 KB Output is correct
92 Correct 229 ms 37204 KB Output is correct
93 Correct 273 ms 42088 KB Output is correct
94 Correct 234 ms 33060 KB Output is correct
95 Correct 475 ms 33876 KB Output is correct
96 Correct 287 ms 42184 KB Output is correct
97 Correct 291 ms 41440 KB Output is correct
98 Correct 295 ms 33940 KB Output is correct
99 Correct 292 ms 42184 KB Output is correct
100 Correct 284 ms 41556 KB Output is correct
101 Correct 363 ms 33988 KB Output is correct
102 Correct 280 ms 42164 KB Output is correct
103 Correct 319 ms 33564 KB Output is correct
104 Correct 326 ms 33340 KB Output is correct
105 Correct 402 ms 7336 KB Output is correct
106 Correct 476 ms 8580 KB Output is correct
107 Correct 869 ms 9412 KB Output is correct
108 Correct 544 ms 9660 KB Output is correct
109 Correct 97 ms 13316 KB Output is correct
110 Correct 251 ms 31544 KB Output is correct
111 Correct 298 ms 42176 KB Output is correct
112 Correct 281 ms 39244 KB Output is correct
113 Correct 291 ms 39088 KB Output is correct
114 Correct 556 ms 19848 KB Output is correct
115 Correct 329 ms 33868 KB Output is correct
116 Correct 277 ms 39064 KB Output is correct
117 Correct 303 ms 38624 KB Output is correct
118 Correct 573 ms 29604 KB Output is correct
119 Correct 405 ms 34020 KB Output is correct
120 Correct 293 ms 39112 KB Output is correct
121 Correct 315 ms 40500 KB Output is correct
122 Correct 355 ms 39476 KB Output is correct
123 Correct 342 ms 33208 KB Output is correct
124 Correct 364 ms 33796 KB Output is correct
125 Correct 83 ms 19812 KB Output is correct
126 Correct 52 ms 10676 KB Output is correct
127 Correct 73 ms 9496 KB Output is correct
128 Correct 61 ms 10308 KB Output is correct
129 Correct 66 ms 13508 KB Output is correct