답안 #654314

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
654314 2022-10-30T23:28:15 Z resting 송신탑 (IOI22_towers) C++17
41 / 100
3350 ms 538628 KB
#include <bits/stdc++.h>

using namespace std;
#define ll long long

#define mx 100005

struct tree {
	struct node {
		node(int l, int r) : l(l), r(r) {}
		int l = 0; int r = 0; int v = 0;
		node* lc = nullptr;
		node* rc = nullptr;
	};
	vector<node*> rt;
	vector<int> nums;

	tree() {
		nums.push_back(numeric_limits<int>::min());
		rt.push_back(build(0, mx));
	}
	void upd(int idx, int val, int v) {
		//cout << "index: " << idx << "," << "value: " << val << "," << "time: " << v << endl;
		nums.push_back(v); // v = time
		rt.push_back(upd2(rt.back(), idx, val));
	}

	node* build(int l, int r) {
		node* rt = new node(l, r);
		if (l == r) return rt;
		int m = (l + r) / 2;
		rt->lc = build(l, m);
		rt->rc = build(m + 1, r);
		return rt;
	}

	node* upd2(node* rt, int idx, int v) {
		//return the root
		if (rt->l > idx || rt->r < idx) return rt;
		node* tr = new node(*rt); //copy?
		if (tr->l == tr->r) {
			tr->v = v;
			return tr;
		}
		tr->lc = upd2(tr->lc, idx, v);
		tr->rc = upd2(tr->rc, idx, v);
		tr->v = tr->lc->v + tr->rc->v;
		return tr;
	}
	
	array<int, 3> query(int l, int r, int t) {
		node* vv = rt.at((upper_bound(nums.begin(), nums.end(), t) - nums.begin())-1);
		return { queryL(vv, l), queryR(vv, r), queryS(vv, l, r)};
	}

	int queryS(node* rt, int l, int r) {
		if (rt->l > r || rt->r < l)return 0;
		if (rt->l >= l && rt->r <= r) return rt->v;
		return queryS(rt->lc, l, r) + queryS(rt->rc, l, r);
	}

	int queryL(node* rt, int l) { //query left most with index >= l and value >= v
		if (rt->r < l) return -1;
		if (!rt->v) return -1;
		if (rt->l == rt->r) return rt->l;
		int res = queryL(rt->lc, l);
		return res == -1 ? queryL(rt->rc, l) : res;
	}

	int queryR(node* rt, int r) { //query right most with index <= r
		if (rt->l > r) return -1;
		if (!rt->v) return -1;
		if (rt->l == rt->r) return rt->l;
		int res = queryR(rt->rc, r);
		return res == -1 ? queryR(rt->lc, r) : res;
	}

} open, close;

vector<int> h;

//struct mintree { //ehh should be sparse tablebut wtv
//	struct node {
//		node(int l, int r) : l(l), r(r) {};
//		int v = numeric_limits<int>::max();
//		int l, r;
//		node *lc = 0, *rc = 0;
//	};
//	node* rt;
//	mintree() {
//		rt = build(0, mx);
//	}
//	node* build(int l, int r) {
//		node* rt = new node(l, r);
//		if (l == r) return rt;
//		int m = (l + r) / 2;
//		rt->lc = build(l, m);
//		rt->rc = build(m + 1, r);
//		return rt;
//	}
//	void upd(int i, int v) {
//		upd2(rt, i, v);
//	}
//	void upd2(node* rt, int i, int v) {
//		if (i < rt->l || i > rt->r) return;
//		if (rt->l == rt->r) {
//			rt->v = v;
//			return;
//		}
//		upd2(rt->lc, i, v); upd2(rt->rc, i, v);
//		rt->v = min(rt->lc->v, rt->rc->v);
//	}
//	int query(int l, int r) {
//		return query2(rt, l, r);
//	}
//	int query2(node* rt, int l, int r) {
//		if (l > rt->r || r < rt->l) return numeric_limits<int>::max();
//		if (rt->l >= l && rt->r <= r) return rt->v;
//		return min(query2(rt->lc, l, r), query2(rt->rc, l, r));
//	}
//} ac2;

