Submission #161305

# Submission time Handle Problem Language Result Execution time Memory
161305 2019-11-01T18:54:07 Z pink_bittern Segments (IZhO18_segments) C++14
75 / 100
5000 ms 15360 KB
#include <bits/stdc++.h>
#define pb push_back
#define pll pair <ll, ll>
#define MOMI using namespace std;
#define mp make_pair
#define pyshnapyshnakaa ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#pragma optimize("TKACHENKO-GORYACHENKO")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
 
typedef int ll;
 
typedef long double ld;
 
using namespace std;
 
const ll inf = 2e9 + 500;
const ll maxn = 2e5 + 100;
const ll block = 120;
const ll block_sz = (maxn + block - 1) / block;
 
ll n, m, k, t;
 
struct seg{
	ll l;
	ll r;
	inline ll sz() const {
		return r - l + 1;
	}
	ll i;
};
 
inline bool operator==(seg a, seg b) {
	return a.i == b.i;
}
 
vector <seg> S;

vector <seg> lasts;
 
inline bool cmp(seg a, seg b) {
	return (a.r - a.l) < (b.r - b.l);
}
 
inline bool cmpl(const seg& a, const seg& b) {
	return a.l < b.l;
}
 
inline bool cmpr(const seg& a, const seg& b) {
	return a.r < b.r;
}
 
inline bool cmpsz(const seg& a, const seg& b) {
	return a.sz() < b.sz();
}
 
vector <seg> segs;
 
vector <seg> R[block];
 
vector <seg> L[block];
 
ll MNL[block];
ll MXL[block];
ll MNR[block];
ll MXR[block];
 
ll IL[maxn];
ll IR[maxn];
 
bool used[maxn];
 
inline void buildL(ll q) {
	ll w;
	sort(L[q].begin(), L[q].end(), cmpsz);
	MNL[q] = inf;
	MXL[q] = -inf;
	for (w = 0; w < L[q].size(); w++) {
		MNL[q] = min(MNL[q], L[q][w].l);
		MXL[q] = max(MXL[q], L[q][w].l);
	}
}
 
inline void buildR(ll q) {
	ll w;
 	MNR[q] = inf;
	MXR[q] = -inf;
	sort(R[q].begin(), R[q].end(), cmpsz);
	for (w = 0; w < R[q].size(); w++) {
		MNR[q] = min(MNR[q], R[q][w].r);
		MXR[q] = max(MXR[q], R[q][w].r);
	}
}
 
inline void rebuild() { 
	ll q, w;
	lasts.clear();
	ll blocki = 0;
	for (q = 0; q < block; q++) {
		R[q].clear();
		L[q].clear();
	}
	sort(segs.begin(), segs.end(), cmpl);
	for (auto p : segs) {
		IL[p.i] = -1;
		if (used[p.i]) {
			continue;
		}
		if (L[blocki].size() > block_sz) {
			blocki++;
		}
		IL[p.i] = blocki;
		L[blocki].pb(p);
	}
	blocki = 0;
	sort(segs.begin(), segs.end(), cmpr);
	for (auto p: segs) {
		IR[p.i] = -1;
		if (used[p.i]) {
			continue;
		}
		if (R[blocki].size() > block_sz) {
			blocki++;
		}
		IR[p.i] = blocki;
		R[blocki].pb(p);
	}
	for (q = 0; q < block; q++) {
		buildL(q);
	}
	for (q = 0; q < block; q++) {
		buildR(q);
	}
}
 
inline void add(seg a) {
	lasts.pb(a);
	S.pb(a);
	segs.push_back(a);
	IL[a.i] = IR[a.i] = -1;
}
 
inline void del(seg b) { 
	ll il = IL[b.i], ir = IR[b.i];
	if (used[b.i]) {
		return;
	}
	used[b.i] = 1;
	if (il == -1) {
		return;
	}
	L[il].erase(find(L[il].begin(), L[il].end(), b));
	R[ir].erase(find(R[ir].begin(), R[ir].end(), b));
	buildL(il);
	buildR(ir);
}
 
