Submission #917230

# Submission time Handle Problem Language Result Execution time Memory
917230 2024-01-27T13:52:36 Z thangdz2k7 Fish 2 (JOI22_fish2) C++17
100 / 100
1712 ms 38484 KB
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15 + 5;
const int N = 1e5 + 5;
int n, q;
long long a[N];
set<int> rp[N], lp[N];
namespace ST {
	pair<int, int> t[N << 2];
	int lazy[N << 2];
	inline pair<int, int> operator+(const pair<int, int> &lhs, const pair<int, int> &rhs) {
		if (lhs.first != rhs.first) return min(lhs, rhs);
		return {lhs.first, lhs.second + rhs.second}; 
	}
	inline void push_up(int p) {
		t[p] = t[p << 1] + t[p << 1 | 1];
	}
	inline void tag(int p, int x) {
		t[p].first += x;
		lazy[p] += x;
	}
	inline void push_down(int p) {
		if (lazy[p]) {
			tag(p << 1, lazy[p]);
			tag(p << 1 | 1, lazy[p]);
			lazy[p] = 0;
		}
	}
	void build(int p, int l, int r) {
		t[p].second = r - l + 1;
		if (l == r) return;
		int mid = (l + r) >> 1;
		build(p << 1, l, mid);
		build(p << 1 | 1, mid + 1, r);
	}
	void modify(int p, int l, int r, int ll, int rr, int x) {
		if (l >= ll && r <= rr) {
			tag(p, x);
			return;
		}
		push_down(p);
		int mid = (l + r) >> 1;
		if (mid >= ll) modify(p << 1, l, mid, ll, rr, x);
		if (mid < rr) modify(p << 1 | 1, mid + 1, r, ll, rr, x);
		push_up(p);
	}
	pair<int, int> query(int p, int l, int r, int ll, int rr) {
		if (l >= ll && r <= rr) return t[p];
		push_down(p);
		int mid = (l + r) >> 1;
		if (mid >= ll && mid < rr) return query(p << 1, l, mid, ll, rr) + query(p << 1 | 1, mid + 1, r, ll, rr);
		if (mid >= ll) return query(p << 1, l, mid, ll, rr);
		return query(p << 1 | 1, mid + 1, r, ll, rr); 
	}
}
namespace BIT {
	long long c[N];
	inline void modify(int p, long long x) {
		for (; p <= n; p += p & -p)
			c[p] += x;
	}
	inline long long query(int p) {
		long long res = 0;
		for (; p; p -= p & -p)
			res += c[p];
		return res;
	}
	inline long long query(int l, int r) {
		return query(r) - query(l - 1);
	}
}
namespace ST1 {
	long long val[N << 2], lazy[N << 2];
	inline void push_up(int p) {
		val[p] = min(val[p << 1], val[p << 1 | 1]);
	}
	inline void tag(int p, long long x) {
		val[p] += x;
		lazy[p] += x;
	}
	inline void push_down(int p) {
		if (lazy[p]) {
			tag(p << 1, lazy[p]);
			tag(p << 1 | 1, lazy[p]);
			lazy[p] = 0;
		}
	}
	void modify(int p, int l, int r, int ll, int rr, long long x) {
		if (l >= ll && r <= rr) {
			tag(p, x);
			return;
		}
		push_down(p);
		int mid = (l + r) >> 1;
		if (mid >= ll) modify(p << 1, l, mid, ll, rr, x);
		if (mid < rr) modify(p << 1 | 1, mid + 1, r, ll, rr, x);
		push_up(p);
	}
	long long find_l(int p, int l, int r, int pos, long long x) {
		if (val[p] >= x) return -1;
		if (l == r) return l;
		push_down(p);
		int mid = (l + r) >> 1;
		if (pos <= mid) return find_l(p << 1, l, mid, pos, x);
		int res = find_l(p << 1 | 1, mid + 1, r, pos, x);
		return ~res ? res : find_l(p << 1, l, mid, pos, x); 
	}
	long long find_r(int p, int l, int r, int pos, long long x) {
		if (val[p] >= x) return -1;
		if (l == r) return l;
		push_down(p);
		int mid = (l + r) >> 1;
		if (pos > mid) return find_r(p << 1 | 1, mid + 1, r, pos, x);
		int res = find_r(p << 1, l, mid, pos, x);
		return ~res ? res : find_r(p << 1 | 1, mid + 1, r, pos, x);
	}
}
namespace ST2 {
	long long val[N << 2], lazy[N << 2];
	inline void push_up(int p) {
		val[p] = max(val[p << 1], val[p << 1 | 1]);
	}
	inline void tag(int p, long long x) {
		val[p] += x;
		lazy[p] += x;
	}
	inline void push_down(int p) {
		if (lazy[p]) {
			tag(p << 1, lazy[p]);
			tag(p << 1 | 1, lazy[p]);
			lazy[p] = 0;
		}
	}
	void modify(int p, int l, int r, int ll, int rr, long long x) {
		if (l >= ll && r <= rr) {
			tag(p, x);
			return;
		}
		push_down(p);
		int mid = (l + r) >> 1;
		if (mid >= ll) modify(p << 1, l, mid, ll, rr, x);
		if (mid < rr) modify(p << 1 | 1, mid + 1, r, ll, rr, x);
		push_up(p);
	}
	long long find_l(int p, int l, int r, int pos, long long x) {
		if (val[p] <= x) return -1;
		if (l == r) return l;
		push_down(p);
		int mid = (l + r) >> 1;
		if (pos <= mid) return find_l(p << 1, l, mid, pos, x);
		int res = find_l(p << 1 | 1, mid + 1, r, pos, x);
		return ~res ? res : find_l(p << 1, l, mid, pos, x); 
	}
	long long find_r(int p, int l, int r, int pos, long long x) {
		if (val[p] <= x) return -1;
		if (l == r) return l;
		push_down(p);
		int mid = (l + r) >> 1;
		if (pos > mid) return find_r(p << 1 | 1, mid + 1, r, pos, x);
		int res = find_r(p << 1, l, mid, pos, x);
		return ~res ? res : find_r(p << 1 | 1, mid + 1, r, pos, x);
	}
}
inline bool judge(int l, int r) {
	if (r - l <= 1) return false;
	return BIT::query(l + 1, r - 1) < min(a[l], a[r]);
}
void modify_seg(int l, int r, int x) {
	ST::modify(1, 1, n, l + 1, r - 1, x);
	if (x == 1) {
		lp[l].insert(r);
		rp[r].insert(l);
	} else {
		lp[l].erase(r);
		rp[r].erase(l);
	} 
}
int find_r(int l, int r) {
	return ST1::find_r(1, 0, n + 1, r + 1, BIT::query(l));
}
int find_l(int l, int r) {
	return ST2::find_l(1, 0, n + 1, l - 1, BIT::query(r - 1));
}
void check(int pos, int x) {
	int l = pos - 1, r = pos + 1;
	while (true) {
		if (judge(l, r)) modify_seg(l, r, x);
		if (l == 0 && r == n + 1) break;
		if (a[l] < a[r]) l = find_l(l, r);	
		else r = find_r(l, r);
	}
}
void modify(int pos, long long x) {
	check(pos, -1);
	BIT::modify(pos, x - a[pos]);
	ST1::modify(1, 0, n + 1, pos + 1, n + 1, x - a[pos]);
	ST1::modify(1, 0, n + 1, pos, pos, -(x - a[pos]));
	ST2::modify(1, 0, n + 1, pos, n + 1, x - a[pos]);
	ST2::modify(1, 0, n + 1, pos, pos, x - a[pos]);
	a[pos] = x;
	while (!rp[pos].empty()) {
		int l = *rp[pos].begin();
		modify_seg(l, pos, -1);
	}
	while (!lp[pos].empty()) {
		int r = *lp[pos].begin();
		modify_seg(pos, r, -1);
	}
	lp[pos].clear(), rp[pos].clear();
	int r = find_r(pos, pos + 1);
	while (true) {
		if (judge(pos, r)) modify_seg(pos, r, 1);
		if (r == n + 1) break;
		r = find_r(pos, r);
	} 
	int l = find_l(pos - 1, pos);
	while (true) {
		if (judge(l, pos)) modify_seg(l, pos, 1);
		if (l == 0) break;
		l = find_l(l, pos); 
	}
	check(pos, 1);
}
int main() {
	scanf("%d", &n);
	ST::build(1, 1, n);
	a[0] = a[n + 1] = inf;
	ST1::modify(1, 0, n + 1, n + 1, n + 1, -inf);
	ST2::modify(1, 0, n + 1, 0, 0, inf);
	modify_seg(0, n + 1, 1);
	long long tmp;
	for (int i = 1; i <= n; ++i)
		scanf("%lld", &tmp), modify(i, tmp);
	scanf("%d", &q);
	while (q--) {
		int op, x, y;
		scanf("%d%d%d", &op, &x, &y);
		if (op == 1) {
			modify(x, y);
		} else {
			int l = ST1::find_l(1, 0, n + 1, y, BIT::query(x - 1));
			int r = ST2::find_r(1, 0, n + 1, x, BIT::query(y));
			printf("%d\n", ST::query(1, 1, n, l, r).second);
		}
	}
	return 0;
}

