답안 #283653

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
283653 2020-08-26T04:35:44 Z arnold518 Iqea (innopolis2018_final_C) C++14
51 / 100
2000 ms 95320 KB
#include <bits/stdc++.h>
using namespace std;

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

const int MAXN = 1e5;
const int INF = 5e7;

int N;
pii A[MAXN+10];
vector<int> X[MAXN+10], Y[MAXN+10];

struct Line
{
	int l, r, p;
	Line(int l, int r, int p) : l(l), r(r), p(p) {}
	bool operator < (const Line &q) const { return r<q.r; }
};
int Q;
vector<Line> LX[MAXN+10], LY[MAXN+10];
vector<int> adjX[MAXN+10], adjY[MAXN+10];

pii get(int y, int x)
{
	int nx=lower_bound(LX[y].begin(), LX[y].end(), Line(0, x, 0))->p;
	int ny=lower_bound(LY[x].begin(), LY[x].end(), Line(0, y, 0))->p;
	return {nx, ny};
}

pii P[MAXN+10];

struct Tree
{
	int M;
	//vector<vector<int>> adj, cdist;
	//vector<int> sz, del, cpar, cdep;
	int sz[MAXN+10], del[MAXN+10], cpar[MAXN+10], cdist[MAXN+10][30], cdep[MAXN+10];
	vector<int> adj[MAXN+10];

	Tree()
	{
		M=0;
		memset(sz, 0, sizeof(sz));
		memset(del, 0, sizeof(del));
		memset(cpar, 0, sizeof(cpar));
		memset(cdist, 0, sizeof(cdist));
		memset(cdep, 0, sizeof(cdep));
		//sz=del=cpar=cdep=vector<int>(MAXN+10);
		//cdist.resize(MAXN+10);
		//for(auto &it : cdist) it.resize(30);
		//adj.resize(MAXN+10);
	}

	void getsz(int now, int bef)
	{
		sz[now]=1;
		for(int nxt : adj[now])
		{
			if(nxt==bef) continue;
			if(del[nxt]) continue;
			getsz(nxt, now);
			sz[now]+=sz[nxt];
		}
	}

	int getcen(int now, int bef, int S)
	{
		for(int nxt : adj[now])
		{
			if(nxt==bef) continue;
			if(del[nxt]) continue;
			if(sz[nxt]>S/2) return getcen(nxt, now, S);
		}
		return now;
	}

	void dfs(int now, int bef, int t, int dist)
	{
		cdist[now][t]=dist;
		for(int nxt : adj[now])
		{
			if(nxt==bef) continue;
			if(del[nxt]) continue;
			dfs(nxt, now, t, dist+1);
		}
	}

	void decomp(int now, int bef, int cendep)
	{
		getsz(now, now);
		now=getcen(now, now, sz[now]);
		cpar[now]=bef;
		cdep[now]=cendep;

		dfs(now, now, cendep, 0);
		del[now]=true;

		for(auto nxt : adj[now])
		{
			if(del[nxt]) continue;
			decomp(nxt, now, cendep+1);
		}
	}

	void init()
	{
		decomp(1, 0, 1);
		for(int i=1; i<=M; i++) if(!del[i]) while(1);
	}

	vector<int> getpar(int now)
	{
		vector<int> ans;
		while(now)
		{
			ans.push_back(now);
			now=cpar[now];
		}
		return ans;
	}
}TX, TY;

