답안 #568038

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
568038 2022-05-24T14:23:41 Z MohamedAhmed04 Interval Collection (CCO20_day2problem2) C++14
25 / 25
6238 ms 274832 KB
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")

#include <bits/stdc++.h>

using namespace std ;

const int MAX = 1e6 + 10 ;

int tree[2][2 * MAX + 100] ;
int val[2][MAX] ;

int tmp[2] = {(int)1e9 , (int)-1e9} ;

void build(bool t)
{
	for(int i = 2*MAX ; i >= 0 ; --i)
		tree[t][i] = tmp[t] ;
}

void update(int idx , int val , bool t)
{
	for(tree[t][idx += MAX] = val ; idx > 1 ; idx >>= 1)
	{
		if(!t)
			tree[t][idx >> 1] = min(tree[t][idx] , tree[t][idx^1]) ;
		else
			tree[t][idx >> 1] = max(tree[t][idx] , tree[t][idx^1]) ;
	}
}

int query(int l , int r , bool t)
{
	++r ;
	int ans = tmp[t] ;
	for(l += MAX , r += MAX ; l < r ; l >>= 1 , r >>= 1)
	{
		if(l & 1)
		{
			if(!t)
				ans = min(ans , tree[t][l++]) ;
			else
				ans = max(ans , tree[t][l++]) ;
		}
		if(r & 1)
		{
			if(!t)
				ans = min(ans , tree[t][--r]) ;
			else
				ans = max(ans , tree[t][--r]) ;
		}
	}
	return ans ;
}

int q ;

set<int>sl[MAX] , sr[MAX] ;

pair<int , int>calc(int l , int r)
{
	pair<int , int>p = {r-l , r-l} ;
	if(tree[0][1] <= l)
	{
		int x = query(1 , l , 1) ;
		p = min(p , make_pair(0 , r - x)) ;
	}
	if(tree[1][1] >= r)
	{
		int x = query(r , MAX , 0) ;
		p = min(p , make_pair(0 , x - l)) ;
	}
	if(p.first)
	{
		int x = val[1][tree[0][1]] ;
		p = min(p , make_pair(tree[0][1] - l , r - x)) ;

		x = val[0][tree[1][1]] ;
		p = min(p , make_pair(r - tree[1][1] , x - l)) ;
	}
	return p ;
}

char c[MAX] ;
int L[MAX] , R[MAX] , id[MAX] ;
int ans[MAX] ;

vector< pair<int , int> >tree2[2 * MAX] ;

void Add(int node , int l , int r , int from , int to)
{
	if(from > r || to < l)
		return ;
	if(l >= from && r <= to)
	{
		tree2[node].emplace_back(L[from] , R[from]) ;
		return ;
	}
	int mid = (l + r) >> 1 ;
	Add(node << 1 , l , mid , from , to) ;
	Add(node << 1 | 1 , mid+1 , r , from , to) ;
}

void solve(int node , int st , int en , pair<int , int>best)
{
	if(st > en)
		return ;
	pair<int , int>best2 = best ;
	for(auto &p : tree2[node])
	{
		int l = p.first , r = p.second ;
		sl[l].insert(r) ;
		sr[r].insert(l) ;
		int x = val[0][l] , y = val[1][r] ;
		val[0][l] = *sl[l].begin() , val[1][r] = *sr[r].rbegin() ;
		if(x != val[0][l])
			update(l , val[0][l] , 0) ;
		if(y != val[1][r]) 
			update(r , val[1][r] , 1) ;
		best2 = min(best2 , calc(l , r)) ;
	}
	int mid = (st + en) >> 1 ;
	if(st == en)
		ans[st] = best2.second ;
	else
		solve(node << 1 , st , mid , best2) , solve(node << 1 | 1 , mid+1 , en , best2) ;
	for(auto &p : tree2[node])
	{
		int l = p.first , r = p.second ;
		sl[l].erase(r) ;
		sr[r].erase(l) ;
		int x = val[0][l] , y = val[1][r] ;
		val[0][l] = tmp[0] ;
		if(sl[l].size())
			val[0][l] = *sl[l].begin() ;
		val[1][r] = tmp[1] ;
		if(sr[r].size())
			val[1][r] = *sr[r].rbegin() ;
		if(x != val[0][l])
			update(l , val[0][l] , 0) ;
		if(y != val[1][r])
			update(r , val[1][r] , 1) ;
	}
}

void pre_id()
{
	vector< pair<int , int> >vp ;
	for(int i = 1 ; i <= q ; ++i)
		vp.emplace_back(L[i] , R[i]) ;
	sort(vp.begin() , vp.end()) ;
	vp.erase(unique(vp.begin() , vp.end()) , vp.end()) ;
	for(int i = 1 ; i <= q ; ++i)
	{
		id[i] = lower_bound(vp.begin() , vp.end() , make_pair(L[i] , R[i])) - vp.begin() ;
		id[i]++ ;
	}
}

