답안 #122784

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
122784 2019-06-29T09:21:43 Z 이온조(#2999) Bulldozer (JOI17_bulldozer) C++14
100 / 100
1946 ms 137760 KB
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using pvi = pair<pii, int>;
#define X first
#define Y second
#pragma GCC optimize ("Ofast")

inline int CCW(pii A, pii B, pii C) {
	long long tmp = 1LL*A.X*B.Y + 1LL*B.X*C.Y + 1LL*C.X*A.Y - 1LL*B.X*A.Y - 1LL*C.X*B.Y - 1LL*A.X*C.Y;
	if(tmp < 0LL) return -1;
	if(tmp == 0LL) return 0;
	if(tmp > 0LL) return +1;
}

struct myp { int x, y; };
struct info { int x, y, v; };
struct node { long long ls, rs, mx, s; };
node operator +(node L, node R) {
	node ret;
	ret.s = L.s + R.s;
	ret.ls = max(L.ls, L.s + R.ls);
	ret.rs = max(R.rs, R.s + L.rs);
	ret.mx = max({L.mx, R.mx, L.rs + R.ls, ret.s});
	return ret;
}
bool operator <(myp P, myp Q) {
	return CCW({0, 0}, {P.x, P.y}, {Q.x, Q.y}) == -1;
}
const long long INF = 1LL * 1e18;
const node MINF = {0, 0, 0, -INF};

node T[8000];

struct segtree {
	node get(int idx, int s, int e, int l, int r) {
		if(r < s || e < l) return MINF;
		if(l <= s && e <= r) return T[idx];
		int m = s+e >> 1;
		return get(idx*2, s, m, l, r) + get(idx*2+1, m+1, e, l, r);
	}
	void upd(int idx, int s, int e, int p, int v) {
		if(p < s || e < p) return;
		if(s == e) {
			int x = max(0, v);
			T[idx] = {x, x, x, v};
			return;
		}
		int m = s+e >> 1;
		upd(idx*2, s, m, p, v);
		upd(idx*2+1, m+1, e, p, v);
		T[idx] = T[idx*2] + T[idx*2+1];
	}
};

inline int f(int x) { return max(x, -x); }

inline int CCW(info A, info B, info C) {
	return CCW((pii){A.x, A.y}, (pii){B.x, B.y}, (pii){C.x, C.y});
}

inline long long dst(pii A, pii B) {
	return 1LL * (A.X - B.X) * (A.X - B.X) + 1LL * (A.Y - B.Y) * (A.Y - B.Y);
}

vector<pvi> RQ;
vector<int> SS[2000009]; int cnt;
bool chk[2009][2009];
int O[2009], R[2009];
info A[2009];

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

	// int N = 2000;
	// srand(22315);
	// for(int i=1; i<=N; i++) {
	// 	A[i].x = rand()*rand();
	// 	A[i].y = rand()*rand();
	// 	A[i].v = rand()*rand();
	// }
	// set<pii> st;
	// for(int i=1 ;i<=N; i++) {
	// 	if(st.find({A[i].x, A[i].y}) != st.end()) return 0;
	// 	st.insert({A[i].x, A[i].y});
	// }
	// puts("start");

	for(int i=1; i<=N; i++) O[i] = i;
	sort(O+1, O+N+1, [&](int P, int Q) { return (pii){A[P].x, A[P].y} < (pii){A[Q].x, A[Q].y}; });
	for(int oi=1; oi<=N; oi++) {
		int i = O[oi];
		vector<int> T;
		for(int j=1; j<=N; j++) {
			int dx = A[j].x - A[i].x, dy = A[j].y - A[i].y;
			if(dx < 0 || (dx == 0 && dy <= 0)) continue;
			T.push_back(j);
		}
		sort(T.begin(), T.end(), [&](int P, int Q) {
			int ccw = CCW(A[i], A[P], A[Q]);
			if(ccw == 0) return dst({A[i].x, A[i].y}, {A[P].x, A[P].y}) < dst({A[i].x, A[i].y}, {A[Q].x, A[Q].y});
			return ccw == -1;
		});
		vector<int> P = {i}; int pr = -1, pdx = -1, pdy = -1;
		for(int j=0; j<T.size(); j++) {
			int it = T[j];
			int dx = A[it].x - A[i].x, dy = A[it].y - A[i].y;

			if(chk[i][it]) continue;
			if(pr == -1 || CCW(A[i], A[pr], A[it]) == 0) {
				P.push_back(it);
				pr = it;
			}
			else {
				RQ.push_back({{pdx, pdy}, cnt});
				SS[cnt++] = P;
				for(int p=0; p<P.size(); p++) for(int q=p+1; q<P.size(); q++) {
					// printf("i: %d p: %d q: %d\n", i, p, q);
					chk[P[p]][P[q]] = 1;
				}
				P = {i, it};
				pr = it;
			}
			pdx = dx; pdy = dy;
		}
		if(pdx != -1) {
			RQ.push_back({{pdx, pdy}, cnt});
			SS[cnt++] = P;
			for(int p=0; p<P.size(); p++) for(int q=p+1; q<P.size(); q++) {
				// printf("i: %d p: %d q: %d\n", i, p, q);
				chk[P[p]][P[q]] = 1;
			}
		}
	}
	segtree seg;
	long long ans = 0;
	for(int i=1; i<=N; i++) {
		int it = O[i];
		R[it] = i;
		seg.upd(1, 1, N, i, A[it].v);
	}

	// puts("sort");

	// puts("O");
	// for(int i=1; i<=N; i++) printf("%d ",O[i]);
	// puts("");
	// printf("RQsize: %d\n", RQ.size());
	ans = seg.get(1, 1, N, 1, N).mx;
	sort(RQ.begin(), RQ.end(), [&](pvi P, pvi Q) {
		int pdx, pdy; tie(pdx, pdy) = P.first;
		int qdx, qdy; tie(qdx, qdy) = Q.first;
		if((pdx == 0) != (qdx == 0)) return (pdx == 0) > (qdx == 0);
		return 1LL * pdy * qdx > 1LL * qdy * pdx;
	});

	// puts("calculate");

	long long pdx = 0, pdy = 0;
	for(auto& kt: RQ) {

		// printf("it: ");
		// for(auto& jt: it) printf("%d ", jt);
		// puts("");
		int dx, dy; tie(dx, dy) = kt.first;
		
		int K = SS[kt.second].size();
		for(int j=0; j<K; j++) seg.upd(1, 1, N, R[SS[kt.second][j]], A[SS[kt.second][K-j-1]].v);
		for(int j=0; j<(K>>1); j++) {
			swap(R[SS[kt.second][j]], R[SS[kt.second][K-j-1]]);
		}
		// puts("O");
		// for(int i=1; i<=N; i++) printf("%d ",O[i]);
		// puts("");

		if(pdx && pdy && ((pdx == 0 && dx != 0) || pdy * dx != dy * pdx)) {
			// printf("getans: %lld\n", seg.get(1, 1, N, 1, N).mx);
			ans = max(ans, seg.get(1, 1, N, 1, N).mx);
		}
		pdx = dx; pdy = dy;
	}
	printf("%lld", ans);
	return 0;
}