unordered_map<ll, int> M;

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

	for(int i=1; i<=MAXN; i++)
	{
		if(X[i].empty()) continue;
		sort(X[i].begin(), X[i].end());

		int bef=X[i][0];
		for(int j=0; j+1<X[i].size(); j++)
		{
			if(X[i][j]+1<X[i][j+1])
			{
				LX[i].push_back({bef, X[i][j], ++TX.M});
				//printf("LX %d %d %d %d\n", i, LX[i].back().l, LX[i].back().r, LX[i].back().p);
				bef=X[i][j+1];
			}
		}
		LX[i].push_back({bef, X[i].back(), ++TX.M});
		//printf("LX %d %d %d %d\n", i, LX[i].back().l, LX[i].back().r, LX[i].back().p);
	}

	int cnt=0;
	for(int i=2; i<=MAXN; i++)
	{
		int p=0;
		for(auto it : LX[i])
		{
			for(; p<LX[i-1].size() && LX[i-1][p].r<it.l; p++);
			for(; p<LX[i-1].size() && LX[i-1][p].l<=it.r; p++)
			{
				int u=LX[i-1][p].p, v=it.p;
				TX.adj[u].push_back(v);
				TX.adj[v].push_back(u);
				cnt++;
				//printf("adjX %d %d\n", u, v);
			}
			if(p) p--;
		}
	}
	if(cnt!=TX.M-1) while(1);

	for(int i=1; i<=MAXN; i++)
	{
		if(Y[i].empty()) continue;
		sort(Y[i].begin(), Y[i].end());

		int bef=Y[i][0];
		for(int j=0; j+1<Y[i].size(); j++)
		{
			if(Y[i][j]+1!=Y[i][j+1])
			{
				LY[i].push_back({bef, Y[i][j], ++TY.M});
				//printf("LY %d %d %d %d\n", i, LY[i].back().l, LY[i].back().r, LY[i].back().p);
				bef=Y[i][j+1];
			}
		}
		LY[i].push_back({bef, Y[i].back(), ++TY.M});
		//printf("LY %d %d %d %d\n", i, LY[i].back().l, LY[i].back().r, LY[i].back().p);
	}

	cnt=0;
	for(int i=2; i<=MAXN; i++)
	{
		int p=0;
		for(auto it : LY[i])
		{
			for(; p<LY[i-1].size() && LY[i-1][p].r<it.l; p++);
			for(; p<LY[i-1].size() && LY[i-1][p].l<=it.r; p++)
			{
				int u=LY[i-1][p].p, v=it.p;
				TY.adj[u].push_back(v);
				TY.adj[v].push_back(u);
				cnt++;
				//printf("adjY %d %d\n", u, v);
			}
			if(p) p--;
		}
	}
	if(cnt!=TY.M-1) while(1);

	TX.init(); TY.init();

	scanf("%d", &Q);
	bool flag=false;
	while(Q--)
	{
		int tt, y, x;
		scanf("%d%d%d", &tt, &y, &x);

		pii t=get(y, x);

		vector<int> V1=TX.getpar(t.first);
		vector<int> V2=TY.getpar(t.second);

		if(tt==1)
		{
			for(auto it : V1) for(auto jt : V2)
			{
				if(M.find(((ll)it<<20)|jt)==M.end()) M[((ll)it<<20)|jt]=INF;
				M[((ll)it<<20)|jt]=min(M[((ll)it<<20)|jt], TX.cdist[t.first][TX.cdep[it]]+TY.cdist[t.second][TY.cdep[jt]]);
			}
			flag=true;
		}
		else
		{
			if(!flag) { printf("-1\n"); continue; }
			int ans=INF;
			for(auto it : V1) for(auto jt : V2)
			{
				if(M.find(((ll)it<<20)|jt)==M.end()) continue;
				ans=min(ans, TX.cdist[t.first][TX.cdep[it]]+TY.cdist[t.second][TY.cdep[jt]]+M[((ll)it<<20)|jt]);
			}
			if(ans==INF) ans=-1;
			//if(ans!=-1) assert(flag);
			printf("%d\n", ans);
		}
	}
}

Compilation message

C.cpp: In function 'int main()':
C.cpp:145:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  145 |   for(int j=0; j+1<X[i].size(); j++)
      |                ~~~^~~~~~~~~~~~
C.cpp:164:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Line>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  164 |    for(; p<LX[i-1].size() && LX[i-1][p].r<it.l; p++);
      |          ~^~~~~~~~~~~~~~~
C.cpp:165:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Line>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  165 |    for(; p<LX[i-1].size() && LX[i-1][p].l<=it.r; p++)
      |          ~^~~~~~~~~~~~~~~
C.cpp:184:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  184 |   for(int j=0; j+1<Y[i].size(); j++)
      |                ~~~^~~~~~~~~~~~
C.cpp:203:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Line>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  203 |    for(; p<LY[i-1].size() && LY[i-1][p].r<it.l; p++);
      |          ~^~~~~~~~~~~~~~~
C.cpp:204:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Line>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  204 |    for(; p<LY[i-1].size() && LY[i-1][p].l<=it.r; p++)
      |          ~^~~~~~~~~~~~~~~