int freq[MAX] , prv[MAX] ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	build(0) , build(1) ;
	cin>>q ;
	for(int i = 1 ; i <= q ; ++i)
		cin>>c[i]>>L[i]>>R[i] ;
	pre_id() ;
	for(int i = 1 ; i <= q ; ++i)
	{
		if(c[i] == 'A')
		{
			if(!freq[id[i]])
				prv[id[i]] = i ;
			freq[id[i]]++ ;
		}
		else if(c[i] == 'R')
		{
			freq[id[i]]-- ;
			if(!freq[id[i]])
				Add(1 , 1 , q , prv[id[i]] , i-1) ;
		}
	}
	for(int i = 1 ; i <= q ; ++i)
	{
		if(freq[id[i]])
		{
			Add(1 , 1 , q , prv[id[i]] , q) ;
			freq[id[i]] = 0 ;
		}
	}
	solve(1 , 1 , q , {2e9 , 2e9}) ;
	for(int i = 1 ; i <= q ; ++i)
		cout<<ans[i]<<"\n" ;
	return 0 ;
}		
# 결과 실행 시간 메모리 Grader output
1 Correct 89 ms 159184 KB Output is correct
2 Correct 78 ms 158620 KB Output is correct
3 Correct 88 ms 158472 KB Output is correct
4 Correct 86 ms 158600 KB Output is correct
5 Correct 86 ms 159176 KB Output is correct
6 Correct 80 ms 158764 KB Output is correct
7 Correct 80 ms 158540 KB Output is correct
8 Correct 94 ms 158768 KB Output is correct
9 Correct 81 ms 159388 KB Output is correct
10 Correct 90 ms 159264 KB Output is correct
11 Correct 93 ms 159168 KB Output is correct
12 Correct 83 ms 159224 KB Output is correct
13 Correct 94 ms 159628 KB Output is correct
14 Correct 87 ms 159604 KB Output is correct
15 Correct 79 ms 159668 KB Output is correct
16 Correct 79 ms 159572 KB Output is correct
17 Correct 82 ms 158972 KB Output is correct
18 Correct 83 ms 158560 KB Output is correct
19 Correct 92 ms 158432 KB Output is correct
20 Correct 84 ms 158512 KB Output is correct
21 Correct 80 ms 158864 KB Output is correct
22 Correct 81 ms 158592 KB Output is correct
23 Correct 80 ms 158360 KB Output is correct
24 Correct 87 ms 158516 KB Output is correct
25 Correct 86 ms 159272 KB Output is correct
26 Correct 82 ms 159028 KB Output is correct
27 Correct 81 ms 159196 KB Output is correct
28 Correct 81 ms 159052 KB Output is correct
29 Correct 83 ms 159396 KB Output is correct
30 Correct 80 ms 159368 KB Output is correct
31 Correct 98 ms 159564 KB Output is correct
32 Correct 91 ms 159444 KB Output is correct
33 Correct 81 ms 158584 KB Output is correct
34 Correct 81 ms 158560 KB Output is correct
35 Correct 82 ms 158616 KB Output is correct
36 Correct 80 ms 158532 KB Output is correct
37 Correct 94 ms 158780 KB Output is correct
38 Correct 90 ms 158528 KB Output is correct
39 Correct 82 ms 158536 KB Output is correct
40 Correct 81 ms 158516 KB Output is correct
41 Correct 82 ms 158952 KB Output is correct
42 Correct 83 ms 158560 KB Output is correct
43 Correct 87 ms 158560 KB Output is correct
44 Correct 85 ms 158528 KB Output is correct
45 Correct 80 ms 158624 KB Output is correct
46 Correct 80 ms 158556 KB Output is correct
47 Correct 86 ms 158644 KB Output is correct
48 Correct 89 ms 158492 KB Output is correct
49 Correct 83 ms 157440 KB Output is correct
50 Correct 79 ms 157488 KB Output is correct
51 Correct 87 ms 157360 KB Output is correct
52 Correct 91 ms 157432 KB Output is correct
53 Correct 97 ms 157364 KB Output is correct
54 Correct 78 ms 157456 KB Output is correct
55 Correct 80 ms 157640 KB Output is correct
56 Correct 82 ms 157448 KB Output is correct
57 Correct 83 ms 157356 KB Output is correct
58 Correct 99 ms 157364 KB Output is correct
59 Correct 85 ms 157888 KB Output is correct
60 Correct 83 ms 158032 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 89 ms 159184 KB Output is correct
2 Correct 78 ms 158620 KB Output is correct
3 Correct 88 ms 158472 KB Output is correct
4 Correct 86 ms 158600 KB Output is correct
5 Correct 86 ms 159176 KB Output is correct
6 Correct 80 ms 158764 KB Output is correct
7 Correct 80 ms 158540 KB Output is correct
8 Correct 94 ms 158768 KB Output is correct
9 Correct 81 ms 159388 KB Output is correct
10 Correct 90 ms 159264 KB Output is correct
11 Correct 93 ms 159168 KB Output is correct
12 Correct 83 ms 159224 KB Output is correct
13 Correct 94 ms 159628 KB Output is correct
14 Correct 87 ms 159604 KB Output is correct
15 Correct 79 ms 159668 KB Output is correct
16 Correct 79 ms 159572 KB Output is correct
17 Correct 82 ms 158972 KB Output is correct
18 Correct 83 ms 158560 KB Output is correct
19 Correct 92 ms 158432 KB Output is correct
20 Correct 84 ms 158512 KB Output is correct
21 Correct 80 ms 158864 KB Output is correct
22 Correct 81 ms 158592 KB Output is correct
23 Correct 80 ms 158360 KB Output is correct
24 Correct 87 ms 158516 KB Output is correct
25 Correct 86 ms 159272 KB Output is correct
26 Correct 82 ms 159028 KB Output is correct
27 Correct 81 ms 159196 KB Output is correct
28 Correct 81 ms 159052 KB Output is correct
29 Correct 83 ms 159396 KB Output is correct
30 Correct 80 ms 159368 KB Output is correct
31 Correct 98 ms 159564 KB Output is correct
32 Correct 91 ms 159444 KB Output is correct
33 Correct 81 ms 158584 KB Output is correct
34 Correct 81 ms 158560 KB Output is correct
35 Correct 82 ms 158616 KB Output is correct
36 Correct 80 ms 158532 KB Output is correct
37 Correct 94 ms 158780 KB Output is correct
38 Correct 90 ms 158528 KB Output is correct
39 Correct 82 ms 158536 KB Output is correct
40 Correct 81 ms 158516 KB Output is correct
41 Correct 82 ms 158952 KB Output is correct
42 Correct 83 ms 158560 KB Output is correct
43 Correct 87 ms 158560 KB Output is correct
44 Correct 85 ms 158528 KB Output is correct
45 Correct 80 ms 158624 KB Output is correct
46 Correct 80 ms 158556 KB Output is correct
47 Correct 86 ms 158644 KB Output is correct
48 Correct 89 ms 158492 KB Output is correct
49 Correct 83 ms 157440 KB Output is correct
50 Correct 79 ms 157488 KB Output is correct
51 Correct 87 ms 157360 KB Output is correct
52 Correct 91 ms 157432 KB Output is correct
53 Correct 97 ms 157364 KB Output is correct
54 Correct 78 ms 157456 KB Output is correct
55 Correct 80 ms 157640 KB Output is correct
56 Correct 82 ms 157448 KB Output is correct
57 Correct 83 ms 157356 KB Output is correct
58 Correct 99 ms 157364 KB Output is correct
59 Correct 85 ms 157888 KB Output is correct
60 Correct 83 ms 158032 KB Output is correct
61 Correct 80 ms 157004 KB Output is correct
62 Correct 86 ms 156892 KB Output is correct
63 Correct 91 ms 156888 KB Output is correct
64 Correct 159 ms 165904 KB Output is correct
65 Correct 134 ms 165200 KB Output is correct
66 Correct 112 ms 164884 KB Output is correct
67 Correct 113 ms 164416 KB Output is correct
68 Correct 157 ms 166072 KB Output is correct
69 Correct 128 ms 165248 KB Output is correct
70 Correct 126 ms 164896 KB Output is correct
71 Correct 115 ms 164712 KB Output is correct
72 Correct 185 ms 166532 KB Output is correct
73 Correct 158 ms 166276 KB Output is correct
74 Correct 145 ms 166296 KB Output is correct
75 Correct 182 ms 166188 KB Output is correct
76 Correct 158 ms 166808 KB Output is correct
77 Correct 166 ms 166752 KB Output is correct
78 Correct 154 ms 166764 KB Output is correct
79 Correct 174 ms 166840 KB Output is correct
80 Correct 147 ms 166408 KB Output is correct
81 Correct 130 ms 165772 KB Output is correct
82 Correct 121 ms 165380 KB Output is correct
83 Correct 102 ms 164464 KB Output is correct
84 Correct 165 ms 166476 KB Output is correct
85 Correct 144 ms 165792 KB Output is correct
86 Correct 115 ms 165232 KB Output is correct
87 Correct 121 ms 165316 KB Output is correct
88 Correct 168 ms 166924 KB Output is correct
89 Correct 152 ms 166752 KB Output is correct
90 Correct 141 ms 166692 KB Output is correct
91 Correct 142 ms 166776 KB Output is correct
92 Correct 176 ms 167152 KB Output is correct
93 Correct 167 ms 167236 KB Output is correct
94 Correct 158 ms 167152 KB Output is correct
95 Correct 157 ms 167088 KB Output is correct
96 Correct 107 ms 164340 KB Output is correct
97 Correct 101 ms 164300 KB Output is correct
98 Correct 95 ms 164348 KB Output is correct
99 Correct 94 ms 164428 KB Output is correct
100 Correct 125 ms 164884 KB Output is correct
101 Correct 123 ms 164612 KB Output is correct
102 Correct 116 ms 164756 KB Output is correct
103 Correct 93 ms 164536 KB Output is correct
104 Correct 159 ms 165960 KB Output is correct
105 Correct 140 ms 165160 KB Output is correct
106 Correct 114 ms 164716 KB Output is correct
107 Correct 93 ms 164468 KB Output is correct
108 Correct 149 ms 165620 KB Output is correct
109 Correct 149 ms 164968 KB Output is correct
110 Correct 134 ms 164752 KB Output is correct
111 Correct 94 ms 164392 KB Output is correct
112 Correct 101 ms 162412 KB Output is correct
113 Correct 110 ms 162416 KB Output is correct
114 Correct 122 ms 162364 KB Output is correct
115 Correct 104 ms 162332 KB Output is correct
116 Correct 99 ms 162416 KB Output is correct
117 Correct 107 ms 162444 KB Output is correct
118 Correct 127 ms 162460 KB Output is correct
119 Correct 109 ms 162252 KB Output is correct
120 Correct 109 ms 162336 KB Output is correct
121 Correct 110 ms 162500 KB Output is correct
122 Correct 147 ms 167324 KB Output is correct
123 Correct 132 ms 167196 KB Output is correct
124 Correct 109 ms 158588 KB Output is correct
125 Correct 109 ms 158224 KB Output is correct
126 Correct 103 ms 158172 KB Output is correct
127 Correct 128 ms 158848 KB Output is correct
128 Correct 114 ms 158204 KB Output is correct
129 Correct 106 ms 158224 KB Output is correct
130 Correct 116 ms 158868 KB Output is correct
131 Correct 108 ms 158192 KB Output is correct
132 Correct 113 ms 158292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 89 ms 159184 KB Output is correct
2 Correct 78 ms 158620 KB Output is correct
3 Correct 88 ms 158472 KB Output is correct
4 Correct 86 ms 158600 KB Output is correct
5 Correct 86 ms 159176 KB Output is correct
6 Correct 80 ms 158764 KB Output is correct
7 Correct 80 ms 158540 KB Output is correct
8 Correct 94 ms 158768 KB Output is correct
9 Correct 81 ms 159388 KB Output is correct
10 Correct 90 ms 159264 KB Output is correct
11 Correct 93 ms 159168 KB Output is correct
12 Correct 83 ms 159224 KB Output is correct
13 Correct 94 ms 159628 KB Output is correct
14 Correct 87 ms 159604 KB Output is correct
15 Correct 79 ms 159668 KB Output is correct
16 Correct 79 ms 159572 KB Output is correct
17 Correct 82 ms 158972 KB Output is correct
18 Correct 83 ms 158560 KB Output is correct
19 Correct 92 ms 158432 KB Output is correct
20 Correct 84 ms 158512 KB Output is correct
21 Correct 80 ms 158864 KB Output is correct
22 Correct 81 ms 158592 KB Output is correct
23 Correct 80 ms 158360 KB Output is correct
24 Correct 87 ms 158516 KB Output is correct
25 Correct 86 ms 159272 KB Output is correct
26 Correct 82 ms 159028 KB Output is correct
27 Correct 81 ms 159196 KB Output is correct
28 Correct 81 ms 159052 KB Output is correct
29 Correct 83 ms 159396 KB Output is correct
30 Correct 80 ms 159368 KB Output is correct
31 Correct 98 ms 159564 KB Output is correct
32 Correct 91 ms 159444 KB Output is correct
33 Correct 81 ms 158584 KB Output is correct
34 Correct 81 ms 158560 KB Output is correct
35 Correct 82 ms 158616 KB Output is correct
36 Correct 80 ms 158532 KB Output is correct
37 Correct 94 ms 158780 KB Output is correct
38 Correct 90 ms 158528 KB Output is correct
39 Correct 82 ms 158536 KB Output is correct
40 Correct 81 ms 158516 KB Output is correct
41 Correct 82 ms 158952 KB Output is correct
42 Correct 83 ms 158560 KB Output is correct
43 Correct 87 ms 158560 KB Output is correct
44 Correct 85 ms 158528 KB Output is correct
45 Correct 80 ms 158624 KB Output is correct
46 Correct 80 ms 158556 KB Output is correct
47 Correct 86 ms 158644 KB Output is correct
48 Correct 89 ms 158492 KB Output is correct
49 Correct 83 ms 157440 KB Output is correct
50 Correct 79 ms 157488 KB Output is correct
51 Correct 87 ms 157360 KB Output is correct
52 Correct 91 ms 157432 KB Output is correct
53 Correct 97 ms 157364 KB Output is correct
54 Correct 78 ms 157456 KB Output is correct
55 Correct 80 ms 157640 KB Output is correct
56 Correct 82 ms 157448 KB Output is correct
57 Correct 83 ms 157356 KB Output is correct
58 Correct 99 ms 157364 KB Output is correct
59 Correct 85 ms 157888 KB Output is correct
60 Correct 83 ms 158032 KB Output is correct
61 Correct 80 ms 157004 KB Output is correct
62 Correct 86 ms 156892 KB Output is correct
63 Correct 91 ms 156888 KB Output is correct
64 Correct 159 ms 165904 KB Output is correct
65 Correct 134 ms 165200 KB Output is correct
66 Correct 112 ms 164884 KB Output is correct
67 Correct 113 ms 164416 KB Output is correct
68 Correct 157 ms 166072 KB Output is correct
69 Correct 128 ms 165248 KB Output is correct
70 Correct 126 ms 164896 KB Output is correct
71 Correct 115 ms 164712 KB Output is correct
72 Correct 185 ms 166532 KB Output is correct
73 Correct 158 ms 166276 KB Output is correct
74 Correct 145 ms 166296 KB Output is correct
75 Correct 182 ms 166188 KB Output is correct
76 Correct 158 ms 166808 KB Output is correct
77 Correct 166 ms 166752 KB Output is correct
78 Correct 154 ms 166764 KB Output is correct
79 Correct 174 ms 166840 KB Output is correct
80 Correct 147 ms 166408 KB Output is correct
81 Correct 130 ms 165772 KB Output is correct
82 Correct 121 ms 165380 KB Output is correct
83 Correct 102 ms 164464 KB Output is correct
84 Correct 165 ms 166476 KB Output is correct
85 Correct 144 ms 165792 KB Output is correct
86 Correct 115 ms 165232 KB Output is correct
87 Correct 121 ms 165316 KB Output is correct
88 Correct 168 ms 166924 KB Output is correct
89 Correct 152 ms 166752 KB Output is correct
90 Correct 141 ms 166692 KB Output is correct
91 Correct 142 ms 166776 KB Output is correct
92 Correct 176 ms 167152 KB Output is correct
93 Correct 167 ms 167236 KB Output is correct
94 Correct 158 ms 167152 KB Output is correct
95 Correct 157 ms 167088 KB Output is correct
96 Correct 107 ms 164340 KB Output is correct
97 Correct 101 ms 164300 KB Output is correct
98 Correct 95 ms 164348 KB Output is correct
99 Correct 94 ms 164428 KB Output is correct
100 Correct 125 ms 164884 KB Output is correct
101 Correct 123 ms 164612 KB Output is correct
102 Correct 116 ms 164756 KB Output is correct
103 Correct 93 ms 164536 KB Output is correct
104 Correct 159 ms 165960 KB Output is correct
105 Correct 140 ms 165160 KB Output is correct
106 Correct 114 ms 164716 KB Output is correct
107 Correct 93 ms 164468 KB Output is correct
108 Correct 149 ms 165620 KB Output is correct
109 Correct 149 ms 164968 KB Output is correct
110 Correct 134 ms 164752 KB Output is correct
111 Correct 94 ms 164392 KB Output is correct
112 Correct 101 ms 162412 KB Output is correct
113 Correct 110 ms 162416 KB Output is correct
114 Correct 122 ms 162364 KB Output is correct
115 Correct 104 ms 162332 KB Output is correct
116 Correct 99 ms 162416 KB Output is correct
117 Correct 107 ms 162444 KB Output is correct
118 Correct 127 ms 162460 KB Output is correct
119 Correct 109 ms 162252 KB Output is correct
120 Correct 109 ms 162336 KB Output is correct
121 Correct 110 ms 162500 KB Output is correct
122 Correct 147 ms 167324 KB Output is correct
123 Correct 132 ms 167196 KB Output is correct
124 Correct 109 ms 158588 KB Output is correct
125 Correct 109 ms 158224 KB Output is correct
126 Correct 103 ms 158172 KB Output is correct
127 Correct 128 ms 158848 KB Output is correct
128 Correct 114 ms 158204 KB Output is correct
129 Correct 106 ms 158224 KB Output is correct
130 Correct 116 ms 158868 KB Output is correct
131 Correct 108 ms 158192 KB Output is correct
132 Correct 113 ms 158292 KB Output is correct
133 Correct 458 ms 173356 KB Output is correct
134 Correct 422 ms 171064 KB Output is correct
135 Correct 287 ms 170164 KB Output is correct
136 Correct 142 ms 168032 KB Output is correct
137 Correct 538 ms 173240 KB Output is correct
138 Correct 395 ms 170916 KB Output is correct
139 Correct 286 ms 169960 KB Output is correct
140 Correct 214 ms 169148 KB Output is correct
141 Correct 526 ms 175060 KB Output is correct
142 Correct 490 ms 174240 KB Output is correct
143 Correct 460 ms 174172 KB Output is correct
144 Correct 455 ms 173996 KB Output is correct
145 Correct 493 ms 175848 KB Output is correct
146 Correct 522 ms 175736 KB Output is correct
147 Correct 520 ms 175676 KB Output is correct
148 Correct 522 ms 175656 KB Output is correct
149 Correct 439 ms 173668 KB Output is correct
150 Correct 361 ms 171364 KB Output is correct
151 Correct 267 ms 170340 KB Output is correct
152 Correct 167 ms 168176 KB Output is correct
153 Correct 449 ms 173448 KB Output is correct
154 Correct 445 ms 171224 KB Output is correct
155 Correct 259 ms 170172 KB Output is correct
156 Correct 232 ms 169288 KB Output is correct
157 Correct 486 ms 175244 KB Output is correct
158 Correct 482 ms 174396 KB Output is correct
159 Correct 473 ms 174284 KB Output is correct
160 Correct 492 ms 174340 KB Output is correct
161 Correct 497 ms 175772 KB Output is correct
162 Correct 504 ms 175844 KB Output is correct
163 Correct 549 ms 175764 KB Output is correct
164 Correct 501 ms 175888 KB Output is correct
165 Correct 131 ms 167348 KB Output is correct
166 Correct 136 ms 167308 KB Output is correct
167 Correct 148 ms 167396 KB Output is correct
168 Correct 137 ms 167456 KB Output is correct
169 Correct 223 ms 169256 KB Output is correct
170 Correct 233 ms 168716 KB Output is correct
171 Correct 181 ms 168568 KB Output is correct
172 Correct 143 ms 167640 KB Output is correct
173 Correct 445 ms 173436 KB Output is correct
174 Correct 364 ms 170796 KB Output is correct
175 Correct 241 ms 169520 KB Output is correct
176 Correct 147 ms 167632 KB Output is correct
177 Correct 470 ms 172844 KB Output is correct
178 Correct 353 ms 170372 KB Output is correct
179 Correct 272 ms 169560 KB Output is correct
180 Correct 161 ms 167700 KB Output is correct
181 Correct 180 ms 168056 KB Output is correct
182 Correct 234 ms 168116 KB Output is correct
183 Correct 159 ms 167828 KB Output is correct
184 Correct 229 ms 167760 KB Output is correct
185 Correct 180 ms 168036 KB Output is correct
186 Correct 206 ms 167992 KB Output is correct
187 Correct 177 ms 167796 KB Output is correct
188 Correct 239 ms 167752 KB Output is correct
189 Correct 170 ms 168012 KB Output is correct
190 Correct 210 ms 168092 KB Output is correct
191 Correct 284 ms 175608 KB Output is correct
192 Correct 265 ms 175572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 846 ms 209016 KB Output is correct
2 Correct 817 ms 208900 KB Output is correct
3 Correct 1390 ms 254452 KB Output is correct
4 Correct 1476 ms 254596 KB Output is correct
5 Correct 1764 ms 273356 KB Output is correct
6 Correct 1786 ms 273452 KB Output is correct
7 Correct 2592 ms 215700 KB Output is correct
8 Correct 1859 ms 209832 KB Output is correct
9 Correct 1642 ms 208764 KB Output is correct
10 Correct 2912 ms 220212 KB Output is correct
11 Correct 1883 ms 209816 KB Output is correct
12 Correct 1931 ms 208696 KB Output is correct
13 Correct 3688 ms 222092 KB Output is correct
14 Correct 2168 ms 210056 KB Output is correct
15 Correct 1707 ms 208920 KB Output is correct
16 Correct 1069 ms 200240 KB Output is correct
17 Correct 1020 ms 200052 KB Output is correct
18 Correct 1026 ms 200160 KB Output is correct
19 Correct 1059 ms 200332 KB Output is correct
20 Correct 1025 ms 200264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 89 ms 159184 KB Output is correct
2 Correct 78 ms 158620 KB Output is correct
3 Correct 88 ms 158472 KB Output is correct
4 Correct 86 ms 158600 KB Output is correct
5 Correct 86 ms 159176 KB Output is correct
6 Correct 80 ms 158764 KB Output is correct
7 Correct 80 ms 158540 KB Output is correct
8 Correct 94 ms 158768 KB Output is correct
9 Correct 81 ms 159388 KB Output is correct
10 Correct 90 ms 159264 KB Output is correct
11 Correct 93 ms 159168 KB Output is correct
12 Correct 83 ms 159224 KB Output is correct
13 Correct 94 ms 159628 KB Output is correct
14 Correct 87 ms 159604 KB Output is correct
15 Correct 79 ms 159668 KB Output is correct
16 Correct 79 ms 159572 KB Output is correct
17 Correct 82 ms 158972 KB Output is correct
18 Correct 83 ms 158560 KB Output is correct
19 Correct 92 ms 158432 KB Output is correct
20 Correct 84 ms 158512 KB Output is correct
21 Correct 80 ms 158864 KB Output is correct
22 Correct 81 ms 158592 KB Output is correct
23 Correct 80 ms 158360 KB Output is correct
24 Correct 87 ms 158516 KB Output is correct
25 Correct 86 ms 159272 KB Output is correct
26 Correct 82 ms 159028 KB Output is correct
27 Correct 81 ms 159196 KB Output is correct
28 Correct 81 ms 159052 KB Output is correct
29 Correct 83 ms 159396 KB Output is correct
30 Correct 80 ms 159368 KB Output is correct
31 Correct 98 ms 159564 KB Output is correct
32 Correct 91 ms 159444 KB Output is correct
33 Correct 81 ms 158584 KB Output is correct
34 Correct 81 ms 158560 KB Output is correct
35 Correct 82 ms 158616 KB Output is correct
36 Correct 80 ms 158532 KB Output is correct
37 Correct 94 ms 158780 KB Output is correct
38 Correct 90 ms 158528 KB Output is correct
39 Correct 82 ms 158536 KB Output is correct
40 Correct 81 ms 158516 KB Output is correct
41 Correct 82 ms 158952 KB Output is correct
42 Correct 83 ms 158560 KB Output is correct
43 Correct 87 ms 158560 KB Output is correct
44 Correct 85 ms 158528 KB Output is correct
45 Correct 80 ms 158624 KB Output is correct
46 Correct 80 ms 158556 KB Output is correct
47 Correct 86 ms 158644 KB Output is correct
48 Correct 89 ms 158492 KB Output is correct
49 Correct 83 ms 157440 KB Output is correct
50 Correct 79 ms 157488 KB Output is correct
51 Correct 87 ms 157360 KB Output is correct
52 Correct 91 ms 157432 KB Output is correct
53 Correct 97 ms 157364 KB Output is correct
54 Correct 78 ms 157456 KB Output is correct
55 Correct 80 ms 157640 KB Output is correct
56 Correct 82 ms 157448 KB Output is correct
57 Correct 83 ms 157356 KB Output is correct
58 Correct 99 ms 157364 KB Output is correct
59 Correct 85 ms 157888 KB Output is correct
60 Correct 83 ms 158032 KB Output is correct
61 Correct 80 ms 157004 KB Output is correct
62 Correct 86 ms 156892 KB Output is correct
63 Correct 91 ms 156888 KB Output is correct
64 Correct 159 ms 165904 KB Output is correct
65 Correct 134 ms 165200 KB Output is correct
66 Correct 112 ms 164884 KB Output is correct
67 Correct 113 ms 164416 KB Output is correct
68 Correct 157 ms 166072 KB Output is correct
69 Correct 128 ms 165248 KB Output is correct
70 Correct 126 ms 164896 KB Output is correct
71 Correct 115 ms 164712 KB Output is correct
72 Correct 185 ms 166532 KB Output is correct
73 Correct 158 ms 166276 KB Output is correct
74 Correct 145 ms 166296 KB Output is correct
75 Correct 182 ms 166188 KB Output is correct
76 Correct 158 ms 166808 KB Output is correct
77 Correct 166 ms 166752 KB Output is correct
78 Correct 154 ms 166764 KB Output is correct
79 Correct 174 ms 166840 KB Output is correct
80 Correct 147 ms 166408 KB Output is correct
81 Correct 130 ms 165772 KB Output is correct
82 Correct 121 ms 165380 KB Output is correct
83 Correct 102 ms 164464 KB Output is correct
84 Correct 165 ms 166476 KB Output is correct
85 Correct 144 ms 165792 KB Output is correct
86 Correct 115 ms 165232 KB Output is correct
87 Correct 121 ms 165316 KB Output is correct
88 Correct 168 ms 166924 KB Output is correct
89 Correct 152 ms 166752 KB Output is correct
90 Correct 141 ms 166692 KB Output is correct
91 Correct 142 ms 166776 KB Output is correct
92 Correct 176 ms 167152 KB Output is correct
93 Correct 167 ms 167236 KB Output is correct
94 Correct 158 ms 167152 KB Output is correct
95 Correct 157 ms 167088 KB Output is correct
96 Correct 107 ms 164340 KB Output is correct
97 Correct 101 ms 164300 KB Output is correct
98 Correct 95 ms 164348 KB Output is correct
99 Correct 94 ms 164428 KB Output is correct
100 Correct 125 ms 164884 KB Output is correct
101 Correct 123 ms 164612 KB Output is correct
102 Correct 116 ms 164756 KB Output is correct
103 Correct 93 ms 164536 KB Output is correct
104 Correct 159 ms 165960 KB Output is correct
105 Correct 140 ms 165160 KB Output is correct
106 Correct 114 ms 164716 KB Output is correct
107 Correct 93 ms 164468 KB Output is correct
108 Correct 149 ms 165620 KB Output is correct
109 Correct 149 ms 164968 KB Output is correct
110 Correct 134 ms 164752 KB Output is correct
111 Correct 94 ms 164392 KB Output is correct
112 Correct 101 ms 162412 KB Output is correct
113 Correct 110 ms 162416 KB Output is correct
114 Correct 122 ms 162364 KB Output is correct
115 Correct 104 ms 162332 KB Output is correct
116 Correct 99 ms 162416 KB Output is correct
117 Correct 107 ms 162444 KB Output is correct
118 Correct 127 ms 162460 KB Output is correct
119 Correct 109 ms 162252 KB Output is correct
120 Correct 109 ms 162336 KB Output is correct
121 Correct 110 ms 162500 KB Output is correct
122 Correct 147 ms 167324 KB Output is correct
123 Correct 132 ms 167196 KB Output is correct
124 Correct 109 ms 158588 KB Output is correct
125 Correct 109 ms 158224 KB Output is correct
126 Correct 103 ms 158172 KB Output is correct
127 Correct 128 ms 158848 KB Output is correct
128 Correct 114 ms 158204 KB Output is correct
129 Correct 106 ms 158224 KB Output is correct
130 Correct 116 ms 158868 KB Output is correct
131 Correct 108 ms 158192 KB Output is correct
132 Correct 113 ms 158292 KB Output is correct
133 Correct 458 ms 173356 KB Output is correct
134 Correct 422 ms 171064 KB Output is correct
135 Correct 287 ms 170164 KB Output is correct
136 Correct 142 ms 168032 KB Output is correct
137 Correct 538 ms 173240 KB Output is correct
138 Correct 395 ms 170916 KB Output is correct
139 Correct 286 ms 169960 KB Output is correct
140 Correct 214 ms 169148 KB Output is correct
141 Correct 526 ms 175060 KB Output is correct
142 Correct 490 ms 174240 KB Output is correct
143 Correct 460 ms 174172 KB Output is correct
144 Correct 455 ms 173996 KB Output is correct
145 Correct 493 ms 175848 KB Output is correct
146 Correct 522 ms 175736 KB Output is correct
147 Correct 520 ms 175676 KB Output is correct
148 Correct 522 ms 175656 KB Output is correct
149 Correct 439 ms 173668 KB Output is correct
150 Correct 361 ms 171364 KB Output is correct
151 Correct 267 ms 170340 KB Output is correct
152 Correct 167 ms 168176 KB Output is correct
153 Correct 449 ms 173448 KB Output is correct
154 Correct 445 ms 171224 KB Output is correct
155 Correct 259 ms 170172 KB Output is correct
156 Correct 232 ms 169288 KB Output is correct
157 Correct 486 ms 175244 KB Output is correct
158 Correct 482 ms 174396 KB Output is correct
159 Correct 473 ms 174284 KB Output is correct
160 Correct 492 ms 174340 KB Output is correct
161 Correct 497 ms 175772 KB Output is correct
162 Correct 504 ms 175844 KB Output is correct
163 Correct 549 ms 175764 KB Output is correct
164 Correct 501 ms 175888 KB Output is correct
165 Correct 131 ms 167348 KB Output is correct
166 Correct 136 ms 167308 KB Output is correct
167 Correct 148 ms 167396 KB Output is correct
168 Correct 137 ms 167456 KB Output is correct
169 Correct 223 ms 169256 KB Output is correct
170 Correct 233 ms 168716 KB Output is correct
171 Correct 181 ms 168568 KB Output is correct
172 Correct 143 ms 167640 KB Output is correct
173 Correct 445 ms 173436 KB Output is correct
174 Correct 364 ms 170796 KB Output is correct
175 Correct 241 ms 169520 KB Output is correct
176 Correct 147 ms 167632 KB Output is correct
177 Correct 470 ms 172844 KB Output is correct
178 Correct 353 ms 170372 KB Output is correct
179 Correct 272 ms 169560 KB Output is correct
180 Correct 161 ms 167700 KB Output is correct
181 Correct 180 ms 168056 KB Output is correct
182 Correct 234 ms 168116 KB Output is correct
183 Correct 159 ms 167828 KB Output is correct
184 Correct 229 ms 167760 KB Output is correct
185 Correct 180 ms 168036 KB Output is correct
186 Correct 206 ms 167992 KB Output is correct
187 Correct 177 ms 167796 KB Output is correct
188 Correct 239 ms 167752 KB Output is correct
189 Correct 170 ms 168012 KB Output is correct
190 Correct 210 ms 168092 KB Output is correct
191 Correct 284 ms 175608 KB Output is correct
192 Correct 265 ms 175572 KB Output is correct
193 Correct 846 ms 209016 KB Output is correct
194 Correct 817 ms 208900 KB Output is correct
195 Correct 1390 ms 254452 KB Output is correct
196 Correct 1476 ms 254596 KB Output is correct
197 Correct 1764 ms 273356 KB Output is correct
198 Correct 1786 ms 273452 KB Output is correct
199 Correct 2592 ms 215700 KB Output is correct
200 Correct 1859 ms 209832 KB Output is correct
201 Correct 1642 ms 208764 KB Output is correct
202 Correct 2912 ms 220212 KB Output is correct
203 Correct 1883 ms 209816 KB Output is correct
204 Correct 1931 ms 208696 KB Output is correct
205 Correct 3688 ms 222092 KB Output is correct
206 Correct 2168 ms 210056 KB Output is correct
207 Correct 1707 ms 208920 KB Output is correct
208 Correct 1069 ms 200240 KB Output is correct
209 Correct 1020 ms 200052 KB Output is correct
210 Correct 1026 ms 200160 KB Output is correct
211 Correct 1059 ms 200332 KB Output is correct
212 Correct 1025 ms 200264 KB Output is correct
213 Correct 5645 ms 251888 KB Output is correct
214 Correct 4542 ms 230376 KB Output is correct
215 Correct 3730 ms 222012 KB Output is correct
216 Correct 1302 ms 207372 KB Output is correct
217 Correct 5574 ms 252968 KB Output is correct
218 Correct 4498 ms 232332 KB Output is correct
219 Correct 3319 ms 223444 KB Output is correct
220 Correct 1601 ms 211528 KB Output is correct
221 Correct 5727 ms 268344 KB Output is correct
222 Correct 5218 ms 262536 KB Output is correct
223 Correct 5183 ms 260744 KB Output is correct
224 Correct 5078 ms 260632 KB Output is correct
225 Correct 6238 ms 274660 KB Output is correct
226 Correct 6016 ms 274620 KB Output is correct
227 Correct 5736 ms 274832 KB Output is correct
228 Correct 5552 ms 274640 KB Output is correct
229 Correct 5376 ms 251908 KB Output is correct
230 Correct 4083 ms 230172 KB Output is correct
231 Correct 2895 ms 222136 KB Output is correct
232 Correct 1111 ms 207364 KB Output is correct
233 Correct 5792 ms 252744 KB Output is correct
234 Correct 4365 ms 231996 KB Output is correct
235 Correct 3094 ms 223668 KB Output is correct
236 Correct 1579 ms 212432 KB Output is correct
237 Correct 5471 ms 268316 KB Output is correct
238 Correct 5167 ms 262368 KB Output is correct
239 Correct 4878 ms 260632 KB Output is correct
240 Correct 4866 ms 260412 KB Output is correct
241 Correct 5488 ms 274296 KB Output is correct
242 Correct 5527 ms 274324 KB Output is correct
243 Correct 5561 ms 274416 KB Output is correct
244 Correct 5388 ms 274040 KB Output is correct
245 Correct 574 ms 192180 KB Output is correct
246 Correct 579 ms 192276 KB Output is correct
247 Correct 576 ms 192156 KB Output is correct
248 Correct 578 ms 192192 KB Output is correct
249 Correct 1353 ms 209368 KB Output is correct
250 Correct 1440 ms 210784 KB Output is correct
251 Correct 1516 ms 211696 KB Output is correct
252 Correct 884 ms 201152 KB Output is correct
253 Correct 4917 ms 253732 KB Output is correct
254 Correct 3778 ms 228392 KB Output is correct
255 Correct 2704 ms 218852 KB Output is correct
256 Correct 1012 ms 201984 KB Output is correct
257 Correct 5026 ms 247156 KB Output is correct
258 Correct 3797 ms 223720 KB Output is correct
259 Correct 2701 ms 214776 KB Output is correct
260 Correct 1014 ms 200720 KB Output is correct
261 Correct 1106 ms 232164 KB Output is correct
262 Correct 2490 ms 232352 KB Output is correct
263 Correct 967 ms 228408 KB Output is correct
264 Correct 2299 ms 228312 KB Output is correct
265 Correct 1150 ms 232224 KB Output is correct
266 Correct 2503 ms 232228 KB Output is correct
267 Correct 959 ms 228268 KB Output is correct
268 Correct 2314 ms 228508 KB Output is correct
269 Correct 1626 ms 273260 KB Output is correct
270 Correct 1682 ms 273480 KB Output is correct
271 Correct 2405 ms 217216 KB Output is correct
272 Correct 1683 ms 209720 KB Output is correct
273 Correct 2694 ms 221592 KB Output is correct
274 Correct 1565 ms 210040 KB Output is correct
275 Correct 208 ms 169080 KB Output is correct