#define ll int
struct difftree { //what the fk am i doing
	struct node {
		node(int l, int r) : l(l), r(r) {};
		ll mn = std::numeric_limits<int>::max()/2;
		ll ma = std::numeric_limits<int>::min()/2;
		ll incdif = 0, decdif = 0;
		int l, r;
		node* lc = 0, * rc = 0;
	};
	node* rt = 0;
	difftree() {
		rt = build(0, mx);
		//cout << rt->l << "," << rt->r << endl;
	}
	node* build(int l, int r) {
		node* rt = new node(l, r);
		if (l == r) return rt;
		int m = (l + r) / 2;
		rt->lc = build(l, m);
		rt->rc = build(m + 1, r);
		return rt;
	}
	void upd(int i, int v) {
		upd2(rt, i, v);
	}
	void upd2(node* rt, int i, int v) {
		if (i < rt->l || i > rt->r) return;
		if (rt->l == rt->r) {
			rt->mn = rt->ma = v;
			return;
		}
		upd2(rt->lc, i, v); upd2(rt->rc, i, v);
		rt->mn = min(rt->lc->mn, rt->rc->mn);
		rt->ma = max(rt->lc->ma, rt->rc->ma);
		rt->incdif = max(max(rt->lc->incdif, rt->rc->incdif), rt->rc->ma - rt->lc->mn);
		rt->decdif = max(max(rt->lc->decdif, rt->rc->decdif), rt->lc->ma - rt->rc->mn);
	}
	int incdif(int l, int r) {
		node amogus = query2(rt, l, r);
		int tmp = amogus.incdif;
		return tmp;
	}
	int decdif(int l, int r) {
		node amogus = query2(rt, l, r);
		int tmp = amogus.decdif;
		return tmp;
	}
	node query2(node* rt, int l, int r) {
		//cout << "gonna kms" << endl;
		//cout << l << "," << rt->l << "," << r << "," << rt->r << endl;
		if (l > rt->r || r < rt->l) return node(-1,-1);
		if (rt->l >= l && rt->r <= r) return *rt;
		node owo(-1, -1);
		node lc = query2(rt->lc, l, r);
		node rc = query2(rt->rc, l, r);
		owo.mn = min(lc.mn, rc.mn);
		owo.ma = max(lc.ma, rc.ma);
		owo.incdif = max(max(lc.incdif, rc.incdif), rc.ma - lc.mn);
		owo.decdif = max(max(lc.decdif, rc.decdif), lc.ma - rc.mn);
		return owo;
	}
} diff;
//
//struct dsu {
//	vector<int> p, r;
//	dsu() {
//		p.resize(mx, -1);
//		r.resize(mx, 0);
//	}
//	int par(int x) {
//		return p.at(x) == -1 ? x : p.at(x) = par(p.at(x));
//	}
//	void merge(int a, int b) {
//		a = par(a), b = par(b); 
//		if (a == b) return;
//		//attaching b to a, so r.at(a) must be bigger
//		if (r.at(a) < r.at(b)) swap(a, b);
//		if (r.at(a) == r.at(b)) r.at(a)++;
//		p.at(b) = a;
//	}
//};