C.cpp:129:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  129 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
C.cpp:133:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  133 |   scanf("%d%d", &y, &x);
      |   ~~~~~^~~~~~~~~~~~~~~~
C.cpp:219:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  219 |  scanf("%d", &Q);
      |  ~~~~~^~~~~~~~~~
C.cpp:224:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  224 |   scanf("%d%d%d", &tt, &y, &x);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 45688 KB Output is correct
2 Correct 29 ms 45696 KB Output is correct
3 Correct 28 ms 45696 KB Output is correct
4 Correct 43 ms 46080 KB Output is correct
5 Correct 41 ms 46072 KB Output is correct
6 Correct 40 ms 46072 KB Output is correct
7 Correct 59 ms 46968 KB Output is correct
8 Correct 50 ms 46968 KB Output is correct
9 Correct 52 ms 46968 KB Output is correct
10 Correct 51 ms 46968 KB Output is correct
11 Correct 61 ms 46968 KB Output is correct
12 Correct 51 ms 47000 KB Output is correct
13 Correct 50 ms 46972 KB Output is correct
14 Correct 52 ms 47096 KB Output is correct
15 Correct 53 ms 47096 KB Output is correct
16 Correct 52 ms 46968 KB Output is correct
17 Correct 51 ms 46968 KB Output is correct
18 Correct 51 ms 46968 KB Output is correct
19 Correct 50 ms 46584 KB Output is correct
20 Correct 53 ms 46900 KB Output is correct
21 Correct 50 ms 46968 KB Output is correct
22 Correct 57 ms 47224 KB Output is correct
23 Correct 56 ms 47224 KB Output is correct
24 Correct 59 ms 47484 KB Output is correct
25 Correct 40 ms 46848 KB Output is correct
26 Correct 41 ms 46840 KB Output is correct
27 Correct 38 ms 46716 KB Output is correct
28 Correct 58 ms 47480 KB Output is correct
29 Correct 57 ms 47480 KB Output is correct
30 Correct 58 ms 47608 KB Output is correct
31 Correct 60 ms 47480 KB Output is correct
32 Correct 59 ms 47480 KB Output is correct
33 Correct 60 ms 47352 KB Output is correct
34 Correct 59 ms 47480 KB Output is correct
35 Correct 59 ms 47484 KB Output is correct
36 Correct 37 ms 46720 KB Output is correct
37 Correct 57 ms 47480 KB Output is correct
38 Correct 59 ms 47480 KB Output is correct
39 Correct 57 ms 47484 KB Output is correct
40 Correct 58 ms 47608 KB Output is correct
41 Correct 55 ms 47232 KB Output is correct
42 Correct 55 ms 47228 KB Output is correct
43 Correct 39 ms 46720 KB Output is correct
44 Correct 56 ms 47320 KB Output is correct
45 Correct 55 ms 47224 KB Output is correct
46 Correct 39 ms 46712 KB Output is correct
47 Correct 50 ms 46584 KB Output is correct
48 Correct 47 ms 46332 KB Output is correct
49 Correct 56 ms 46328 KB Output is correct
50 Correct 44 ms 46200 KB Output is correct
51 Correct 43 ms 46072 KB Output is correct
52 Correct 53 ms 46712 KB Output is correct
53 Correct 52 ms 46712 KB Output is correct
54 Correct 59 ms 46584 KB Output is correct
55 Correct 58 ms 46584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 45688 KB Output is correct
2 Correct 29 ms 45696 KB Output is correct
3 Correct 28 ms 45696 KB Output is correct
4 Correct 43 ms 46080 KB Output is correct
5 Correct 41 ms 46072 KB Output is correct
6 Correct 40 ms 46072 KB Output is correct
7 Correct 59 ms 46968 KB Output is correct
8 Correct 50 ms 46968 KB Output is correct
9 Correct 52 ms 46968 KB Output is correct
10 Correct 51 ms 46968 KB Output is correct
11 Correct 61 ms 46968 KB Output is correct
12 Correct 51 ms 47000 KB Output is correct
13 Correct 50 ms 46972 KB Output is correct
14 Correct 52 ms 47096 KB Output is correct
15 Correct 53 ms 47096 KB Output is correct
16 Correct 52 ms 46968 KB Output is correct
17 Correct 51 ms 46968 KB Output is correct
18 Correct 51 ms 46968 KB Output is correct
19 Correct 50 ms 46584 KB Output is correct
20 Correct 53 ms 46900 KB Output is correct
21 Correct 50 ms 46968 KB Output is correct
22 Correct 57 ms 47224 KB Output is correct
23 Correct 56 ms 47224 KB Output is correct
24 Correct 59 ms 47484 KB Output is correct
25 Correct 40 ms 46848 KB Output is correct
26 Correct 41 ms 46840 KB Output is correct
27 Correct 38 ms 46716 KB Output is correct
28 Correct 58 ms 47480 KB Output is correct
29 Correct 57 ms 47480 KB Output is correct
30 Correct 58 ms 47608 KB Output is correct
31 Correct 60 ms 47480 KB Output is correct
32 Correct 59 ms 47480 KB Output is correct
33 Correct 60 ms 47352 KB Output is correct
34 Correct 59 ms 47480 KB Output is correct
35 Correct 59 ms 47484 KB Output is correct
36 Correct 37 ms 46720 KB Output is correct
37 Correct 57 ms 47480 KB Output is correct
38 Correct 59 ms 47480 KB Output is correct
39 Correct 57 ms 47484 KB Output is correct
40 Correct 58 ms 47608 KB Output is correct
41 Correct 55 ms 47232 KB Output is correct
42 Correct 55 ms 47228 KB Output is correct
43 Correct 39 ms 46720 KB Output is correct
44 Correct 56 ms 47320 KB Output is correct
45 Correct 55 ms 47224 KB Output is correct
46 Correct 39 ms 46712 KB Output is correct
47 Correct 50 ms 46584 KB Output is correct
48 Correct 47 ms 46332 KB Output is correct
49 Correct 56 ms 46328 KB Output is correct
50 Correct 44 ms 46200 KB Output is correct
51 Correct 43 ms 46072 KB Output is correct
52 Correct 53 ms 46712 KB Output is correct
53 Correct 52 ms 46712 KB Output is correct
54 Correct 59 ms 46584 KB Output is correct
55 Correct 58 ms 46584 KB Output is correct
56 Correct 220 ms 46328 KB Output is correct
57 Correct 239 ms 46456 KB Output is correct
58 Correct 217 ms 46584 KB Output is correct
59 Correct 336 ms 48248 KB Output is correct
60 Correct 361 ms 48388 KB Output is correct
61 Correct 350 ms 48120 KB Output is correct
62 Correct 350 ms 48080 KB Output is correct
63 Correct 334 ms 48120 KB Output is correct
64 Correct 363 ms 48120 KB Output is correct
65 Correct 381 ms 48120 KB Output is correct
66 Correct 354 ms 48132 KB Output is correct
67 Correct 335 ms 48248 KB Output is correct
68 Correct 354 ms 48120 KB Output is correct
69 Correct 342 ms 47736 KB Output is correct
70 Correct 339 ms 48248 KB Output is correct
71 Correct 330 ms 47564 KB Output is correct
72 Correct 350 ms 48288 KB Output is correct
73 Correct 339 ms 48116 KB Output is correct
74 Correct 163 ms 47480 KB Output is correct
75 Correct 194 ms 47736 KB Output is correct
76 Correct 145 ms 47224 KB Output is correct
77 Correct 457 ms 48880 KB Output is correct
78 Correct 479 ms 48900 KB Output is correct
79 Correct 147 ms 47224 KB Output is correct
80 Correct 455 ms 48968 KB Output is correct
81 Correct 452 ms 48860 KB Output is correct
82 Correct 418 ms 48640 KB Output is correct
83 Correct 420 ms 48680 KB Output is correct
84 Correct 156 ms 47352 KB Output is correct
85 Correct 430 ms 48604 KB Output is correct
86 Correct 411 ms 48516 KB Output is correct
87 Correct 150 ms 47352 KB Output is correct
88 Correct 319 ms 47356 KB Output is correct
89 Correct 294 ms 47096 KB Output is correct
90 Correct 295 ms 47352 KB Output is correct
91 Correct 273 ms 46780 KB Output is correct
92 Correct 228 ms 46712 KB Output is correct
93 Correct 333 ms 47608 KB Output is correct
94 Correct 329 ms 47576 KB Output is correct
95 Correct 354 ms 47608 KB Output is correct
96 Correct 342 ms 47608 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 376 ms 68684 KB Output is correct
2 Correct 410 ms 68604 KB Output is correct
3 Correct 1900 ms 94376 KB Output is correct
4 Correct 1895 ms 95320 KB Output is correct
5 Correct 1830 ms 94996 KB Output is correct
6 Correct 1868 ms 94816 KB Output is correct
7 Correct 772 ms 60484 KB Output is correct
8 Correct 317 ms 63596 KB Output is correct
9 Correct 306 ms 68336 KB Output is correct
10 Correct 1275 ms 61072 KB Output is correct
11 Correct 732 ms 68204 KB Output is correct
12 Correct 372 ms 69640 KB Output is correct
13 Correct 299 ms 68080 KB Output is correct
14 Correct 365 ms 69256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1340 ms 73188 KB Output is correct
2 Correct 1370 ms 74852 KB Output is correct
3 Correct 1413 ms 74772 KB Output is correct
4 Correct 1545 ms 84172 KB Output is correct
5 Correct 1483 ms 83304 KB Output is correct
6 Correct 1529 ms 83508 KB Output is correct
7 Correct 1307 ms 74468 KB Output is correct
8 Correct 1270 ms 74340 KB Output is correct
9 Correct 1342 ms 75136 KB Output is correct
10 Correct 1748 ms 87800 KB Output is correct
11 Correct 1706 ms 87800 KB Output is correct
12 Execution timed out 2074 ms 92088 KB Time limit exceeded
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 45688 KB Output is correct
2 Correct 29 ms 45696 KB Output is correct
3 Correct 28 ms 45696 KB Output is correct
4 Correct 43 ms 46080 KB Output is correct
5 Correct 41 ms 46072 KB Output is correct
6 Correct 40 ms 46072 KB Output is correct
7 Correct 59 ms 46968 KB Output is correct
8 Correct 50 ms 46968 KB Output is correct
9 Correct 52 ms 46968 KB Output is correct
10 Correct 51 ms 46968 KB Output is correct
11 Correct 61 ms 46968 KB Output is correct
12 Correct 51 ms 47000 KB Output is correct
13 Correct 50 ms 46972 KB Output is correct
14 Correct 52 ms 47096 KB Output is correct
15 Correct 53 ms 47096 KB Output is correct
16 Correct 52 ms 46968 KB Output is correct
17 Correct 51 ms 46968 KB Output is correct
18 Correct 51 ms 46968 KB Output is correct
19 Correct 50 ms 46584 KB Output is correct
20 Correct 53 ms 46900 KB Output is correct
21 Correct 50 ms 46968 KB Output is correct
22 Correct 57 ms 47224 KB Output is correct
23 Correct 56 ms 47224 KB Output is correct
24 Correct 59 ms 47484 KB Output is correct
25 Correct 40 ms 46848 KB Output is correct
26 Correct 41 ms 46840 KB Output is correct
27 Correct 38 ms 46716 KB Output is correct
28 Correct 58 ms 47480 KB Output is correct
29 Correct 57 ms 47480 KB Output is correct
30 Correct 58 ms 47608 KB Output is correct
31 Correct 60 ms 47480 KB Output is correct
32 Correct 59 ms 47480 KB Output is correct
33 Correct 60 ms 47352 KB Output is correct
34 Correct 59 ms 47480 KB Output is correct
35 Correct 59 ms 47484 KB Output is correct
36 Correct 37 ms 46720 KB Output is correct
37 Correct 57 ms 47480 KB Output is correct
38 Correct 59 ms 47480 KB Output is correct
39 Correct 57 ms 47484 KB Output is correct
40 Correct 58 ms 47608 KB Output is correct
41 Correct 55 ms 47232 KB Output is correct
42 Correct 55 ms 47228 KB Output is correct
43 Correct 39 ms 46720 KB Output is correct
44 Correct 56 ms 47320 KB Output is correct
45 Correct 55 ms 47224 KB Output is correct
46 Correct 39 ms 46712 KB Output is correct
47 Correct 50 ms 46584 KB Output is correct
48 Correct 47 ms 46332 KB Output is correct
49 Correct 56 ms 46328 KB Output is correct
50 Correct 44 ms 46200 KB Output is correct
51 Correct 43 ms 46072 KB Output is correct
52 Correct 53 ms 46712 KB Output is correct
53 Correct 52 ms 46712 KB Output is correct
54 Correct 59 ms 46584 KB Output is correct
55 Correct 58 ms 46584 KB Output is correct
56 Correct 220 ms 46328 KB Output is correct
57 Correct 239 ms 46456 KB Output is correct
58 Correct 217 ms 46584 KB Output is correct
59 Correct 336 ms 48248 KB Output is correct
60 Correct 361 ms 48388 KB Output is correct
61 Correct 350 ms 48120 KB Output is correct
62 Correct 350 ms 48080 KB Output is correct
63 Correct 334 ms 48120 KB Output is correct
64 Correct 363 ms 48120 KB Output is correct
65 Correct 381 ms 48120 KB Output is correct
66 Correct 354 ms 48132 KB Output is correct
67 Correct 335 ms 48248 KB Output is correct
68 Correct 354 ms 48120 KB Output is correct
69 Correct 342 ms 47736 KB Output is correct
70 Correct 339 ms 48248 KB Output is correct
71 Correct 330 ms 47564 KB Output is correct
72 Correct 350 ms 48288 KB Output is correct
73 Correct 339 ms 48116 KB Output is correct
74 Correct 163 ms 47480 KB Output is correct
75 Correct 194 ms 47736 KB Output is correct
76 Correct 145 ms 47224 KB Output is correct
77 Correct 457 ms 48880 KB Output is correct
78 Correct 479 ms 48900 KB Output is correct
79 Correct 147 ms 47224 KB Output is correct
80 Correct 455 ms 48968 KB Output is correct
81 Correct 452 ms 48860 KB Output is correct
82 Correct 418 ms 48640 KB Output is correct
83 Correct 420 ms 48680 KB Output is correct
84 Correct 156 ms 47352 KB Output is correct
85 Correct 430 ms 48604 KB Output is correct
86 Correct 411 ms 48516 KB Output is correct
87 Correct 150 ms 47352 KB Output is correct
88 Correct 319 ms 47356 KB Output is correct
89 Correct 294 ms 47096 KB Output is correct
90 Correct 295 ms 47352 KB Output is correct
91 Correct 273 ms 46780 KB Output is correct
92 Correct 228 ms 46712 KB Output is correct
93 Correct 333 ms 47608 KB Output is correct
94 Correct 329 ms 47576 KB Output is correct
95 Correct 354 ms 47608 KB Output is correct
96 Correct 342 ms 47608 KB Output is correct
97 Correct 376 ms 68684 KB Output is correct
98 Correct 410 ms 68604 KB Output is correct
99 Correct 1900 ms 94376 KB Output is correct
100 Correct 1895 ms 95320 KB Output is correct
101 Correct 1830 ms 94996 KB Output is correct
102 Correct 1868 ms 94816 KB Output is correct
103 Correct 772 ms 60484 KB Output is correct
104 Correct 317 ms 63596 KB Output is correct
105 Correct 306 ms 68336 KB Output is correct
106 Correct 1275 ms 61072 KB Output is correct
107 Correct 732 ms 68204 KB Output is correct
108 Correct 372 ms 69640 KB Output is correct
109 Correct 299 ms 68080 KB Output is correct
110 Correct 365 ms 69256 KB Output is correct
111 Correct 1340 ms 73188 KB Output is correct
112 Correct 1370 ms 74852 KB Output is correct
113 Correct 1413 ms 74772 KB Output is correct
114 Correct 1545 ms 84172 KB Output is correct
115 Correct 1483 ms 83304 KB Output is correct
116 Correct 1529 ms 83508 KB Output is correct
117 Correct 1307 ms 74468 KB Output is correct
118 Correct 1270 ms 74340 KB Output is correct
119 Correct 1342 ms 75136 KB Output is correct
120 Correct 1748 ms 87800 KB Output is correct
121 Correct 1706 ms 87800 KB Output is correct
122 Execution timed out 2074 ms 92088 KB Time limit exceeded
123 Halted 0 ms 0 KB -