Compilation message

fish2.cpp: In function 'int main()':
fish2.cpp:225:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  225 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
fish2.cpp:233:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  233 |   scanf("%lld", &tmp), modify(i, tmp);
      |   ~~~~~^~~~~~~~~~~~~~
fish2.cpp:234:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  234 |  scanf("%d", &q);
      |  ~~~~~^~~~~~~~~~
fish2.cpp:237:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  237 |   scanf("%d%d%d", &op, &x, &y);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 6 ms 17244 KB Output is correct
2 Correct 4 ms 17244 KB Output is correct
3 Correct 5 ms 17244 KB Output is correct
4 Correct 4 ms 17244 KB Output is correct
5 Correct 8 ms 17500 KB Output is correct
6 Correct 6 ms 17500 KB Output is correct
7 Correct 8 ms 17500 KB Output is correct
8 Correct 7 ms 17500 KB Output is correct
9 Correct 6 ms 17500 KB Output is correct
10 Correct 6 ms 17652 KB Output is correct
11 Correct 5 ms 17500 KB Output is correct
12 Correct 7 ms 17500 KB Output is correct
13 Correct 6 ms 17500 KB Output is correct
14 Correct 8 ms 17500 KB Output is correct
15 Correct 9 ms 17500 KB Output is correct
16 Correct 8 ms 17244 KB Output is correct
17 Correct 7 ms 17492 KB Output is correct
18 Correct 6 ms 17496 KB Output is correct
19 Correct 6 ms 17500 KB Output is correct
20 Correct 6 ms 17500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 17244 KB Output is correct
2 Correct 315 ms 35412 KB Output is correct
3 Correct 485 ms 34404 KB Output is correct
4 Correct 311 ms 35504 KB Output is correct
5 Correct 481 ms 34640 KB Output is correct
6 Correct 279 ms 32084 KB Output is correct
7 Correct 543 ms 29744 KB Output is correct
8 Correct 275 ms 32084 KB Output is correct
9 Correct 563 ms 29712 KB Output is correct
10 Correct 773 ms 31480 KB Output is correct
11 Correct 930 ms 30736 KB Output is correct
12 Correct 419 ms 30920 KB Output is correct
13 Correct 372 ms 30804 KB Output is correct
14 Correct 321 ms 33796 KB Output is correct
15 Correct 342 ms 33828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 17244 KB Output is correct
2 Correct 4 ms 17244 KB Output is correct
3 Correct 5 ms 17244 KB Output is correct
4 Correct 4 ms 17244 KB Output is correct
5 Correct 8 ms 17500 KB Output is correct
6 Correct 6 ms 17500 KB Output is correct
7 Correct 8 ms 17500 KB Output is correct
8 Correct 7 ms 17500 KB Output is correct
9 Correct 6 ms 17500 KB Output is correct
10 Correct 6 ms 17652 KB Output is correct
11 Correct 5 ms 17500 KB Output is correct
12 Correct 7 ms 17500 KB Output is correct
13 Correct 6 ms 17500 KB Output is correct
14 Correct 8 ms 17500 KB Output is correct
15 Correct 9 ms 17500 KB Output is correct
16 Correct 8 ms 17244 KB Output is correct
17 Correct 7 ms 17492 KB Output is correct
18 Correct 6 ms 17496 KB Output is correct
19 Correct 6 ms 17500 KB Output is correct
20 Correct 6 ms 17500 KB Output is correct
21 Correct 4 ms 17244 KB Output is correct
22 Correct 315 ms 35412 KB Output is correct
23 Correct 485 ms 34404 KB Output is correct
24 Correct 311 ms 35504 KB Output is correct
25 Correct 481 ms 34640 KB Output is correct
26 Correct 279 ms 32084 KB Output is correct
27 Correct 543 ms 29744 KB Output is correct
28 Correct 275 ms 32084 KB Output is correct
29 Correct 563 ms 29712 KB Output is correct
30 Correct 773 ms 31480 KB Output is correct
31 Correct 930 ms 30736 KB Output is correct
32 Correct 419 ms 30920 KB Output is correct
33 Correct 372 ms 30804 KB Output is correct
34 Correct 321 ms 33796 KB Output is correct
35 Correct 342 ms 33828 KB Output is correct
36 Correct 331 ms 36704 KB Output is correct
37 Correct 504 ms 34596 KB Output is correct
38 Correct 502 ms 33996 KB Output is correct
39 Correct 329 ms 36640 KB Output is correct
40 Correct 486 ms 33872 KB Output is correct
41 Correct 278 ms 32104 KB Output is correct
42 Correct 274 ms 31992 KB Output is correct
43 Correct 541 ms 29732 KB Output is correct
44 Correct 506 ms 29524 KB Output is correct
45 Correct 805 ms 32068 KB Output is correct
46 Correct 815 ms 31232 KB Output is correct
47 Correct 918 ms 29088 KB Output is correct
48 Correct 387 ms 31248 KB Output is correct
49 Correct 395 ms 30856 KB Output is correct
50 Correct 323 ms 33872 KB Output is correct
51 Correct 328 ms 33872 KB Output is correct
52 Correct 326 ms 33804 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 17244 KB Output is correct
2 Correct 315 ms 35412 KB Output is correct
3 Correct 485 ms 34404 KB Output is correct
4 Correct 311 ms 35504 KB Output is correct
5 Correct 481 ms 34640 KB Output is correct
6 Correct 279 ms 32084 KB Output is correct
7 Correct 543 ms 29744 KB Output is correct
8 Correct 275 ms 32084 KB Output is correct
9 Correct 563 ms 29712 KB Output is correct
10 Correct 773 ms 31480 KB Output is correct
11 Correct 930 ms 30736 KB Output is correct
12 Correct 419 ms 30920 KB Output is correct
13 Correct 372 ms 30804 KB Output is correct
14 Correct 321 ms 33796 KB Output is correct
15 Correct 342 ms 33828 KB Output is correct
16 Correct 4 ms 17244 KB Output is correct
17 Correct 595 ms 36160 KB Output is correct
18 Correct 442 ms 38484 KB Output is correct
19 Correct 583 ms 36436 KB Output is correct
20 Correct 598 ms 36212 KB Output is correct
21 Correct 595 ms 36280 KB Output is correct
22 Correct 423 ms 38348 KB Output is correct
23 Correct 585 ms 35972 KB Output is correct
24 Correct 584 ms 36700 KB Output is correct
25 Correct 577 ms 36436 KB Output is correct
26 Correct 580 ms 36688 KB Output is correct
27 Correct 426 ms 34080 KB Output is correct
28 Correct 373 ms 33876 KB Output is correct
29 Correct 402 ms 33952 KB Output is correct
30 Correct 699 ms 31352 KB Output is correct
31 Correct 609 ms 31188 KB Output is correct
32 Correct 1024 ms 32464 KB Output is correct
33 Correct 924 ms 33108 KB Output is correct
34 Correct 1010 ms 31936 KB Output is correct
35 Correct 1038 ms 31440 KB Output is correct
36 Correct 906 ms 33520 KB Output is correct
37 Correct 458 ms 32664 KB Output is correct
38 Correct 448 ms 32356 KB Output is correct
39 Correct 428 ms 35856 KB Output is correct
40 Correct 414 ms 35488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 17244 KB Output is correct
2 Correct 315 ms 35412 KB Output is correct
3 Correct 485 ms 34404 KB Output is correct
4 Correct 311 ms 35504 KB Output is correct
5 Correct 481 ms 34640 KB Output is correct
6 Correct 279 ms 32084 KB Output is correct
7 Correct 543 ms 29744 KB Output is correct
8 Correct 275 ms 32084 KB Output is correct
9 Correct 563 ms 29712 KB Output is correct
10 Correct 773 ms 31480 KB Output is correct
11 Correct 930 ms 30736 KB Output is correct
12 Correct 419 ms 30920 KB Output is correct
13 Correct 372 ms 30804 KB Output is correct
14 Correct 321 ms 33796 KB Output is correct
15 Correct 342 ms 33828 KB Output is correct
16 Correct 4 ms 17244 KB Output is correct
17 Correct 1303 ms 36760 KB Output is correct
18 Correct 1283 ms 37240 KB Output is correct
19 Correct 1186 ms 35960 KB Output is correct
20 Correct 1112 ms 37140 KB Output is correct
21 Correct 1269 ms 36716 KB Output is correct
22 Correct 1277 ms 36948 KB Output is correct
23 Correct 1281 ms 36028 KB Output is correct
24 Correct 1247 ms 36944 KB Output is correct
25 Correct 1180 ms 35532 KB Output is correct
26 Correct 584 ms 33876 KB Output is correct
27 Correct 684 ms 33784 KB Output is correct
28 Correct 1008 ms 34856 KB Output is correct
29 Correct 639 ms 33876 KB Output is correct
30 Correct 674 ms 33740 KB Output is correct
31 Correct 1301 ms 34764 KB Output is correct
32 Correct 1712 ms 35688 KB Output is correct
33 Correct 1229 ms 31844 KB Output is correct
34 Correct 1471 ms 36500 KB Output is correct
35 Correct 1033 ms 32468 KB Output is correct
36 Correct 1605 ms 35240 KB Output is correct
37 Correct 964 ms 34564 KB Output is correct
38 Correct 779 ms 34104 KB Output is correct
39 Correct 702 ms 35668 KB Output is correct
40 Correct 517 ms 35744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 17244 KB Output is correct
2 Correct 4 ms 17244 KB Output is correct
3 Correct 5 ms 17244 KB Output is correct
4 Correct 4 ms 17244 KB Output is correct
5 Correct 8 ms 17500 KB Output is correct
6 Correct 6 ms 17500 KB Output is correct
7 Correct 8 ms 17500 KB Output is correct
8 Correct 7 ms 17500 KB Output is correct
9 Correct 6 ms 17500 KB Output is correct
10 Correct 6 ms 17652 KB Output is correct
11 Correct 5 ms 17500 KB Output is correct
12 Correct 7 ms 17500 KB Output is correct
13 Correct 6 ms 17500 KB Output is correct
14 Correct 8 ms 17500 KB Output is correct
15 Correct 9 ms 17500 KB Output is correct
16 Correct 8 ms 17244 KB Output is correct
17 Correct 7 ms 17492 KB Output is correct
18 Correct 6 ms 17496 KB Output is correct
19 Correct 6 ms 17500 KB Output is correct
20 Correct 6 ms 17500 KB Output is correct
21 Correct 4 ms 17244 KB Output is correct
22 Correct 315 ms 35412 KB Output is correct
23 Correct 485 ms 34404 KB Output is correct
24 Correct 311 ms 35504 KB Output is correct
25 Correct 481 ms 34640 KB Output is correct
26 Correct 279 ms 32084 KB Output is correct
27 Correct 543 ms 29744 KB Output is correct
28 Correct 275 ms 32084 KB Output is correct
29 Correct 563 ms 29712 KB Output is correct
30 Correct 773 ms 31480 KB Output is correct
31 Correct 930 ms 30736 KB Output is correct
32 Correct 419 ms 30920 KB Output is correct
33 Correct 372 ms 30804 KB Output is correct
34 Correct 321 ms 33796 KB Output is correct
35 Correct 342 ms 33828 KB Output is correct
36 Correct 331 ms 36704 KB Output is correct
37 Correct 504 ms 34596 KB Output is correct
38 Correct 502 ms 33996 KB Output is correct
39 Correct 329 ms 36640 KB Output is correct
40 Correct 486 ms 33872 KB Output is correct
41 Correct 278 ms 32104 KB Output is correct
42 Correct 274 ms 31992 KB Output is correct
43 Correct 541 ms 29732 KB Output is correct
44 Correct 506 ms 29524 KB Output is correct
45 Correct 805 ms 32068 KB Output is correct
46 Correct 815 ms 31232 KB Output is correct
47 Correct 918 ms 29088 KB Output is correct
48 Correct 387 ms 31248 KB Output is correct
49 Correct 395 ms 30856 KB Output is correct
50 Correct 323 ms 33872 KB Output is correct
51 Correct 328 ms 33872 KB Output is correct
52 Correct 326 ms 33804 KB Output is correct
53 Correct 4 ms 17244 KB Output is correct
54 Correct 595 ms 36160 KB Output is correct
55 Correct 442 ms 38484 KB Output is correct
56 Correct 583 ms 36436 KB Output is correct
57 Correct 598 ms 36212 KB Output is correct
58 Correct 595 ms 36280 KB Output is correct
59 Correct 423 ms 38348 KB Output is correct
60 Correct 585 ms 35972 KB Output is correct
61 Correct 584 ms 36700 KB Output is correct
62 Correct 577 ms 36436 KB Output is correct
63 Correct 580 ms 36688 KB Output is correct
64 Correct 426 ms 34080 KB Output is correct
65 Correct 373 ms 33876 KB Output is correct
66 Correct 402 ms 33952 KB Output is correct
67 Correct 699 ms 31352 KB Output is correct
68 Correct 609 ms 31188 KB Output is correct
69 Correct 1024 ms 32464 KB Output is correct
70 Correct 924 ms 33108 KB Output is correct
71 Correct 1010 ms 31936 KB Output is correct
72 Correct 1038 ms 31440 KB Output is correct
73 Correct 906 ms 33520 KB Output is correct
74 Correct 458 ms 32664 KB Output is correct
75 Correct 448 ms 32356 KB Output is correct
76 Correct 428 ms 35856 KB Output is correct
77 Correct 414 ms 35488 KB Output is correct
78 Correct 4 ms 17244 KB Output is correct
79 Correct 1303 ms 36760 KB Output is correct
80 Correct 1283 ms 37240 KB Output is correct
81 Correct 1186 ms 35960 KB Output is correct
82 Correct 1112 ms 37140 KB Output is correct
83 Correct 1269 ms 36716 KB Output is correct
84 Correct 1277 ms 36948 KB Output is correct
85 Correct 1281 ms 36028 KB Output is correct
86 Correct 1247 ms 36944 KB Output is correct
87 Correct 1180 ms 35532 KB Output is correct
88 Correct 584 ms 33876 KB Output is correct
89 Correct 684 ms 33784 KB Output is correct
90 Correct 1008 ms 34856 KB Output is correct
91 Correct 639 ms 33876 KB Output is correct
92 Correct 674 ms 33740 KB Output is correct
93 Correct 1301 ms 34764 KB Output is correct
94 Correct 1712 ms 35688 KB Output is correct
95 Correct 1229 ms 31844 KB Output is correct
96 Correct 1471 ms 36500 KB Output is correct
97 Correct 1033 ms 32468 KB Output is correct
98 Correct 1605 ms 35240 KB Output is correct
99 Correct 964 ms 34564 KB Output is correct
100 Correct 779 ms 34104 KB Output is correct
101 Correct 702 ms 35668 KB Output is correct
102 Correct 517 ms 35744 KB Output is correct
103 Correct 1442 ms 34916 KB Output is correct
104 Correct 1054 ms 38216 KB Output is correct
105 Correct 709 ms 36432 KB Output is correct
106 Correct 753 ms 37348 KB Output is correct
107 Correct 1286 ms 35644 KB Output is correct
108 Correct 1059 ms 38480 KB Output is correct
109 Correct 869 ms 35888 KB Output is correct
110 Correct 930 ms 37380 KB Output is correct
111 Correct 708 ms 36672 KB Output is correct
112 Correct 744 ms 37236 KB Output is correct
113 Correct 626 ms 33912 KB Output is correct
114 Correct 440 ms 33948 KB Output is correct
115 Correct 1173 ms 34688 KB Output is correct
116 Correct 933 ms 34504 KB Output is correct
117 Correct 480 ms 33992 KB Output is correct
118 Correct 708 ms 33144 KB Output is correct
119 Correct 709 ms 33888 KB Output is correct
120 Correct 1116 ms 34848 KB Output is correct
121 Correct 898 ms 34496 KB Output is correct
122 Correct 1698 ms 35968 KB Output is correct
123 Correct 1212 ms 31708 KB Output is correct
124 Correct 1246 ms 34040 KB Output is correct
125 Correct 1077 ms 31200 KB Output is correct
126 Correct 1164 ms 33892 KB Output is correct
127 Correct 1014 ms 34552 KB Output is correct
128 Correct 545 ms 33020 KB Output is correct
129 Correct 716 ms 35692 KB Output is correct
130 Correct 531 ms 35676 KB Output is correct