void init(int N, vector<int> H) {
	h = H;
	h.insert(h.begin(), numeric_limits<int>::max()); N++;
	set<int> ranges;
	for (int i = 0; i < N; i++)
		ranges.insert(i);
	vector<int> mn = h;
	vector<bool> exists(N, 1);
	set<pair<int, int>> q;
	for (int i = 0; i < N; i++) {
		//ac2.upd(i, h.at(i));
		diff.upd(i, h.at(i));
		open.upd(i, 1, numeric_limits<int>::min());
		close.upd(i+1, 1, numeric_limits<int>::min());
		int v = numeric_limits<int>::max();
		if (i) v = min(v, h.at(i) - mn.at(i));
		if (i < N - 1)v = min(v, h.at(i + 1) - mn.at(i));
		q.insert({ v, i });
	}
	int time = numeric_limits<int>::min();
	while (q.size()) {
		auto [a, b] = *q.begin();
		time = max(time, a);
		q.erase(q.begin());
		if (!exists.at(b)) continue;

		auto x = ranges.find(b);
		if (b && h.at(b) - mn.at(b) <= a) {
			//deletus
			auto x2 = x; x2--;
			if (exists.at(*x2)) {
				exists.at(*x) = 0;
				open.upd(*x, 0, time);
				auto x3 = x; x3++;
				if (x3 == ranges.end()) close.upd(N, 0, time);
				else close.upd(*x3, 0, time);
				continue;
			}
			int tmp = mn.at(b);
			exists.at(*x) = 0; 
			exists.at(*x2) = 1;
			open.upd(*x, 0, time);
			open.upd(*x2, 1, time);
			ranges.erase(x--);
			mn.at(*x) = min(mn.at(*x), tmp);
		}
		else {
			auto x2 = x; x2++;
			//assert(x2 != ranges.end()); //troll
			if (x2 == ranges.end()) {
				continue;
			}
			if (exists.at(*x2)) {
				open.upd(*x, 0, time);
				close.upd(*x2, 0, time);
				exists.at(*x) = 0;
				continue;
			}
			if (x2 != ranges.end() && h.at(*x2) - mn.at(*x) <= a) {
				mn.at(*x) = min(mn.at(*x), mn.at(*x2));
				exists.at(*x2) = 0; 
				close.upd(*x2, 0, time);

				auto x3 = x2; x3++;
				if(x3 != ranges.end())close.upd(*x3, 1, time);
				else close.upd(N, 1, time);
				ranges.erase(x2);
			}
			else {
				break;
			}
		}
		//x is result

		b = *x; int v = numeric_limits<int>::max();
		if (b) v = min(v, h.at(b) - mn.at(b));
		x++;
		if (x != ranges.end()) v = min(v, h.at(*x) - mn.at(b));
		q.insert({ v, b });

		//yeahhhhhhh......
	}
	h = H;
}

int max_towers(int L, int R, int D) {
	L++, R++; D--;
	//this is so sus
	auto [a, b, c] = open.query(L, R, D);
	auto [e, f, g] = close.query(L, R, D);


	//auto .at(x, y, z) = open.query(0, 7, numeric_limits<int>::min());
	//cout << x << "," << y << "," << z << endl;
	//cout << c << "," << g << endl;

	if (c && g && e <= a) {
		g--;
	}
	if (c && g && b >= f) {
		c--;
	}
	if (c == 0 || g == 0) {
		//AMONGUS
		int l = L, r = R, m = 0;
		int inc = 0, dec = 0;
		while (l < r) {
			m = (l + r) / 2;
			 inc = diff.incdif(L, m);
			 dec = diff.decdif(m, R);
			//cout <<L<<","<<R<<","<<m << "," << inc << "," << dec << endl;
			if (min(inc, dec) >= D+1) break;
			if (max(inc, dec) < D + 1)break;
 			if (inc < dec)
				l = m + 1;
			else 
				r = m - 1;
		}
		//cout << "." << endl;
		if (min(inc, dec) >= D+1) {
			return 2;
		}
		else {
			return 1;
		}
	}
	//cout << a << "," << b << "," << c << endl;
	//cout << e << "," << f << "," << g << endl;
	//assert(a != -1);
	//assert(b != -1);
	//assert(e != -1);
	//assert(f != -1);

	
	//assert(c == g);
	//cout << diff.incdif(L, a) << "," << L << "," << a << endl;
	if (diff.incdif(L, a) >= D+1) c++;
	if (diff.decdif(f, R) >= D+1) c++;
	return c;
}

//
//int main() {
//	int N, Q;
//	assert(2 == scanf("%d %d", &N, &Q));
//	std::vector<int> H(N);
//	for (int i = 0; i < N; ++i) {
//		assert(1 == scanf("%d", &H.at(i)));
//	}
//	init(N, H);
//
//	for (int i = 0; i < Q; ++i) {
//		int L, R, D;
//		assert(3 == scanf("%d %d %d", &L, &R, &D));
//		printf("%d\n", max_towers(L, R, D));
//	}
//	return 0;
//}

Compilation message

towers.cpp:123: warning: "ll" redefined
  123 | #define ll int
      | 