Compilation message

bulldozer.cpp: In member function 'node segtree::get(int, int, int, int, int)':
bulldozer.cpp:39:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   int m = s+e >> 1;
           ~^~
bulldozer.cpp: In member function 'void segtree::upd(int, int, int, int, int)':
bulldozer.cpp:49:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   int m = s+e >> 1;
           ~^~
bulldozer.cpp: In function 'int main()':
bulldozer.cpp:108:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0; j<T.size(); j++) {
                ~^~~~~~~~~
bulldozer.cpp:120:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int p=0; p<P.size(); p++) for(int q=p+1; q<P.size(); q++) {
                  ~^~~~~~~~~
bulldozer.cpp:120:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int p=0; p<P.size(); p++) for(int q=p+1; q<P.size(); q++) {
                                                  ~^~~~~~~~~
bulldozer.cpp:132:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int p=0; p<P.size(); p++) for(int q=p+1; q<P.size(); q++) {
                 ~^~~~~~~~~
bulldozer.cpp:132:50: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int p=0; p<P.size(); p++) for(int q=p+1; q<P.size(); q++) {
                                                 ~^~~~~~~~~
bulldozer.cpp: In function 'int CCW(pii, pii, pii)':
bulldozer.cpp:14:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
bulldozer.cpp: In function 'int main()':
bulldozer.cpp:73:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int N; scanf("%d",&N);
         ~~~~~^~~~~~~~~
bulldozer.cpp:75:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d", &A[i].x, &A[i].y, &A[i].v);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 45 ms 47608 KB Output is correct
2 Correct 44 ms 47480 KB Output is correct
3 Correct 44 ms 47480 KB Output is correct
4 Correct 44 ms 47480 KB Output is correct
5 Correct 44 ms 47480 KB Output is correct
6 Correct 45 ms 47480 KB Output is correct
7 Correct 44 ms 47480 KB Output is correct
8 Correct 45 ms 47608 KB Output is correct
9 Correct 44 ms 47480 KB Output is correct
10 Correct 44 ms 47480 KB Output is correct
11 Correct 44 ms 47224 KB Output is correct
12 Correct 43 ms 47344 KB Output is correct
13 Correct 43 ms 47416 KB Output is correct
14 Correct 44 ms 47224 KB Output is correct
15 Correct 42 ms 47224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 47728 KB Output is correct
2 Correct 47 ms 47804 KB Output is correct
3 Correct 46 ms 47756 KB Output is correct
4 Correct 47 ms 47736 KB Output is correct
5 Correct 47 ms 47736 KB Output is correct
6 Correct 46 ms 47736 KB Output is correct
7 Correct 51 ms 47864 KB Output is correct
8 Correct 47 ms 47736 KB Output is correct
9 Correct 47 ms 47736 KB Output is correct
10 Correct 47 ms 47736 KB Output is correct
11 Correct 44 ms 47224 KB Output is correct
12 Correct 43 ms 47224 KB Output is correct
13 Correct 44 ms 47352 KB Output is correct
14 Correct 57 ms 47356 KB Output is correct
15 Correct 43 ms 47224 KB Output is correct
16 Correct 42 ms 47328 KB Output is correct
17 Correct 51 ms 47224 KB Output is correct
18 Correct 42 ms 47224 KB Output is correct
19 Correct 43 ms 47352 KB Output is correct
20 Correct 42 ms 47252 KB Output is correct
21 Correct 46 ms 47736 KB Output is correct
22 Correct 48 ms 47736 KB Output is correct
23 Correct 47 ms 47992 KB Output is correct
24 Correct 46 ms 47736 KB Output is correct
25 Correct 47 ms 47736 KB Output is correct
26 Correct 47 ms 47736 KB Output is correct
27 Correct 47 ms 47712 KB Output is correct
28 Correct 46 ms 47736 KB Output is correct
29 Correct 47 ms 47736 KB Output is correct
30 Correct 47 ms 47736 KB Output is correct
31 Correct 47 ms 47736 KB Output is correct
32 Correct 46 ms 47736 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 47728 KB Output is correct
2 Correct 47 ms 47804 KB Output is correct
3 Correct 46 ms 47756 KB Output is correct
4 Correct 47 ms 47736 KB Output is correct
5 Correct 47 ms 47736 KB Output is correct
6 Correct 46 ms 47736 KB Output is correct
7 Correct 51 ms 47864 KB Output is correct
8 Correct 47 ms 47736 KB Output is correct
9 Correct 47 ms 47736 KB Output is correct
10 Correct 47 ms 47736 KB Output is correct
11 Correct 44 ms 47224 KB Output is correct
12 Correct 43 ms 47224 KB Output is correct
13 Correct 44 ms 47352 KB Output is correct
14 Correct 57 ms 47356 KB Output is correct
15 Correct 43 ms 47224 KB Output is correct
16 Correct 42 ms 47328 KB Output is correct
17 Correct 51 ms 47224 KB Output is correct
18 Correct 42 ms 47224 KB Output is correct
19 Correct 43 ms 47352 KB Output is correct
20 Correct 42 ms 47252 KB Output is correct
21 Correct 46 ms 47736 KB Output is correct
22 Correct 48 ms 47736 KB Output is correct
23 Correct 47 ms 47992 KB Output is correct
24 Correct 46 ms 47736 KB Output is correct
25 Correct 47 ms 47736 KB Output is correct
26 Correct 47 ms 47736 KB Output is correct
27 Correct 47 ms 47712 KB Output is correct
28 Correct 46 ms 47736 KB Output is correct
29 Correct 47 ms 47736 KB Output is correct
30 Correct 47 ms 47736 KB Output is correct
31 Correct 47 ms 47736 KB Output is correct
32 Correct 46 ms 47736 KB Output is correct
33 Correct 1862 ms 137520 KB Output is correct
34 Correct 1876 ms 137508 KB Output is correct
35 Correct 1851 ms 137532 KB Output is correct
36 Correct 1872 ms 137524 KB Output is correct
37 Correct 1926 ms 137528 KB Output is correct
38 Correct 1893 ms 137704 KB Output is correct
39 Correct 1857 ms 137544 KB Output is correct
40 Correct 1868 ms 137532 KB Output is correct
41 Correct 1864 ms 137440 KB Output is correct
42 Correct 1846 ms 137532 KB Output is correct
43 Correct 1815 ms 137520 KB Output is correct
44 Correct 1841 ms 137596 KB Output is correct
45 Correct 1831 ms 137508 KB Output is correct
46 Correct 1819 ms 137520 KB Output is correct
47 Correct 1813 ms 137580 KB Output is correct
48 Correct 1867 ms 137524 KB Output is correct
49 Correct 1820 ms 137596 KB Output is correct
50 Correct 1827 ms 137512 KB Output is correct
51 Correct 1809 ms 137452 KB Output is correct
52 Correct 1853 ms 137512 KB Output is correct
53 Correct 1824 ms 137508 KB Output is correct
54 Correct 1835 ms 137584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 47728 KB Output is correct
2 Correct 47 ms 47804 KB Output is correct
3 Correct 46 ms 47756 KB Output is correct
4 Correct 47 ms 47736 KB Output is correct
5 Correct 47 ms 47736 KB Output is correct
6 Correct 46 ms 47736 KB Output is correct
7 Correct 51 ms 47864 KB Output is correct
8 Correct 47 ms 47736 KB Output is correct
9 Correct 47 ms 47736 KB Output is correct
10 Correct 47 ms 47736 KB Output is correct
11 Correct 44 ms 47224 KB Output is correct
12 Correct 43 ms 47224 KB Output is correct
13 Correct 44 ms 47352 KB Output is correct
14 Correct 57 ms 47356 KB Output is correct
15 Correct 43 ms 47224 KB Output is correct
16 Correct 42 ms 47328 KB Output is correct
17 Correct 51 ms 47224 KB Output is correct
18 Correct 42 ms 47224 KB Output is correct
19 Correct 43 ms 47352 KB Output is correct
20 Correct 42 ms 47252 KB Output is correct
21 Correct 46 ms 47736 KB Output is correct
22 Correct 48 ms 47736 KB Output is correct
23 Correct 47 ms 47992 KB Output is correct
24 Correct 46 ms 47736 KB Output is correct
25 Correct 47 ms 47736 KB Output is correct
26 Correct 47 ms 47736 KB Output is correct
27 Correct 47 ms 47712 KB Output is correct
28 Correct 46 ms 47736 KB Output is correct
29 Correct 47 ms 47736 KB Output is correct
30 Correct 47 ms 47736 KB Output is correct
31 Correct 47 ms 47736 KB Output is correct
32 Correct 46 ms 47736 KB Output is correct
33 Correct 1862 ms 137520 KB Output is correct
34 Correct 1876 ms 137508 KB Output is correct
35 Correct 1851 ms 137532 KB Output is correct
36 Correct 1872 ms 137524 KB Output is correct
37 Correct 1926 ms 137528 KB Output is correct
38 Correct 1893 ms 137704 KB Output is correct
39 Correct 1857 ms 137544 KB Output is correct
40 Correct 1868 ms 137532 KB Output is correct
41 Correct 1864 ms 137440 KB Output is correct
42 Correct 1846 ms 137532 KB Output is correct
43 Correct 1815 ms 137520 KB Output is correct
44 Correct 1841 ms 137596 KB Output is correct
45 Correct 1831 ms 137508 KB Output is correct
46 Correct 1819 ms 137520 KB Output is correct
47 Correct 1813 ms 137580 KB Output is correct
48 Correct 1867 ms 137524 KB Output is correct
49 Correct 1820 ms 137596 KB Output is correct
50 Correct 1827 ms 137512 KB Output is correct
51 Correct 1809 ms 137452 KB Output is correct
52 Correct 1853 ms 137512 KB Output is correct
53 Correct 1824 ms 137508 KB Output is correct
54 Correct 1835 ms 137584 KB Output is correct
55 Correct 1913 ms 137536 KB Output is correct
56 Correct 1853 ms 137644 KB Output is correct
57 Correct 1867 ms 137644 KB Output is correct
58 Correct 1850 ms 137456 KB Output is correct
59 Correct 1848 ms 137564 KB Output is correct
60 Correct 1878 ms 137516 KB Output is correct
61 Correct 1858 ms 137516 KB Output is correct
62 Correct 1859 ms 137440 KB Output is correct
63 Correct 1852 ms 137576 KB Output is correct
64 Correct 1894 ms 137644 KB Output is correct
65 Correct 1837 ms 137580 KB Output is correct
66 Correct 1856 ms 137696 KB Output is correct
67 Correct 1868 ms 137580 KB Output is correct
68 Correct 1873 ms 137580 KB Output is correct
69 Correct 1941 ms 137580 KB Output is correct
70 Correct 1855 ms 137580 KB Output is correct
71 Correct 1847 ms 137612 KB Output is correct
72 Correct 1847 ms 137708 KB Output is correct
73 Correct 1846 ms 137596 KB Output is correct
74 Correct 1843 ms 137516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 45 ms 47608 KB Output is correct
2 Correct 44 ms 47480 KB Output is correct
3 Correct 44 ms 47480 KB Output is correct
4 Correct 44 ms 47480 KB Output is correct
5 Correct 44 ms 47480 KB Output is correct
6 Correct 45 ms 47480 KB Output is correct
7 Correct 44 ms 47480 KB Output is correct
8 Correct 45 ms 47608 KB Output is correct
9 Correct 44 ms 47480 KB Output is correct
10 Correct 44 ms 47480 KB Output is correct
11 Correct 44 ms 47224 KB Output is correct
12 Correct 43 ms 47344 KB Output is correct
13 Correct 43 ms 47416 KB Output is correct
14 Correct 44 ms 47224 KB Output is correct
15 Correct 42 ms 47224 KB Output is correct
16 Correct 46 ms 47728 KB Output is correct
17 Correct 47 ms 47804 KB Output is correct
18 Correct 46 ms 47756 KB Output is correct
19 Correct 47 ms 47736 KB Output is correct
20 Correct 47 ms 47736 KB Output is correct
21 Correct 46 ms 47736 KB Output is correct
22 Correct 51 ms 47864 KB Output is correct
23 Correct 47 ms 47736 KB Output is correct
24 Correct 47 ms 47736 KB Output is correct
25 Correct 47 ms 47736 KB Output is correct
26 Correct 44 ms 47224 KB Output is correct
27 Correct 43 ms 47224 KB Output is correct
28 Correct 44 ms 47352 KB Output is correct
29 Correct 57 ms 47356 KB Output is correct
30 Correct 43 ms 47224 KB Output is correct
31 Correct 42 ms 47328 KB Output is correct
32 Correct 51 ms 47224 KB Output is correct
33 Correct 42 ms 47224 KB Output is correct
34 Correct 43 ms 47352 KB Output is correct
35 Correct 42 ms 47252 KB Output is correct
36 Correct 46 ms 47736 KB Output is correct
37 Correct 48 ms 47736 KB Output is correct
38 Correct 47 ms 47992 KB Output is correct
39 Correct 46 ms 47736 KB Output is correct
40 Correct 47 ms 47736 KB Output is correct
41 Correct 47 ms 47736 KB Output is correct
42 Correct 47 ms 47712 KB Output is correct
43 Correct 46 ms 47736 KB Output is correct
44 Correct 47 ms 47736 KB Output is correct
45 Correct 47 ms 47736 KB Output is correct
46 Correct 47 ms 47736 KB Output is correct
47 Correct 46 ms 47736 KB Output is correct
48 Correct 1862 ms 137520 KB Output is correct
49 Correct 1876 ms 137508 KB Output is correct
50 Correct 1851 ms 137532 KB Output is correct
51 Correct 1872 ms 137524 KB Output is correct
52 Correct 1926 ms 137528 KB Output is correct
53 Correct 1893 ms 137704 KB Output is correct
54 Correct 1857 ms 137544 KB Output is correct
55 Correct 1868 ms 137532 KB Output is correct
56 Correct 1864 ms 137440 KB Output is correct
57 Correct 1846 ms 137532 KB Output is correct
58 Correct 1815 ms 137520 KB Output is correct
59 Correct 1841 ms 137596 KB Output is correct
60 Correct 1831 ms 137508 KB Output is correct
61 Correct 1819 ms 137520 KB Output is correct
62 Correct 1813 ms 137580 KB Output is correct
63 Correct 1867 ms 137524 KB Output is correct
64 Correct 1820 ms 137596 KB Output is correct
65 Correct 1827 ms 137512 KB Output is correct
66 Correct 1809 ms 137452 KB Output is correct
67 Correct 1853 ms 137512 KB Output is correct
68 Correct 1824 ms 137508 KB Output is correct
69 Correct 1835 ms 137584 KB Output is correct
70 Correct 1913 ms 137536 KB Output is correct
71 Correct 1853 ms 137644 KB Output is correct
72 Correct 1867 ms 137644 KB Output is correct
73 Correct 1850 ms 137456 KB Output is correct
74 Correct 1848 ms 137564 KB Output is correct
75 Correct 1878 ms 137516 KB Output is correct
76 Correct 1858 ms 137516 KB Output is correct
77 Correct 1859 ms 137440 KB Output is correct
78 Correct 1852 ms 137576 KB Output is correct
79 Correct 1894 ms 137644 KB Output is correct
80 Correct 1837 ms 137580 KB Output is correct
81 Correct 1856 ms 137696 KB Output is correct
82 Correct 1868 ms 137580 KB Output is correct
83 Correct 1873 ms 137580 KB Output is correct
84 Correct 1941 ms 137580 KB Output is correct
85 Correct 1855 ms 137580 KB Output is correct
86 Correct 1847 ms 137612 KB Output is correct
87 Correct 1847 ms 137708 KB Output is correct
88 Correct 1846 ms 137596 KB Output is correct
89 Correct 1843 ms 137516 KB Output is correct
90 Correct 1854 ms 137604 KB Output is correct
91 Correct 1859 ms 137564 KB Output is correct
92 Correct 1885 ms 137580 KB Output is correct
93 Correct 1946 ms 137560 KB Output is correct
94 Correct 1865 ms 137580 KB Output is correct
95 Correct 1858 ms 137652 KB Output is correct
96 Correct 1860 ms 137648 KB Output is correct
97 Correct 1946 ms 137632 KB Output is correct
98 Correct 1863 ms 137592 KB Output is correct
99 Correct 1858 ms 137596 KB Output is correct
100 Correct 1125 ms 94472 KB Output is correct
101 Correct 1128 ms 94564 KB Output is correct
102 Correct 1138 ms 94484 KB Output is correct
103 Correct 1125 ms 94604 KB Output is correct
104 Correct 1130 ms 94544 KB Output is correct
105 Correct 1388 ms 108780 KB Output is correct
106 Correct 1392 ms 108836 KB Output is correct
107 Correct 1383 ms 108988 KB Output is correct
108 Correct 1382 ms 108908 KB Output is correct
109 Correct 1376 ms 108956 KB Output is correct
110 Correct 1306 ms 108688 KB Output is correct
111 Correct 1293 ms 108780 KB Output is correct
112 Correct 1273 ms 108768 KB Output is correct
113 Correct 1269 ms 108684 KB Output is correct
114 Correct 1266 ms 108640 KB Output is correct
115 Correct 1289 ms 108840 KB Output is correct
116 Correct 1287 ms 108720 KB Output is correct
117 Correct 1289 ms 108932 KB Output is correct
118 Correct 1290 ms 108884 KB Output is correct
119 Correct 1267 ms 108824 KB Output is correct
120 Correct 45 ms 47352 KB Output is correct
121 Correct 44 ms 47356 KB Output is correct
122 Correct 1830 ms 137500 KB Output is correct
123 Correct 1854 ms 137456 KB Output is correct
124 Correct 1829 ms 137496 KB Output is correct
125 Correct 1871 ms 137712 KB Output is correct
126 Correct 1820 ms 137584 KB Output is correct
127 Correct 1828 ms 137588 KB Output is correct
128 Correct 1868 ms 137676 KB Output is correct
129 Correct 1873 ms 137536 KB Output is correct
130 Correct 1881 ms 137760 KB Output is correct
131 Correct 1832 ms 137596 KB Output is correct
132 Correct 1844 ms 137712 KB Output is correct
133 Correct 1867 ms 137740 KB Output is correct