inline ll slowL(ll i, ll x, ll l) {
	ll q;
	ll ans = 0;
	for (q = 0; q < L[i].size(); q++) {
		if (L[i][q].l >= l && L[i][q].sz() >= x) {
			ans++;
		}
	}
	return ans;
}
 
inline ll slowR(ll i, ll x, ll r) {
	ll q;
	ll ans = 0;
	for (q = 0; q < R[i].size(); q++) {
		if (R[i][q].r <= r && R[i][q].sz() >= x) {
			ans++;
		}
	}
	return ans;
}
 
inline ll fastL(ll i, ll x) {
	if (L[i].empty()) {
		return 0;
	}
	seg good;
	good.l = 0; good.r = x - 1; 
	ll j = (lower_bound(L[i].begin(), L[i].end(), good, cmpsz) - L[i].begin());
	return (ll)L[i].size() - j;
}
 
inline ll fastR(ll i, ll x) {
	if (R[i].empty()) {
		return 0;
	}
	seg good;
	good.l = 0; good.r = x - 1;
	ll j = (lower_bound(R[i].begin(), R[i].end(), good, cmpsz) - R[i].begin());
	return (ll)R[i].size() - j;
}
 
inline ll getansL(ll x, ll l) {
	ll q;
	ll ans = 0;
	for (q = 0; q < block; q++) {
		if (MNL[q] == inf) {
			continue;
		}
		if (MNL[q] >= l) {
			ans += fastL(q, x);
			continue;
		}
		if (MXL[q] < l) {
			continue;
		}
		if (MNL[q] < l) {
			ans += slowL(q, x, l);
		}
	}
 
	for (q = 0; q < lasts.size(); q++) {
		if (used[lasts[q].i]) {
			continue;
		}
		if (lasts[q].l >= l && lasts[q].sz() >= x) {
			ans++;
		}
	}
	return ans;
}
 
inline ll getansR(ll x, ll r) {
	ll q;
	ll ans = 0;
	ll cnt = 0;
	for (q = 0; q < block; q++) {
		if (MNR[q] == inf) {
			continue;
		}
		// if (q > 1) {
		// 	if (MXR[q - 1] > MNR[q]) {
		// 		exit(-1);
		// 	}
		// }
		if (MXR[q] <= r) {
			ll dans = fastR(q, x);
			ans += dans;
			continue;
		}
		if (MNR[q] > r) {
			continue;
		}
		/// MXR[q] > r && MNR[q] <= r, 
		ll dans = slowR(q, x, r);
		ans += dans;
		cnt++;
	}
	// if (cnt > 5) {
	// 	exit(-1);
	// }
	for (q = 0; q < lasts.size(); q++) {
		if (used[lasts[q].i]) {
			continue;
		}
		if (lasts[q].r <= r && lasts[q].sz() >= x) {
			ans++;
		}
	}
	return ans;
}
 
inline ll answer(seg c, ll k) {
	if (c.sz() < k) {
		return 0;
	}
	ll q, w;
	ll ans = 0;
	ll lk = c.r - k + 2, rk = c.l + k - 2;
	ll allans = getansR(k, inf);
	ll dansl = getansL(k, lk);
	ll dansr = getansR(k, rk);
	ans = allans - dansr - dansl;
	return ans;
}
 
signed main() {
	ll q, w, e, a, b, c;
	pyshnapyshnakaa;
	cin >> n >> t;
	// cout << block_sz * block << endl;
	ll nxt = 0;
	ll lastans = 0;
	ll cnt3 = 0;
	for (q = 0; q < block; q++) {
		L[q].reserve(block_sz);
		R[q].reserve(block_sz);
	}
	ll cnt1 = 0;
	for (q = 0; q < n; q++) {
		ll comm;
		cin >> comm;
		ll l, r;
		seg x;
		if (comm == 1) {
			cin >> l >> r;
			l ^= (lastans * t);
			r ^= (lastans * t);
			if (l > r) {
				swap(l, r);
			}
			cnt1++;
			x.l = l; x.r = r;
			x.i = cnt1;
			add(x);
		}
		if (comm == 2) {
			cin >> a;
			a--;
			del(S[a]);
		}
		// if (cnt3 > 8e4 && n > 1e5) {
		// 	exit(-1);
		// }
		if (comm == 3) {
			cnt3++;
			cin >> l >> r;
			l ^= (lastans * t);
			r ^= (lastans * t);
			if (lasts.size() >= block_sz) {
				rebuild();
			}
			if (l > r) {
				swap(l, r);
			} 
			x.l = l; x.r = r;
			cin >> c;
			lastans = answer(x, c);
			cout << lastans << '\n';
		}
	}
	return 0;
}