towers.cpp:4: note: this is the location of the previous definition
    4 | #define ll long long
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 1065 ms 332312 KB Output is correct
2 Correct 2108 ms 538396 KB Output is correct
3 Correct 2290 ms 538404 KB Output is correct
4 Correct 2095 ms 538472 KB Output is correct
5 Correct 2272 ms 535668 KB Output is correct
6 Correct 3058 ms 538440 KB Output is correct
7 Correct 3350 ms 535640 KB Output is correct
8 Correct 25 ms 28496 KB Output is correct
9 Correct 36 ms 38588 KB Output is correct
10 Correct 38 ms 38596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 30536 KB Output is correct
2 Correct 37 ms 38608 KB Output is correct
3 Correct 38 ms 38544 KB Output is correct
4 Correct 38 ms 38600 KB Output is correct
5 Correct 36 ms 38556 KB Output is correct
6 Correct 38 ms 38600 KB Output is correct
7 Correct 38 ms 38600 KB Output is correct
8 Correct 35 ms 38616 KB Output is correct
9 Correct 40 ms 38516 KB Output is correct
10 Correct 38 ms 38536 KB Output is correct
11 Correct 38 ms 38608 KB Output is correct
12 Correct 25 ms 28456 KB Output is correct
13 Correct 37 ms 38608 KB Output is correct
14 Correct 46 ms 38504 KB Output is correct
15 Correct 37 ms 38516 KB Output is correct
16 Correct 38 ms 38608 KB Output is correct
17 Correct 37 ms 38600 KB Output is correct
18 Correct 40 ms 38604 KB Output is correct
19 Correct 38 ms 38608 KB Output is correct
20 Correct 37 ms 38580 KB Output is correct
21 Correct 38 ms 38572 KB Output is correct
22 Correct 39 ms 38596 KB Output is correct
23 Correct 37 ms 38600 KB Output is correct
24 Correct 37 ms 38524 KB Output is correct
25 Correct 30 ms 32920 KB Output is correct
26 Correct 39 ms 38592 KB Output is correct
27 Correct 37 ms 38604 KB Output is correct
28 Correct 40 ms 38600 KB Output is correct
29 Correct 37 ms 38596 KB Output is correct
30 Correct 39 ms 38520 KB Output is correct
31 Correct 37 ms 38600 KB Output is correct
32 Correct 36 ms 38660 KB Output is correct
33 Correct 38 ms 38560 KB Output is correct
34 Correct 36 ms 38524 KB Output is correct
35 Correct 37 ms 38600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 30536 KB Output is correct
2 Correct 37 ms 38608 KB Output is correct
3 Correct 38 ms 38544 KB Output is correct
4 Correct 38 ms 38600 KB Output is correct
5 Correct 36 ms 38556 KB Output is correct
6 Correct 38 ms 38600 KB Output is correct
7 Correct 38 ms 38600 KB Output is correct
8 Correct 35 ms 38616 KB Output is correct
9 Correct 40 ms 38516 KB Output is correct
10 Correct 38 ms 38536 KB Output is correct
11 Correct 38 ms 38608 KB Output is correct
12 Correct 25 ms 28456 KB Output is correct
13 Correct 37 ms 38608 KB Output is correct
14 Correct 46 ms 38504 KB Output is correct
15 Correct 37 ms 38516 KB Output is correct
16 Correct 38 ms 38608 KB Output is correct
17 Correct 37 ms 38600 KB Output is correct
18 Correct 40 ms 38604 KB Output is correct
19 Correct 38 ms 38608 KB Output is correct
20 Correct 37 ms 38580 KB Output is correct
21 Correct 38 ms 38572 KB Output is correct
22 Correct 39 ms 38596 KB Output is correct
23 Correct 37 ms 38600 KB Output is correct
24 Correct 37 ms 38524 KB Output is correct
25 Correct 30 ms 32920 KB Output is correct
26 Correct 39 ms 38592 KB Output is correct
27 Correct 37 ms 38604 KB Output is correct
28 Correct 40 ms 38600 KB Output is correct
29 Correct 37 ms 38596 KB Output is correct
30 Correct 39 ms 38520 KB Output is correct
31 Correct 37 ms 38600 KB Output is correct
32 Correct 36 ms 38660 KB Output is correct
33 Correct 38 ms 38560 KB Output is correct
34 Correct 36 ms 38524 KB Output is correct
35 Correct 37 ms 38600 KB Output is correct
36 Correct 605 ms 358524 KB Output is correct
37 Correct 985 ms 535740 KB Output is correct
38 Correct 972 ms 535748 KB Output is correct
39 Correct 987 ms 535648 KB Output is correct
40 Correct 1016 ms 535640 KB Output is correct
41 Correct 1029 ms 535668 KB Output is correct
42 Correct 941 ms 535592 KB Output is correct
43 Correct 604 ms 538412 KB Output is correct
44 Correct 924 ms 535796 KB Output is correct
45 Correct 593 ms 532052 KB Output is correct
46 Correct 937 ms 535580 KB Output is correct
47 Correct 980 ms 535552 KB Output is correct
48 Correct 995 ms 535588 KB Output is correct
49 Correct 987 ms 535736 KB Output is correct
50 Correct 902 ms 535760 KB Output is correct
51 Correct 631 ms 538628 KB Output is correct
52 Correct 940 ms 535756 KB Output is correct
53 Correct 999 ms 535568 KB Output is correct
54 Correct 991 ms 535764 KB Output is correct
55 Correct 915 ms 535808 KB Output is correct
56 Correct 603 ms 534512 KB Output is correct
57 Correct 915 ms 518488 KB Output is correct
58 Correct 963 ms 535752 KB Output is correct
59 Correct 961 ms 535680 KB Output is correct
60 Correct 1014 ms 535696 KB Output is correct
61 Correct 989 ms 535608 KB Output is correct
62 Correct 1006 ms 535588 KB Output is correct
63 Correct 997 ms 535636 KB Output is correct
64 Correct 599 ms 538520 KB Output is correct
65 Correct 929 ms 535560 KB Output is correct
66 Correct 611 ms 536360 KB Output is correct
67 Correct 923 ms 535588 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2070 ms 532000 KB Output is correct
2 Correct 2516 ms 535656 KB Output is correct
3 Correct 2360 ms 535796 KB Output is correct
4 Correct 2469 ms 535480 KB Output is correct
5 Correct 2488 ms 535612 KB Output is correct
6 Correct 2282 ms 535608 KB Output is correct
7 Correct 2455 ms 535552 KB Output is correct
8 Correct 2994 ms 538468 KB Output is correct
9 Correct 3155 ms 535552 KB Output is correct
10 Correct 2147 ms 535572 KB Output is correct
11 Correct 2713 ms 535552 KB Output is correct
12 Correct 2962 ms 538468 KB Output is correct
13 Correct 3280 ms 535728 KB Output is correct
14 Correct 24 ms 28436 KB Output is correct
15 Correct 37 ms 38548 KB Output is correct
16 Correct 36 ms 38592 KB Output is correct
17 Correct 1008 ms 535584 KB Output is correct
18 Correct 984 ms 535652 KB Output is correct
19 Correct 971 ms 535696 KB Output is correct
20 Correct 943 ms 535716 KB Output is correct
21 Correct 619 ms 538452 KB Output is correct
22 Correct 958 ms 535560 KB Output is correct
23 Correct 992 ms 535576 KB Output is correct
24 Correct 975 ms 535616 KB Output is correct
25 Correct 918 ms 535672 KB Output is correct
26 Correct 603 ms 534592 KB Output is correct
27 Correct 37 ms 38564 KB Output is correct
28 Correct 39 ms 38532 KB Output is correct
29 Correct 38 ms 38620 KB Output is correct
30 Correct 39 ms 38520 KB Output is correct
31 Correct 36 ms 38616 KB Output is correct
32 Correct 37 ms 38536 KB Output is correct
33 Correct 37 ms 38608 KB Output is correct
34 Correct 39 ms 38536 KB Output is correct
35 Correct 39 ms 38600 KB Output is correct
36 Correct 35 ms 38532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 531 ms 150040 KB Output is correct
2 Correct 2457 ms 535436 KB Output is correct
3 Correct 2193 ms 535620 KB Output is correct
4 Correct 2248 ms 535744 KB Output is correct
5 Incorrect 2139 ms 535700 KB 57037th lines differ - on the 1st token, expected: '2', found: '1'
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 30536 KB Output is correct
2 Correct 37 ms 38608 KB Output is correct
3 Correct 38 ms 38544 KB Output is correct
4 Correct 38 ms 38600 KB Output is correct
5 Correct 36 ms 38556 KB Output is correct
6 Correct 38 ms 38600 KB Output is correct
7 Correct 38 ms 38600 KB Output is correct
8 Correct 35 ms 38616 KB Output is correct
9 Correct 40 ms 38516 KB Output is correct
10 Correct 38 ms 38536 KB Output is correct
11 Correct 38 ms 38608 KB Output is correct
12 Correct 25 ms 28456 KB Output is correct
13 Correct 37 ms 38608 KB Output is correct
14 Correct 46 ms 38504 KB Output is correct
15 Correct 37 ms 38516 KB Output is correct
16 Correct 38 ms 38608 KB Output is correct
17 Correct 37 ms 38600 KB Output is correct
18 Correct 40 ms 38604 KB Output is correct
19 Correct 38 ms 38608 KB Output is correct
20 Correct 37 ms 38580 KB Output is correct
21 Correct 38 ms 38572 KB Output is correct
22 Correct 39 ms 38596 KB Output is correct
23 Correct 37 ms 38600 KB Output is correct
24 Correct 37 ms 38524 KB Output is correct
25 Correct 30 ms 32920 KB Output is correct
26 Correct 39 ms 38592 KB Output is correct
27 Correct 37 ms 38604 KB Output is correct
28 Correct 40 ms 38600 KB Output is correct
29 Correct 37 ms 38596 KB Output is correct
30 Correct 39 ms 38520 KB Output is correct
31 Correct 37 ms 38600 KB Output is correct
32 Correct 36 ms 38660 KB Output is correct
33 Correct 38 ms 38560 KB Output is correct
34 Correct 36 ms 38524 KB Output is correct
35 Correct 37 ms 38600 KB Output is correct
36 Correct 605 ms 358524 KB Output is correct
37 Correct 985 ms 535740 KB Output is correct
38 Correct 972 ms 535748 KB Output is correct
39 Correct 987 ms 535648 KB Output is correct
40 Correct 1016 ms 535640 KB Output is correct
41 Correct 1029 ms 535668 KB Output is correct
42 Correct 941 ms 535592 KB Output is correct
43 Correct 604 ms 538412 KB Output is correct
44 Correct 924 ms 535796 KB Output is correct
45 Correct 593 ms 532052 KB Output is correct
46 Correct 937 ms 535580 KB Output is correct
47 Correct 980 ms 535552 KB Output is correct
48 Correct 995 ms 535588 KB Output is correct
49 Correct 987 ms 535736 KB Output is correct
50 Correct 902 ms 535760 KB Output is correct
51 Correct 631 ms 538628 KB Output is correct
52 Correct 940 ms 535756 KB Output is correct
53 Correct 999 ms 535568 KB Output is correct
54 Correct 991 ms 535764 KB Output is correct
55 Correct 915 ms 535808 KB Output is correct
56 Correct 603 ms 534512 KB Output is correct
57 Correct 915 ms 518488 KB Output is correct
58 Correct 963 ms 535752 KB Output is correct
59 Correct 961 ms 535680 KB Output is correct
60 Correct 1014 ms 535696 KB Output is correct
61 Correct 989 ms 535608 KB Output is correct
62 Correct 1006 ms 535588 KB Output is correct
63 Correct 997 ms 535636 KB Output is correct
64 Correct 599 ms 538520 KB Output is correct
65 Correct 929 ms 535560 KB Output is correct
66 Correct 611 ms 536360 KB Output is correct
67 Correct 923 ms 535588 KB Output is correct
68 Correct 2070 ms 532000 KB Output is correct
69 Correct 2516 ms 535656 KB Output is correct
70 Correct 2360 ms 535796 KB Output is correct
71 Correct 2469 ms 535480 KB Output is correct
72 Correct 2488 ms 535612 KB Output is correct
73 Correct 2282 ms 535608 KB Output is correct
74 Correct 2455 ms 535552 KB Output is correct
75 Correct 2994 ms 538468 KB Output is correct
76 Correct 3155 ms 535552 KB Output is correct
77 Correct 2147 ms 535572 KB Output is correct
78 Correct 2713 ms 535552 KB Output is correct
79 Correct 2962 ms 538468 KB Output is correct
80 Correct 3280 ms 535728 KB Output is correct
81 Correct 24 ms 28436 KB Output is correct
82 Correct 37 ms 38548 KB Output is correct
83 Correct 36 ms 38592 KB Output is correct
84 Correct 1008 ms 535584 KB Output is correct
85 Correct 984 ms 535652 KB Output is correct
86 Correct 971 ms 535696 KB Output is correct
87 Correct 943 ms 535716 KB Output is correct
88 Correct 619 ms 538452 KB Output is correct
89 Correct 958 ms 535560 KB Output is correct
90 Correct 992 ms 535576 KB Output is correct
91 Correct 975 ms 535616 KB Output is correct
92 Correct 918 ms 535672 KB Output is correct
93 Correct 603 ms 534592 KB Output is correct
94 Correct 37 ms 38564 KB Output is correct
95 Correct 39 ms 38532 KB Output is correct
96 Correct 38 ms 38620 KB Output is correct
97 Correct 39 ms 38520 KB Output is correct
98 Correct 36 ms 38616 KB Output is correct
99 Correct 37 ms 38536 KB Output is correct
100 Correct 37 ms 38608 KB Output is correct
101 Correct 39 ms 38536 KB Output is correct
102 Correct 39 ms 38600 KB Output is correct
103 Correct 35 ms 38532 KB Output is correct
104 Correct 1942 ms 478624 KB Output is correct
105 Correct 2444 ms 535632 KB Output is correct
106 Incorrect 2375 ms 535664 KB 17120th lines differ - on the 1st token, expected: '2', found: '1'
107 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1065 ms 332312 KB Output is correct
2 Correct 2108 ms 538396 KB Output is correct
3 Correct 2290 ms 538404 KB Output is correct
4 Correct 2095 ms 538472 KB Output is correct
5 Correct 2272 ms 535668 KB Output is correct
6 Correct 3058 ms 538440 KB Output is correct
7 Correct 3350 ms 535640 KB Output is correct
8 Correct 25 ms 28496 KB Output is correct
9 Correct 36 ms 38588 KB Output is correct
10 Correct 38 ms 38596 KB Output is correct
11 Correct 26 ms 30536 KB Output is correct
12 Correct 37 ms 38608 KB Output is correct
13 Correct 38 ms 38544 KB Output is correct
14 Correct 38 ms 38600 KB Output is correct
15 Correct 36 ms 38556 KB Output is correct
16 Correct 38 ms 38600 KB Output is correct
17 Correct 38 ms 38600 KB Output is correct
18 Correct 35 ms 38616 KB Output is correct
19 Correct 40 ms 38516 KB Output is correct
20 Correct 38 ms 38536 KB Output is correct
21 Correct 38 ms 38608 KB Output is correct
22 Correct 25 ms 28456 KB Output is correct
23 Correct 37 ms 38608 KB Output is correct
24 Correct 46 ms 38504 KB Output is correct
25 Correct 37 ms 38516 KB Output is correct
26 Correct 38 ms 38608 KB Output is correct
27 Correct 37 ms 38600 KB Output is correct
28 Correct 40 ms 38604 KB Output is correct
29 Correct 38 ms 38608 KB Output is correct
30 Correct 37 ms 38580 KB Output is correct
31 Correct 38 ms 38572 KB Output is correct
32 Correct 39 ms 38596 KB Output is correct
33 Correct 37 ms 38600 KB Output is correct
34 Correct 37 ms 38524 KB Output is correct
35 Correct 30 ms 32920 KB Output is correct
36 Correct 39 ms 38592 KB Output is correct
37 Correct 37 ms 38604 KB Output is correct
38 Correct 40 ms 38600 KB Output is correct
39 Correct 37 ms 38596 KB Output is correct
40 Correct 39 ms 38520 KB Output is correct
41 Correct 37 ms 38600 KB Output is correct
42 Correct 36 ms 38660 KB Output is correct
43 Correct 38 ms 38560 KB Output is correct
44 Correct 36 ms 38524 KB Output is correct
45 Correct 37 ms 38600 KB Output is correct
46 Correct 605 ms 358524 KB Output is correct
47 Correct 985 ms 535740 KB Output is correct
48 Correct 972 ms 535748 KB Output is correct
49 Correct 987 ms 535648 KB Output is correct
50 Correct 1016 ms 535640 KB Output is correct
51 Correct 1029 ms 535668 KB Output is correct
52 Correct 941 ms 535592 KB Output is correct
53 Correct 604 ms 538412 KB Output is correct
54 Correct 924 ms 535796 KB Output is correct
55 Correct 593 ms 532052 KB Output is correct
56 Correct 937 ms 535580 KB Output is correct
57 Correct 980 ms 535552 KB Output is correct
58 Correct 995 ms 535588 KB Output is correct
59 Correct 987 ms 535736 KB Output is correct
60 Correct 902 ms 535760 KB Output is correct
61 Correct 631 ms 538628 KB Output is correct
62 Correct 940 ms 535756 KB Output is correct
63 Correct 999 ms 535568 KB Output is correct
64 Correct 991 ms 535764 KB Output is correct
65 Correct 915 ms 535808 KB Output is correct
66 Correct 603 ms 534512 KB Output is correct
67 Correct 915 ms 518488 KB Output is correct
68 Correct 963 ms 535752 KB Output is correct
69 Correct 961 ms 535680 KB Output is correct
70 Correct 1014 ms 535696 KB Output is correct
71 Correct 989 ms 535608 KB Output is correct
72 Correct 1006 ms 535588 KB Output is correct
73 Correct 997 ms 535636 KB Output is correct
74 Correct 599 ms 538520 KB Output is correct
75 Correct 929 ms 535560 KB Output is correct
76 Correct 611 ms 536360 KB Output is correct
77 Correct 923 ms 535588 KB Output is correct
78 Correct 2070 ms 532000 KB Output is correct
79 Correct 2516 ms 535656 KB Output is correct
80 Correct 2360 ms 535796 KB Output is correct
81 Correct 2469 ms 535480 KB Output is correct
82 Correct 2488 ms 535612 KB Output is correct
83 Correct 2282 ms 535608 KB Output is correct
84 Correct 2455 ms 535552 KB Output is correct
85 Correct 2994 ms 538468 KB Output is correct
86 Correct 3155 ms 535552 KB Output is correct
87 Correct 2147 ms 535572 KB Output is correct
88 Correct 2713 ms 535552 KB Output is correct
89 Correct 2962 ms 538468 KB Output is correct
90 Correct 3280 ms 535728 KB Output is correct
91 Correct 24 ms 28436 KB Output is correct
92 Correct 37 ms 38548 KB Output is correct
93 Correct 36 ms 38592 KB Output is correct
94 Correct 1008 ms 535584 KB Output is correct
95 Correct 984 ms 535652 KB Output is correct
96 Correct 971 ms 535696 KB Output is correct
97 Correct 943 ms 535716 KB Output is correct
98 Correct 619 ms 538452 KB Output is correct
99 Correct 958 ms 535560 KB Output is correct
100 Correct 992 ms 535576 KB Output is correct
101 Correct 975 ms 535616 KB Output is correct
102 Correct 918 ms 535672 KB Output is correct
103 Correct 603 ms 534592 KB Output is correct
104 Correct 37 ms 38564 KB Output is correct
105 Correct 39 ms 38532 KB Output is correct
106 Correct 38 ms 38620 KB Output is correct
107 Correct 39 ms 38520 KB Output is correct
108 Correct 36 ms 38616 KB Output is correct
109 Correct 37 ms 38536 KB Output is correct
110 Correct 37 ms 38608 KB Output is correct
111 Correct 39 ms 38536 KB Output is correct
112 Correct 39 ms 38600 KB Output is correct
113 Correct 35 ms 38532 KB Output is correct
114 Correct 531 ms 150040 KB Output is correct
115 Correct 2457 ms 535436 KB Output is correct
116 Correct 2193 ms 535620 KB Output is correct
117 Correct 2248 ms 535744 KB Output is correct
118 Incorrect 2139 ms 535700 KB 57037th lines differ - on the 1st token, expected: '2', found: '1'
119 Halted 0 ms 0 KB -