Compilation message

segments.cpp:7:0: warning: ignoring #pragma optimize  [-Wunknown-pragmas]
 #pragma optimize("TKACHENKO-GORYACHENKO")
 
segments.cpp: In function 'void buildL(ll)':
segments.cpp:79:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (w = 0; w < L[q].size(); w++) {
              ~~^~~~~~~~~~~~~
segments.cpp: In function 'void buildR(ll)':
segments.cpp:90:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (w = 0; w < R[q].size(); w++) {
              ~~^~~~~~~~~~~~~
segments.cpp: In function 'void rebuild()':
segments.cpp:97:8: warning: unused variable 'w' [-Wunused-variable]
  ll q, w;
        ^
segments.cpp: In function 'll slowL(ll, ll, ll)':
segments.cpp:162:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (q = 0; q < L[i].size(); q++) {
              ~~^~~~~~~~~~~~~
segments.cpp: In function 'll slowR(ll, ll, ll)':
segments.cpp:173:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (q = 0; q < R[i].size(); q++) {
              ~~^~~~~~~~~~~~~
segments.cpp: In function 'll getansL(ll, ll)':
segments.cpp:220:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (q = 0; q < lasts.size(); q++) {
              ~~^~~~~~~~~~~~~~
segments.cpp: In function 'll getansR(ll, ll)':
segments.cpp:260:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (q = 0; q < lasts.size(); q++) {
              ~~^~~~~~~~~~~~~~
segments.cpp: In function 'll answer(seg, ll)':
segments.cpp:275:5: warning: unused variable 'q' [-Wunused-variable]
  ll q, w;
     ^
segments.cpp:275:8: warning: unused variable 'w' [-Wunused-variable]
  ll q, w;
        ^
segments.cpp: In function 'int main()':
segments.cpp:286:8: warning: unused variable 'w' [-Wunused-variable]
  ll q, w, e, a, b, c;
        ^
segments.cpp:286:11: warning: unused variable 'e' [-Wunused-variable]
  ll q, w, e, a, b, c;
           ^
segments.cpp:286:17: warning: unused variable 'b' [-Wunused-variable]
  ll q, w, e, a, b, c;
                 ^
segments.cpp:290:5: warning: unused variable 'nxt' [-Wunused-variable]
  ll nxt = 0;
     ^~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1272 KB Output is correct
2 Correct 15 ms 1272 KB Output is correct
3 Correct 13 ms 1528 KB Output is correct
4 Correct 10 ms 1532 KB Output is correct
5 Correct 15 ms 1912 KB Output is correct
6 Correct 19 ms 1784 KB Output is correct
7 Correct 38 ms 1656 KB Output is correct
8 Correct 70 ms 1656 KB Output is correct
9 Correct 84 ms 1784 KB Output is correct
10 Correct 31 ms 1912 KB Output is correct
11 Correct 27 ms 1656 KB Output is correct
12 Correct 26 ms 1656 KB Output is correct
13 Correct 32 ms 1912 KB Output is correct
14 Correct 85 ms 1660 KB Output is correct
15 Correct 10 ms 1528 KB Output is correct
16 Correct 12 ms 1528 KB Output is correct
17 Correct 59 ms 1692 KB Output is correct
18 Correct 50 ms 1820 KB Output is correct
19 Correct 74 ms 1656 KB Output is correct
20 Correct 82 ms 1616 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 985 ms 6160 KB Output is correct
2 Correct 979 ms 6256 KB Output is correct
3 Correct 1147 ms 6160 KB Output is correct
4 Correct 918 ms 6604 KB Output is correct
5 Correct 227 ms 9236 KB Output is correct
6 Correct 161 ms 9464 KB Output is correct
7 Correct 984 ms 6284 KB Output is correct
8 Correct 995 ms 6320 KB Output is correct
9 Correct 974 ms 6168 KB Output is correct
10 Correct 1183 ms 4132 KB Output is correct
11 Correct 1281 ms 4744 KB Output is correct
12 Correct 707 ms 7616 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 269 ms 3852 KB Output is correct
2 Correct 226 ms 4052 KB Output is correct
3 Correct 351 ms 4000 KB Output is correct
4 Correct 245 ms 4076 KB Output is correct
5 Correct 463 ms 7728 KB Output is correct
6 Correct 595 ms 7084 KB Output is correct
7 Correct 534 ms 7404 KB Output is correct
8 Correct 170 ms 9416 KB Output is correct
9 Correct 662 ms 9276 KB Output is correct
10 Correct 2009 ms 7968 KB Output is correct
11 Correct 1687 ms 3972 KB Output is correct
12 Correct 2331 ms 7744 KB Output is correct
13 Correct 2331 ms 7664 KB Output is correct
14 Correct 3180 ms 5280 KB Output is correct
15 Correct 3139 ms 4960 KB Output is correct
16 Correct 2914 ms 4472 KB Output is correct
17 Correct 701 ms 6388 KB Output is correct
18 Correct 708 ms 6304 KB Output is correct
19 Correct 703 ms 6292 KB Output is correct
20 Correct 711 ms 6128 KB Output is correct
21 Correct 2067 ms 4160 KB Output is correct
22 Correct 3041 ms 5812 KB Output is correct
23 Correct 2725 ms 7248 KB Output is correct
24 Correct 3327 ms 5872 KB Output is correct
25 Correct 277 ms 4020 KB Output is correct
26 Correct 249 ms 4124 KB Output is correct
27 Correct 264 ms 3976 KB Output is correct
28 Correct 261 ms 4020 KB Output is correct
29 Correct 2514 ms 7468 KB Output is correct
30 Correct 2581 ms 7644 KB Output is correct
31 Correct 623 ms 9452 KB Output is correct
32 Correct 1996 ms 7900 KB Output is correct
33 Correct 2260 ms 7840 KB Output is correct
34 Correct 3101 ms 4940 KB Output is correct
35 Correct 2734 ms 6432 KB Output is correct
36 Correct 2074 ms 7900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 239 ms 3892 KB Output is correct
2 Correct 258 ms 4096 KB Output is correct
3 Correct 243 ms 4016 KB Output is correct
4 Correct 251 ms 3996 KB Output is correct
5 Correct 576 ms 8332 KB Output is correct
6 Correct 1218 ms 3680 KB Output is correct
7 Correct 455 ms 8600 KB Output is correct
8 Correct 1174 ms 4180 KB Output is correct
9 Correct 3132 ms 5672 KB Output is correct
10 Correct 1782 ms 7972 KB Output is correct
11 Correct 2851 ms 4208 KB Output is correct
12 Correct 357 ms 9488 KB Output is correct
13 Correct 2376 ms 7736 KB Output is correct
14 Correct 3203 ms 5668 KB Output is correct
15 Correct 777 ms 9364 KB Output is correct
16 Correct 2226 ms 7736 KB Output is correct
17 Correct 981 ms 6484 KB Output is correct
18 Correct 970 ms 6304 KB Output is correct
19 Correct 993 ms 6468 KB Output is correct
20 Correct 983 ms 6432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1272 KB Output is correct
2 Correct 15 ms 1272 KB Output is correct
3 Correct 13 ms 1528 KB Output is correct
4 Correct 10 ms 1532 KB Output is correct
5 Correct 15 ms 1912 KB Output is correct
6 Correct 19 ms 1784 KB Output is correct
7 Correct 38 ms 1656 KB Output is correct
8 Correct 70 ms 1656 KB Output is correct
9 Correct 84 ms 1784 KB Output is correct
10 Correct 31 ms 1912 KB Output is correct
11 Correct 27 ms 1656 KB Output is correct
12 Correct 26 ms 1656 KB Output is correct
13 Correct 32 ms 1912 KB Output is correct
14 Correct 85 ms 1660 KB Output is correct
15 Correct 10 ms 1528 KB Output is correct
16 Correct 12 ms 1528 KB Output is correct
17 Correct 59 ms 1692 KB Output is correct
18 Correct 50 ms 1820 KB Output is correct
19 Correct 74 ms 1656 KB Output is correct
20 Correct 82 ms 1616 KB Output is correct
21 Correct 985 ms 6160 KB Output is correct
22 Correct 979 ms 6256 KB Output is correct
23 Correct 1147 ms 6160 KB Output is correct
24 Correct 918 ms 6604 KB Output is correct
25 Correct 227 ms 9236 KB Output is correct
26 Correct 161 ms 9464 KB Output is correct
27 Correct 984 ms 6284 KB Output is correct
28 Correct 995 ms 6320 KB Output is correct
29 Correct 974 ms 6168 KB Output is correct
30 Correct 1183 ms 4132 KB Output is correct
31 Correct 1281 ms 4744 KB Output is correct
32 Correct 707 ms 7616 KB Output is correct
33 Correct 239 ms 3892 KB Output is correct
34 Correct 258 ms 4096 KB Output is correct
35 Correct 243 ms 4016 KB Output is correct
36 Correct 251 ms 3996 KB Output is correct
37 Correct 576 ms 8332 KB Output is correct
38 Correct 1218 ms 3680 KB Output is correct
39 Correct 455 ms 8600 KB Output is correct
40 Correct 1174 ms 4180 KB Output is correct
41 Correct 3132 ms 5672 KB Output is correct
42 Correct 1782 ms 7972 KB Output is correct
43 Correct 2851 ms 4208 KB Output is correct
44 Correct 357 ms 9488 KB Output is correct
45 Correct 2376 ms 7736 KB Output is correct
46 Correct 3203 ms 5668 KB Output is correct
47 Correct 777 ms 9364 KB Output is correct
48 Correct 2226 ms 7736 KB Output is correct
49 Correct 981 ms 6484 KB Output is correct
50 Correct 970 ms 6304 KB Output is correct
51 Correct 993 ms 6468 KB Output is correct
52 Correct 983 ms 6432 KB Output is correct
53 Correct 268 ms 3852 KB Output is correct
54 Correct 264 ms 3892 KB Output is correct
55 Correct 228 ms 3764 KB Output is correct
56 Correct 248 ms 3764 KB Output is correct
57 Correct 1125 ms 5164 KB Output is correct
58 Correct 1127 ms 3320 KB Output is correct
59 Correct 844 ms 7108 KB Output is correct
60 Correct 1083 ms 3320 KB Output is correct
61 Correct 2426 ms 7716 KB Output is correct
62 Correct 943 ms 8976 KB Output is correct
63 Correct 548 ms 9484 KB Output is correct
64 Correct 891 ms 8972 KB Output is correct
65 Correct 3087 ms 4808 KB Output is correct
66 Correct 2920 ms 4524 KB Output is correct
67 Correct 2176 ms 7328 KB Output is correct
68 Correct 2824 ms 5920 KB Output is correct
69 Correct 982 ms 5664 KB Output is correct
70 Correct 963 ms 5528 KB Output is correct
71 Correct 972 ms 5664 KB Output is correct
72 Correct 972 ms 5676 KB Output is correct
73 Correct 3259 ms 4340 KB Output is correct
74 Correct 2895 ms 5804 KB Output is correct
75 Correct 210 ms 9104 KB Output is correct
76 Correct 524 ms 8720 KB Output is correct
77 Correct 252 ms 3376 KB Output is correct
78 Correct 299 ms 3252 KB Output is correct
79 Correct 268 ms 3252 KB Output is correct
80 Correct 248 ms 3356 KB Output is correct
81 Correct 2932 ms 5660 KB Output is correct
82 Correct 3294 ms 4288 KB Output is correct
83 Correct 2910 ms 3712 KB Output is correct
84 Correct 2910 ms 5784 KB Output is correct
85 Correct 2160 ms 7200 KB Output is correct
86 Correct 1994 ms 7112 KB Output is correct
87 Correct 3336 ms 5024 KB Output is correct
88 Correct 3233 ms 3632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1272 KB Output is correct
2 Correct 15 ms 1272 KB Output is correct
3 Correct 13 ms 1528 KB Output is correct
4 Correct 10 ms 1532 KB Output is correct
5 Correct 15 ms 1912 KB Output is correct
6 Correct 19 ms 1784 KB Output is correct
7 Correct 38 ms 1656 KB Output is correct
8 Correct 70 ms 1656 KB Output is correct
9 Correct 84 ms 1784 KB Output is correct
10 Correct 31 ms 1912 KB Output is correct
11 Correct 27 ms 1656 KB Output is correct
12 Correct 26 ms 1656 KB Output is correct
13 Correct 32 ms 1912 KB Output is correct
14 Correct 85 ms 1660 KB Output is correct
15 Correct 10 ms 1528 KB Output is correct
16 Correct 12 ms 1528 KB Output is correct
17 Correct 59 ms 1692 KB Output is correct
18 Correct 50 ms 1820 KB Output is correct
19 Correct 74 ms 1656 KB Output is correct
20 Correct 82 ms 1616 KB Output is correct
21 Correct 985 ms 6160 KB Output is correct
22 Correct 979 ms 6256 KB Output is correct
23 Correct 1147 ms 6160 KB Output is correct
24 Correct 918 ms 6604 KB Output is correct
25 Correct 227 ms 9236 KB Output is correct
26 Correct 161 ms 9464 KB Output is correct
27 Correct 984 ms 6284 KB Output is correct
28 Correct 995 ms 6320 KB Output is correct
29 Correct 974 ms 6168 KB Output is correct
30 Correct 1183 ms 4132 KB Output is correct
31 Correct 1281 ms 4744 KB Output is correct
32 Correct 707 ms 7616 KB Output is correct
33 Correct 269 ms 3852 KB Output is correct
34 Correct 226 ms 4052 KB Output is correct
35 Correct 351 ms 4000 KB Output is correct
36 Correct 245 ms 4076 KB Output is correct
37 Correct 463 ms 7728 KB Output is correct
38 Correct 595 ms 7084 KB Output is correct
39 Correct 534 ms 7404 KB Output is correct
40 Correct 170 ms 9416 KB Output is correct
41 Correct 662 ms 9276 KB Output is correct
42 Correct 2009 ms 7968 KB Output is correct
43 Correct 1687 ms 3972 KB Output is correct
44 Correct 2331 ms 7744 KB Output is correct
45 Correct 2331 ms 7664 KB Output is correct
46 Correct 3180 ms 5280 KB Output is correct
47 Correct 3139 ms 4960 KB Output is correct
48 Correct 2914 ms 4472 KB Output is correct
49 Correct 701 ms 6388 KB Output is correct
50 Correct 708 ms 6304 KB Output is correct
51 Correct 703 ms 6292 KB Output is correct
52 Correct 711 ms 6128 KB Output is correct
53 Correct 2067 ms 4160 KB Output is correct
54 Correct 3041 ms 5812 KB Output is correct
55 Correct 2725 ms 7248 KB Output is correct
56 Correct 3327 ms 5872 KB Output is correct
57 Correct 277 ms 4020 KB Output is correct
58 Correct 249 ms 4124 KB Output is correct
59 Correct 264 ms 3976 KB Output is correct
60 Correct 261 ms 4020 KB Output is correct
61 Correct 2514 ms 7468 KB Output is correct
62 Correct 2581 ms 7644 KB Output is correct
63 Correct 623 ms 9452 KB Output is correct
64 Correct 1996 ms 7900 KB Output is correct
65 Correct 2260 ms 7840 KB Output is correct
66 Correct 3101 ms 4940 KB Output is correct
67 Correct 2734 ms 6432 KB Output is correct
68 Correct 2074 ms 7900 KB Output is correct
69 Correct 239 ms 3892 KB Output is correct
70 Correct 258 ms 4096 KB Output is correct
71 Correct 243 ms 4016 KB Output is correct
72 Correct 251 ms 3996 KB Output is correct
73 Correct 576 ms 8332 KB Output is correct
74 Correct 1218 ms 3680 KB Output is correct
75 Correct 455 ms 8600 KB Output is correct
76 Correct 1174 ms 4180 KB Output is correct
77 Correct 3132 ms 5672 KB Output is correct
78 Correct 1782 ms 7972 KB Output is correct
79 Correct 2851 ms 4208 KB Output is correct
80 Correct 357 ms 9488 KB Output is correct
81 Correct 2376 ms 7736 KB Output is correct
82 Correct 3203 ms 5668 KB Output is correct
83 Correct 777 ms 9364 KB Output is correct
84 Correct 2226 ms 7736 KB Output is correct
85 Correct 981 ms 6484 KB Output is correct
86 Correct 970 ms 6304 KB Output is correct
87 Correct 993 ms 6468 KB Output is correct
88 Correct 983 ms 6432 KB Output is correct
89 Correct 268 ms 3852 KB Output is correct
90 Correct 264 ms 3892 KB Output is correct
91 Correct 228 ms 3764 KB Output is correct
92 Correct 248 ms 3764 KB Output is correct
93 Correct 1125 ms 5164 KB Output is correct
94 Correct 1127 ms 3320 KB Output is correct
95 Correct 844 ms 7108 KB Output is correct
96 Correct 1083 ms 3320 KB Output is correct
97 Correct 2426 ms 7716 KB Output is correct
98 Correct 943 ms 8976 KB Output is correct
99 Correct 548 ms 9484 KB Output is correct
100 Correct 891 ms 8972 KB Output is correct
101 Correct 3087 ms 4808 KB Output is correct
102 Correct 2920 ms 4524 KB Output is correct
103 Correct 2176 ms 7328 KB Output is correct
104 Correct 2824 ms 5920 KB Output is correct
105 Correct 982 ms 5664 KB Output is correct
106 Correct 963 ms 5528 KB Output is correct
107 Correct 972 ms 5664 KB Output is correct
108 Correct 972 ms 5676 KB Output is correct
109 Correct 3259 ms 4340 KB Output is correct
110 Correct 2895 ms 5804 KB Output is correct
111 Correct 210 ms 9104 KB Output is correct
112 Correct 524 ms 8720 KB Output is correct
113 Correct 252 ms 3376 KB Output is correct
114 Correct 299 ms 3252 KB Output is correct
115 Correct 268 ms 3252 KB Output is correct
116 Correct 248 ms 3356 KB Output is correct
117 Correct 2932 ms 5660 KB Output is correct
118 Correct 3294 ms 4288 KB Output is correct
119 Correct 2910 ms 3712 KB Output is correct
120 Correct 2910 ms 5784 KB Output is correct
121 Correct 2160 ms 7200 KB Output is correct
122 Correct 1994 ms 7112 KB Output is correct
123 Correct 3336 ms 5024 KB Output is correct
124 Correct 3233 ms 3632 KB Output is correct
125 Correct 713 ms 4904 KB Output is correct
126 Correct 745 ms 4916 KB Output is correct
127 Correct 833 ms 4908 KB Output is correct
128 Correct 764 ms 4908 KB Output is correct
129 Correct 665 ms 4920 KB Output is correct
130 Correct 749 ms 4884 KB Output is correct
131 Correct 2762 ms 4016 KB Output is correct
132 Correct 2778 ms 8892 KB Output is correct
133 Correct 2077 ms 11924 KB Output is correct
134 Correct 2759 ms 4880 KB Output is correct
135 Correct 1938 ms 12432 KB Output is correct
136 Correct 2012 ms 2680 KB Output is correct
137 Correct 2005 ms 15360 KB Output is correct
138 Execution timed out 5017 ms 10636 KB Time limit exceeded
139 Halted 0 ms 0 KB -