답안 #267071

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
267071 2020-08-15T19:02:35 Z ChrisT Interval Collection (CCO20_day2problem2) C++17
25 / 25
3731 ms 294796 KB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
using ld = long double;
#define all(x) (x).begin(),(x).end()
const int MN = 5e5 + 5, MOD = 1e9 + 7, BASE = 131;
pii inter[MN];
map<int,vector<int>> ou[MN<<1];
struct Seg {
	int t,t2,l,r,push;
};
int ans[MN]; pii isect[MN];
void cdq (int l, int r, vector<Seg> &lsrt, vector<Seg> &rsrt, int push, pii inter) {
	int mid = (l+r)/2;
	vector<Seg> lq,rq,llq,rrq;
	int pp = 0, sz = rsrt.size(), mxl = -1e9;
	for (Seg &s : lsrt) {
		while (pp<sz&&rsrt[pp].r<=s.l) {
			if (rsrt[pp].t <= l && r <= rsrt[pp].t2) mxl = max(mxl,rsrt[pp].l);
			++pp;
		}
		if (s.t <= l && r <= s.t2) {
			inter.first = max(inter.first,s.l); inter.second = min(inter.second,s.r);
			push = min(push,s.r - mxl);
			push = min(push,s.push);
		} else {
			s.push = min(s.push,s.r - mxl);
			if (s.t <= mid) lq.push_back(s);
			if (s.t2 > mid) rq.push_back(s);
		}
	}
	pp = sz - 1; int mnr = 1e9;
	for (int idx = sz-1;~idx;idx--) {
		Seg &s = rsrt[idx];
		while (pp && lsrt[pp].l >= s.r) {
			if (lsrt[pp].t <= l && r <= lsrt[pp].t2) mnr = min(mnr,lsrt[pp].r);
			--pp;
		}
		if (s.t <= l && r <= s.t2) {
			push = min(push,mnr-s.l);
			push = min(push,s.push);
		} else {
			s.push = min(s.push,mnr-s.l);
			if (s.t <= mid) llq.push_back(s);
			if (s.t2 > mid) rrq.push_back(s);
		}
	}
	reverse(all(llq)); reverse(all(rrq));
	if (l == r) ans[l] = push, isect[l] = inter; 
	else cdq(l,mid,lq,llq,push,inter), cdq(mid+1,r,rq,rrq,push,inter);
}
multiset<int> rs[MN<<1], ls[MN<<1];
struct Event {
	int l,r,add;
};
int main () {
	int q;
	scanf ("%d",&q);
	vector<Seg> segs; vector<Event> events;
	for (int i = 1; i <= q; i++) {
		char c; int l,r;
		scanf (" %c %d %d",&c,&l,&r);
		events.push_back({l,r,c=='A'});
		if (c == 'A') ou[l][r].push_back(i);
		else {
			segs.push_back({ou[l][r].back(),i-1,l,r,MOD});
			ou[l][r].pop_back();
		}
	}
	for (int l = 1; l < (MN<<1); l++) {
		for (auto &au : ou[l]) {
			for (auto &t : au.second) {
				segs.push_back({t,q,l,au.first,MOD});
			}
		}
	}
	sort(all(segs),[](const Seg &a, const Seg &b){return a.l<b.l;});
	vector<Seg> rsrt(all(segs));
	sort(all(rsrt),[](const Seg &a, const Seg &b){return a.r<b.r;});
	cdq(1,q,segs,rsrt,1e9,pii{-1e9,1e9});
	for (int i = 1; i <= q; i++) {
		Event &cur = events[i-1];
		if (cur.add) ls[cur.r].insert(cur.l), rs[cur.l].insert(cur.r);
		else ls[cur.r].erase(ls[cur.r].find(cur.l)), rs[cur.l].erase(rs[cur.l].find(cur.r));
		if (ans[i] > 2e6) {
			assert(isect[i].second > isect[i].first);
			ans[i] = *rs[isect[i].first].begin() - *ls[isect[i].second].rbegin();
		}
		printf ("%d\n",ans[i]);
	} 
	return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:61:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   61 |  scanf ("%d",&q);
      |  ~~~~~~^~~~~~~~~
Main.cpp:65:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   65 |   scanf (" %c %d %d",&c,&l,&r);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 108 ms 141316 KB Output is correct
2 Correct 115 ms 141328 KB Output is correct
3 Correct 98 ms 141348 KB Output is correct
4 Correct 121 ms 141356 KB Output is correct
5 Correct 123 ms 141420 KB Output is correct
6 Correct 128 ms 141304 KB Output is correct
7 Correct 129 ms 141304 KB Output is correct
8 Correct 111 ms 141340 KB Output is correct
9 Correct 112 ms 141384 KB Output is correct
10 Correct 128 ms 141432 KB Output is correct
11 Correct 109 ms 141432 KB Output is correct
12 Correct 111 ms 141428 KB Output is correct
13 Correct 108 ms 141304 KB Output is correct
14 Correct 120 ms 141440 KB Output is correct
15 Correct 128 ms 141372 KB Output is correct
16 Correct 104 ms 141432 KB Output is correct
17 Correct 122 ms 141304 KB Output is correct
18 Correct 124 ms 141380 KB Output is correct
19 Correct 117 ms 141396 KB Output is correct
20 Correct 136 ms 141304 KB Output is correct
21 Correct 133 ms 141416 KB Output is correct
22 Correct 119 ms 141512 KB Output is correct
23 Correct 108 ms 141260 KB Output is correct
24 Correct 132 ms 141328 KB Output is correct
25 Correct 107 ms 141384 KB Output is correct
26 Correct 131 ms 141304 KB Output is correct
27 Correct 129 ms 141360 KB Output is correct
28 Correct 115 ms 141420 KB Output is correct
29 Correct 129 ms 141432 KB Output is correct
30 Correct 117 ms 141348 KB Output is correct
31 Correct 117 ms 141436 KB Output is correct
32 Correct 116 ms 141428 KB Output is correct
33 Correct 103 ms 141256 KB Output is correct
34 Correct 120 ms 141276 KB Output is correct
35 Correct 117 ms 141244 KB Output is correct
36 Correct 123 ms 141324 KB Output is correct
37 Correct 140 ms 141268 KB Output is correct
38 Correct 121 ms 141304 KB Output is correct
39 Correct 106 ms 141376 KB Output is correct
40 Correct 106 ms 141260 KB Output is correct
41 Correct 113 ms 141404 KB Output is correct
42 Correct 132 ms 141324 KB Output is correct
43 Correct 113 ms 141368 KB Output is correct
44 Correct 111 ms 141252 KB Output is correct
45 Correct 111 ms 141364 KB Output is correct
46 Correct 139 ms 141312 KB Output is correct
47 Correct 121 ms 141304 KB Output is correct
48 Correct 116 ms 141304 KB Output is correct
49 Correct 102 ms 141308 KB Output is correct
50 Correct 106 ms 141432 KB Output is correct
51 Correct 118 ms 141412 KB Output is correct
52 Correct 109 ms 141344 KB Output is correct
53 Correct 106 ms 141408 KB Output is correct
54 Correct 105 ms 141304 KB Output is correct
55 Correct 122 ms 141508 KB Output is correct
56 Correct 103 ms 141416 KB Output is correct
57 Correct 102 ms 141400 KB Output is correct
58 Correct 108 ms 141332 KB Output is correct
59 Correct 107 ms 141304 KB Output is correct
60 Correct 121 ms 141412 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 108 ms 141316 KB Output is correct
2 Correct 115 ms 141328 KB Output is correct
3 Correct 98 ms 141348 KB Output is correct
4 Correct 121 ms 141356 KB Output is correct
5 Correct 123 ms 141420 KB Output is correct
6 Correct 128 ms 141304 KB Output is correct
7 Correct 129 ms 141304 KB Output is correct
8 Correct 111 ms 141340 KB Output is correct
9 Correct 112 ms 141384 KB Output is correct
10 Correct 128 ms 141432 KB Output is correct
11 Correct 109 ms 141432 KB Output is correct
12 Correct 111 ms 141428 KB Output is correct
13 Correct 108 ms 141304 KB Output is correct
14 Correct 120 ms 141440 KB Output is correct
15 Correct 128 ms 141372 KB Output is correct
16 Correct 104 ms 141432 KB Output is correct
17 Correct 122 ms 141304 KB Output is correct
18 Correct 124 ms 141380 KB Output is correct
19 Correct 117 ms 141396 KB Output is correct
20 Correct 136 ms 141304 KB Output is correct
21 Correct 133 ms 141416 KB Output is correct
22 Correct 119 ms 141512 KB Output is correct
23 Correct 108 ms 141260 KB Output is correct
24 Correct 132 ms 141328 KB Output is correct
25 Correct 107 ms 141384 KB Output is correct
26 Correct 131 ms 141304 KB Output is correct
27 Correct 129 ms 141360 KB Output is correct
28 Correct 115 ms 141420 KB Output is correct
29 Correct 129 ms 141432 KB Output is correct
30 Correct 117 ms 141348 KB Output is correct
31 Correct 117 ms 141436 KB Output is correct
32 Correct 116 ms 141428 KB Output is correct
33 Correct 103 ms 141256 KB Output is correct
34 Correct 120 ms 141276 KB Output is correct
35 Correct 117 ms 141244 KB Output is correct
36 Correct 123 ms 141324 KB Output is correct
37 Correct 140 ms 141268 KB Output is correct
38 Correct 121 ms 141304 KB Output is correct
39 Correct 106 ms 141376 KB Output is correct
40 Correct 106 ms 141260 KB Output is correct
41 Correct 113 ms 141404 KB Output is correct
42 Correct 132 ms 141324 KB Output is correct
43 Correct 113 ms 141368 KB Output is correct
44 Correct 111 ms 141252 KB Output is correct
45 Correct 111 ms 141364 KB Output is correct
46 Correct 139 ms 141312 KB Output is correct
47 Correct 121 ms 141304 KB Output is correct
48 Correct 116 ms 141304 KB Output is correct
49 Correct 102 ms 141308 KB Output is correct
50 Correct 106 ms 141432 KB Output is correct
51 Correct 118 ms 141412 KB Output is correct
52 Correct 109 ms 141344 KB Output is correct
53 Correct 106 ms 141408 KB Output is correct
54 Correct 105 ms 141304 KB Output is correct
55 Correct 122 ms 141508 KB Output is correct
56 Correct 103 ms 141416 KB Output is correct
57 Correct 102 ms 141400 KB Output is correct
58 Correct 108 ms 141332 KB Output is correct
59 Correct 107 ms 141304 KB Output is correct
60 Correct 121 ms 141412 KB Output is correct
61 Correct 124 ms 141284 KB Output is correct
62 Correct 111 ms 141200 KB Output is correct
63 Correct 113 ms 141220 KB Output is correct
64 Correct 146 ms 144368 KB Output is correct
65 Correct 147 ms 143448 KB Output is correct
66 Correct 162 ms 143084 KB Output is correct
67 Correct 144 ms 142980 KB Output is correct
68 Correct 164 ms 144360 KB Output is correct
69 Correct 141 ms 143492 KB Output is correct
70 Correct 147 ms 143236 KB Output is correct
71 Correct 142 ms 143084 KB Output is correct
72 Correct 148 ms 144692 KB Output is correct
73 Correct 155 ms 144428 KB Output is correct
74 Correct 167 ms 144368 KB Output is correct
75 Correct 151 ms 144332 KB Output is correct
76 Correct 159 ms 144960 KB Output is correct
77 Correct 153 ms 144972 KB Output is correct
78 Correct 158 ms 145004 KB Output is correct
79 Correct 159 ms 144976 KB Output is correct
80 Correct 137 ms 144320 KB Output is correct
81 Correct 140 ms 143452 KB Output is correct
82 Correct 131 ms 143156 KB Output is correct
83 Correct 148 ms 142928 KB Output is correct
84 Correct 171 ms 144348 KB Output is correct
85 Correct 139 ms 143492 KB Output is correct
86 Correct 167 ms 143164 KB Output is correct
87 Correct 136 ms 143020 KB Output is correct
88 Correct 145 ms 144684 KB Output is correct
89 Correct 153 ms 144388 KB Output is correct
90 Correct 144 ms 144364 KB Output is correct
91 Correct 140 ms 144240 KB Output is correct
92 Correct 137 ms 145012 KB Output is correct
93 Correct 155 ms 144940 KB Output is correct
94 Correct 160 ms 144976 KB Output is correct
95 Correct 146 ms 144992 KB Output is correct
96 Correct 151 ms 143024 KB Output is correct
97 Correct 125 ms 142960 KB Output is correct
98 Correct 125 ms 142984 KB Output is correct
99 Correct 146 ms 142900 KB Output is correct
100 Correct 169 ms 143128 KB Output is correct
101 Correct 169 ms 143048 KB Output is correct
102 Correct 180 ms 143092 KB Output is correct
103 Correct 129 ms 142948 KB Output is correct
104 Correct 154 ms 144068 KB Output is correct
105 Correct 159 ms 143288 KB Output is correct
106 Correct 139 ms 143120 KB Output is correct
107 Correct 136 ms 142988 KB Output is correct
108 Correct 148 ms 143720 KB Output is correct
109 Correct 146 ms 143296 KB Output is correct
110 Correct 145 ms 143044 KB Output is correct
111 Correct 128 ms 143004 KB Output is correct
112 Correct 128 ms 144248 KB Output is correct
113 Correct 164 ms 144212 KB Output is correct
114 Correct 147 ms 144292 KB Output is correct
115 Correct 133 ms 144212 KB Output is correct
116 Correct 134 ms 144180 KB Output is correct
117 Correct 188 ms 144212 KB Output is correct
118 Correct 142 ms 144208 KB Output is correct
119 Correct 131 ms 144276 KB Output is correct
120 Correct 125 ms 144168 KB Output is correct
121 Correct 149 ms 144308 KB Output is correct
122 Correct 148 ms 144900 KB Output is correct
123 Correct 147 ms 144972 KB Output is correct
124 Correct 166 ms 143408 KB Output is correct
125 Correct 153 ms 142980 KB Output is correct
126 Correct 151 ms 142860 KB Output is correct
127 Correct 129 ms 143588 KB Output is correct
128 Correct 144 ms 142980 KB Output is correct
129 Correct 146 ms 142880 KB Output is correct
130 Correct 162 ms 143600 KB Output is correct
131 Correct 147 ms 143008 KB Output is correct
132 Correct 140 ms 142880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 108 ms 141316 KB Output is correct
2 Correct 115 ms 141328 KB Output is correct
3 Correct 98 ms 141348 KB Output is correct
4 Correct 121 ms 141356 KB Output is correct
5 Correct 123 ms 141420 KB Output is correct
6 Correct 128 ms 141304 KB Output is correct
7 Correct 129 ms 141304 KB Output is correct
8 Correct 111 ms 141340 KB Output is correct
9 Correct 112 ms 141384 KB Output is correct
10 Correct 128 ms 141432 KB Output is correct
11 Correct 109 ms 141432 KB Output is correct
12 Correct 111 ms 141428 KB Output is correct
13 Correct 108 ms 141304 KB Output is correct
14 Correct 120 ms 141440 KB Output is correct
15 Correct 128 ms 141372 KB Output is correct
16 Correct 104 ms 141432 KB Output is correct
17 Correct 122 ms 141304 KB Output is correct
18 Correct 124 ms 141380 KB Output is correct
19 Correct 117 ms 141396 KB Output is correct
20 Correct 136 ms 141304 KB Output is correct
21 Correct 133 ms 141416 KB Output is correct
22 Correct 119 ms 141512 KB Output is correct
23 Correct 108 ms 141260 KB Output is correct
24 Correct 132 ms 141328 KB Output is correct
25 Correct 107 ms 141384 KB Output is correct
26 Correct 131 ms 141304 KB Output is correct
27 Correct 129 ms 141360 KB Output is correct
28 Correct 115 ms 141420 KB Output is correct
29 Correct 129 ms 141432 KB Output is correct
30 Correct 117 ms 141348 KB Output is correct
31 Correct 117 ms 141436 KB Output is correct
32 Correct 116 ms 141428 KB Output is correct
33 Correct 103 ms 141256 KB Output is correct
34 Correct 120 ms 141276 KB Output is correct
35 Correct 117 ms 141244 KB Output is correct
36 Correct 123 ms 141324 KB Output is correct
37 Correct 140 ms 141268 KB Output is correct
38 Correct 121 ms 141304 KB Output is correct
39 Correct 106 ms 141376 KB Output is correct
40 Correct 106 ms 141260 KB Output is correct
41 Correct 113 ms 141404 KB Output is correct
42 Correct 132 ms 141324 KB Output is correct
43 Correct 113 ms 141368 KB Output is correct
44 Correct 111 ms 141252 KB Output is correct
45 Correct 111 ms 141364 KB Output is correct
46 Correct 139 ms 141312 KB Output is correct
47 Correct 121 ms 141304 KB Output is correct
48 Correct 116 ms 141304 KB Output is correct
49 Correct 102 ms 141308 KB Output is correct
50 Correct 106 ms 141432 KB Output is correct
51 Correct 118 ms 141412 KB Output is correct
52 Correct 109 ms 141344 KB Output is correct
53 Correct 106 ms 141408 KB Output is correct
54 Correct 105 ms 141304 KB Output is correct
55 Correct 122 ms 141508 KB Output is correct
56 Correct 103 ms 141416 KB Output is correct
57 Correct 102 ms 141400 KB Output is correct
58 Correct 108 ms 141332 KB Output is correct
59 Correct 107 ms 141304 KB Output is correct
60 Correct 121 ms 141412 KB Output is correct
61 Correct 124 ms 141284 KB Output is correct
62 Correct 111 ms 141200 KB Output is correct
63 Correct 113 ms 141220 KB Output is correct
64 Correct 146 ms 144368 KB Output is correct
65 Correct 147 ms 143448 KB Output is correct
66 Correct 162 ms 143084 KB Output is correct
67 Correct 144 ms 142980 KB Output is correct
68 Correct 164 ms 144360 KB Output is correct
69 Correct 141 ms 143492 KB Output is correct
70 Correct 147 ms 143236 KB Output is correct
71 Correct 142 ms 143084 KB Output is correct
72 Correct 148 ms 144692 KB Output is correct
73 Correct 155 ms 144428 KB Output is correct
74 Correct 167 ms 144368 KB Output is correct
75 Correct 151 ms 144332 KB Output is correct
76 Correct 159 ms 144960 KB Output is correct
77 Correct 153 ms 144972 KB Output is correct
78 Correct 158 ms 145004 KB Output is correct
79 Correct 159 ms 144976 KB Output is correct
80 Correct 137 ms 144320 KB Output is correct
81 Correct 140 ms 143452 KB Output is correct
82 Correct 131 ms 143156 KB Output is correct
83 Correct 148 ms 142928 KB Output is correct
84 Correct 171 ms 144348 KB Output is correct
85 Correct 139 ms 143492 KB Output is correct
86 Correct 167 ms 143164 KB Output is correct
87 Correct 136 ms 143020 KB Output is correct
88 Correct 145 ms 144684 KB Output is correct
89 Correct 153 ms 144388 KB Output is correct
90 Correct 144 ms 144364 KB Output is correct
91 Correct 140 ms 144240 KB Output is correct
92 Correct 137 ms 145012 KB Output is correct
93 Correct 155 ms 144940 KB Output is correct
94 Correct 160 ms 144976 KB Output is correct
95 Correct 146 ms 144992 KB Output is correct
96 Correct 151 ms 143024 KB Output is correct
97 Correct 125 ms 142960 KB Output is correct
98 Correct 125 ms 142984 KB Output is correct
99 Correct 146 ms 142900 KB Output is correct
100 Correct 169 ms 143128 KB Output is correct
101 Correct 169 ms 143048 KB Output is correct
102 Correct 180 ms 143092 KB Output is correct
103 Correct 129 ms 142948 KB Output is correct
104 Correct 154 ms 144068 KB Output is correct
105 Correct 159 ms 143288 KB Output is correct
106 Correct 139 ms 143120 KB Output is correct
107 Correct 136 ms 142988 KB Output is correct
108 Correct 148 ms 143720 KB Output is correct
109 Correct 146 ms 143296 KB Output is correct
110 Correct 145 ms 143044 KB Output is correct
111 Correct 128 ms 143004 KB Output is correct
112 Correct 128 ms 144248 KB Output is correct
113 Correct 164 ms 144212 KB Output is correct
114 Correct 147 ms 144292 KB Output is correct
115 Correct 133 ms 144212 KB Output is correct
116 Correct 134 ms 144180 KB Output is correct
117 Correct 188 ms 144212 KB Output is correct
118 Correct 142 ms 144208 KB Output is correct
119 Correct 131 ms 144276 KB Output is correct
120 Correct 125 ms 144168 KB Output is correct
121 Correct 149 ms 144308 KB Output is correct
122 Correct 148 ms 144900 KB Output is correct
123 Correct 147 ms 144972 KB Output is correct
124 Correct 166 ms 143408 KB Output is correct
125 Correct 153 ms 142980 KB Output is correct
126 Correct 151 ms 142860 KB Output is correct
127 Correct 129 ms 143588 KB Output is correct
128 Correct 144 ms 142980 KB Output is correct
129 Correct 146 ms 142880 KB Output is correct
130 Correct 162 ms 143600 KB Output is correct
131 Correct 147 ms 143008 KB Output is correct
132 Correct 140 ms 142880 KB Output is correct
133 Correct 288 ms 154048 KB Output is correct
134 Correct 258 ms 150432 KB Output is correct
135 Correct 256 ms 148664 KB Output is correct
136 Correct 204 ms 148416 KB Output is correct
137 Correct 296 ms 153808 KB Output is correct
138 Correct 287 ms 150464 KB Output is correct
139 Correct 257 ms 148844 KB Output is correct
140 Correct 221 ms 148532 KB Output is correct
141 Correct 285 ms 155320 KB Output is correct
142 Correct 298 ms 154072 KB Output is correct
143 Correct 294 ms 154024 KB Output is correct
144 Correct 317 ms 153840 KB Output is correct
145 Correct 368 ms 156584 KB Output is correct
146 Correct 281 ms 156292 KB Output is correct
147 Correct 284 ms 156456 KB Output is correct
148 Correct 282 ms 156460 KB Output is correct
149 Correct 308 ms 154088 KB Output is correct
150 Correct 302 ms 150264 KB Output is correct
151 Correct 235 ms 148776 KB Output is correct
152 Correct 198 ms 148364 KB Output is correct
153 Correct 360 ms 153824 KB Output is correct
154 Correct 263 ms 150324 KB Output is correct
155 Correct 257 ms 148872 KB Output is correct
156 Correct 241 ms 148628 KB Output is correct
157 Correct 291 ms 155304 KB Output is correct
158 Correct 296 ms 154144 KB Output is correct
159 Correct 323 ms 153832 KB Output is correct
160 Correct 264 ms 153820 KB Output is correct
161 Correct 339 ms 156448 KB Output is correct
162 Correct 281 ms 156416 KB Output is correct
163 Correct 282 ms 156400 KB Output is correct
164 Correct 327 ms 156272 KB Output is correct
165 Correct 222 ms 148424 KB Output is correct
166 Correct 200 ms 148416 KB Output is correct
167 Correct 194 ms 148416 KB Output is correct
168 Correct 186 ms 148408 KB Output is correct
169 Correct 269 ms 148640 KB Output is correct
170 Correct 225 ms 148416 KB Output is correct
171 Correct 236 ms 148500 KB Output is correct
172 Correct 211 ms 148420 KB Output is correct
173 Correct 312 ms 153108 KB Output is correct
174 Correct 270 ms 149940 KB Output is correct
175 Correct 235 ms 148784 KB Output is correct
176 Correct 224 ms 148448 KB Output is correct
177 Correct 257 ms 151584 KB Output is correct
178 Correct 250 ms 149708 KB Output is correct
179 Correct 228 ms 148732 KB Output is correct
180 Correct 207 ms 148408 KB Output is correct
181 Correct 203 ms 153536 KB Output is correct
182 Correct 223 ms 153724 KB Output is correct
183 Correct 190 ms 153600 KB Output is correct
184 Correct 217 ms 153896 KB Output is correct
185 Correct 233 ms 153652 KB Output is correct
186 Correct 252 ms 153768 KB Output is correct
187 Correct 188 ms 153764 KB Output is correct
188 Correct 221 ms 153604 KB Output is correct
189 Correct 261 ms 153544 KB Output is correct
190 Correct 240 ms 153732 KB Output is correct
191 Correct 210 ms 156320 KB Output is correct
192 Correct 228 ms 156344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 583 ms 201048 KB Output is correct
2 Correct 583 ms 201500 KB Output is correct
3 Correct 1047 ms 261048 KB Output is correct
4 Correct 1072 ms 261424 KB Output is correct
5 Correct 1275 ms 286860 KB Output is correct
6 Correct 1235 ms 287040 KB Output is correct
7 Correct 1644 ms 211980 KB Output is correct
8 Correct 1356 ms 192920 KB Output is correct
9 Correct 1374 ms 192220 KB Output is correct
10 Correct 1650 ms 216020 KB Output is correct
11 Correct 1372 ms 193000 KB Output is correct
12 Correct 1368 ms 191776 KB Output is correct
13 Correct 1742 ms 216688 KB Output is correct
14 Correct 1332 ms 192404 KB Output is correct
15 Correct 1779 ms 192020 KB Output is correct
16 Correct 1101 ms 202304 KB Output is correct
17 Correct 1140 ms 202320 KB Output is correct
18 Correct 1103 ms 202236 KB Output is correct
19 Correct 1111 ms 202368 KB Output is correct
20 Correct 1441 ms 202304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 108 ms 141316 KB Output is correct
2 Correct 115 ms 141328 KB Output is correct
3 Correct 98 ms 141348 KB Output is correct
4 Correct 121 ms 141356 KB Output is correct
5 Correct 123 ms 141420 KB Output is correct
6 Correct 128 ms 141304 KB Output is correct
7 Correct 129 ms 141304 KB Output is correct
8 Correct 111 ms 141340 KB Output is correct
9 Correct 112 ms 141384 KB Output is correct
10 Correct 128 ms 141432 KB Output is correct
11 Correct 109 ms 141432 KB Output is correct
12 Correct 111 ms 141428 KB Output is correct
13 Correct 108 ms 141304 KB Output is correct
14 Correct 120 ms 141440 KB Output is correct
15 Correct 128 ms 141372 KB Output is correct
16 Correct 104 ms 141432 KB Output is correct
17 Correct 122 ms 141304 KB Output is correct
18 Correct 124 ms 141380 KB Output is correct
19 Correct 117 ms 141396 KB Output is correct
20 Correct 136 ms 141304 KB Output is correct
21 Correct 133 ms 141416 KB Output is correct
22 Correct 119 ms 141512 KB Output is correct
23 Correct 108 ms 141260 KB Output is correct
24 Correct 132 ms 141328 KB Output is correct
25 Correct 107 ms 141384 KB Output is correct
26 Correct 131 ms 141304 KB Output is correct
27 Correct 129 ms 141360 KB Output is correct
28 Correct 115 ms 141420 KB Output is correct
29 Correct 129 ms 141432 KB Output is correct
30 Correct 117 ms 141348 KB Output is correct
31 Correct 117 ms 141436 KB Output is correct
32 Correct 116 ms 141428 KB Output is correct
33 Correct 103 ms 141256 KB Output is correct
34 Correct 120 ms 141276 KB Output is correct
35 Correct 117 ms 141244 KB Output is correct
36 Correct 123 ms 141324 KB Output is correct
37 Correct 140 ms 141268 KB Output is correct
38 Correct 121 ms 141304 KB Output is correct
39 Correct 106 ms 141376 KB Output is correct
40 Correct 106 ms 141260 KB Output is correct
41 Correct 113 ms 141404 KB Output is correct
42 Correct 132 ms 141324 KB Output is correct
43 Correct 113 ms 141368 KB Output is correct
44 Correct 111 ms 141252 KB Output is correct
45 Correct 111 ms 141364 KB Output is correct
46 Correct 139 ms 141312 KB Output is correct
47 Correct 121 ms 141304 KB Output is correct
48 Correct 116 ms 141304 KB Output is correct
49 Correct 102 ms 141308 KB Output is correct
50 Correct 106 ms 141432 KB Output is correct
51 Correct 118 ms 141412 KB Output is correct
52 Correct 109 ms 141344 KB Output is correct
53 Correct 106 ms 141408 KB Output is correct
54 Correct 105 ms 141304 KB Output is correct
55 Correct 122 ms 141508 KB Output is correct
56 Correct 103 ms 141416 KB Output is correct
57 Correct 102 ms 141400 KB Output is correct
58 Correct 108 ms 141332 KB Output is correct
59 Correct 107 ms 141304 KB Output is correct
60 Correct 121 ms 141412 KB Output is correct
61 Correct 124 ms 141284 KB Output is correct
62 Correct 111 ms 141200 KB Output is correct
63 Correct 113 ms 141220 KB Output is correct
64 Correct 146 ms 144368 KB Output is correct
65 Correct 147 ms 143448 KB Output is correct
66 Correct 162 ms 143084 KB Output is correct
67 Correct 144 ms 142980 KB Output is correct
68 Correct 164 ms 144360 KB Output is correct
69 Correct 141 ms 143492 KB Output is correct
70 Correct 147 ms 143236 KB Output is correct
71 Correct 142 ms 143084 KB Output is correct
72 Correct 148 ms 144692 KB Output is correct
73 Correct 155 ms 144428 KB Output is correct
74 Correct 167 ms 144368 KB Output is correct
75 Correct 151 ms 144332 KB Output is correct
76 Correct 159 ms 144960 KB Output is correct
77 Correct 153 ms 144972 KB Output is correct
78 Correct 158 ms 145004 KB Output is correct
79 Correct 159 ms 144976 KB Output is correct
80 Correct 137 ms 144320 KB Output is correct
81 Correct 140 ms 143452 KB Output is correct
82 Correct 131 ms 143156 KB Output is correct
83 Correct 148 ms 142928 KB Output is correct
84 Correct 171 ms 144348 KB Output is correct
85 Correct 139 ms 143492 KB Output is correct
86 Correct 167 ms 143164 KB Output is correct
87 Correct 136 ms 143020 KB Output is correct
88 Correct 145 ms 144684 KB Output is correct
89 Correct 153 ms 144388 KB Output is correct
90 Correct 144 ms 144364 KB Output is correct
91 Correct 140 ms 144240 KB Output is correct
92 Correct 137 ms 145012 KB Output is correct
93 Correct 155 ms 144940 KB Output is correct
94 Correct 160 ms 144976 KB Output is correct
95 Correct 146 ms 144992 KB Output is correct
96 Correct 151 ms 143024 KB Output is correct
97 Correct 125 ms 142960 KB Output is correct
98 Correct 125 ms 142984 KB Output is correct
99 Correct 146 ms 142900 KB Output is correct
100 Correct 169 ms 143128 KB Output is correct
101 Correct 169 ms 143048 KB Output is correct
102 Correct 180 ms 143092 KB Output is correct
103 Correct 129 ms 142948 KB Output is correct
104 Correct 154 ms 144068 KB Output is correct
105 Correct 159 ms 143288 KB Output is correct
106 Correct 139 ms 143120 KB Output is correct
107 Correct 136 ms 142988 KB Output is correct
108 Correct 148 ms 143720 KB Output is correct
109 Correct 146 ms 143296 KB Output is correct
110 Correct 145 ms 143044 KB Output is correct
111 Correct 128 ms 143004 KB Output is correct
112 Correct 128 ms 144248 KB Output is correct
113 Correct 164 ms 144212 KB Output is correct
114 Correct 147 ms 144292 KB Output is correct
115 Correct 133 ms 144212 KB Output is correct
116 Correct 134 ms 144180 KB Output is correct
117 Correct 188 ms 144212 KB Output is correct
118 Correct 142 ms 144208 KB Output is correct
119 Correct 131 ms 144276 KB Output is correct
120 Correct 125 ms 144168 KB Output is correct
121 Correct 149 ms 144308 KB Output is correct
122 Correct 148 ms 144900 KB Output is correct
123 Correct 147 ms 144972 KB Output is correct
124 Correct 166 ms 143408 KB Output is correct
125 Correct 153 ms 142980 KB Output is correct
126 Correct 151 ms 142860 KB Output is correct
127 Correct 129 ms 143588 KB Output is correct
128 Correct 144 ms 142980 KB Output is correct
129 Correct 146 ms 142880 KB Output is correct
130 Correct 162 ms 143600 KB Output is correct
131 Correct 147 ms 143008 KB Output is correct
132 Correct 140 ms 142880 KB Output is correct
133 Correct 288 ms 154048 KB Output is correct
134 Correct 258 ms 150432 KB Output is correct
135 Correct 256 ms 148664 KB Output is correct
136 Correct 204 ms 148416 KB Output is correct
137 Correct 296 ms 153808 KB Output is correct
138 Correct 287 ms 150464 KB Output is correct
139 Correct 257 ms 148844 KB Output is correct
140 Correct 221 ms 148532 KB Output is correct
141 Correct 285 ms 155320 KB Output is correct
142 Correct 298 ms 154072 KB Output is correct
143 Correct 294 ms 154024 KB Output is correct
144 Correct 317 ms 153840 KB Output is correct
145 Correct 368 ms 156584 KB Output is correct
146 Correct 281 ms 156292 KB Output is correct
147 Correct 284 ms 156456 KB Output is correct
148 Correct 282 ms 156460 KB Output is correct
149 Correct 308 ms 154088 KB Output is correct
150 Correct 302 ms 150264 KB Output is correct
151 Correct 235 ms 148776 KB Output is correct
152 Correct 198 ms 148364 KB Output is correct
153 Correct 360 ms 153824 KB Output is correct
154 Correct 263 ms 150324 KB Output is correct
155 Correct 257 ms 148872 KB Output is correct
156 Correct 241 ms 148628 KB Output is correct
157 Correct 291 ms 155304 KB Output is correct
158 Correct 296 ms 154144 KB Output is correct
159 Correct 323 ms 153832 KB Output is correct
160 Correct 264 ms 153820 KB Output is correct
161 Correct 339 ms 156448 KB Output is correct
162 Correct 281 ms 156416 KB Output is correct
163 Correct 282 ms 156400 KB Output is correct
164 Correct 327 ms 156272 KB Output is correct
165 Correct 222 ms 148424 KB Output is correct
166 Correct 200 ms 148416 KB Output is correct
167 Correct 194 ms 148416 KB Output is correct
168 Correct 186 ms 148408 KB Output is correct
169 Correct 269 ms 148640 KB Output is correct
170 Correct 225 ms 148416 KB Output is correct
171 Correct 236 ms 148500 KB Output is correct
172 Correct 211 ms 148420 KB Output is correct
173 Correct 312 ms 153108 KB Output is correct
174 Correct 270 ms 149940 KB Output is correct
175 Correct 235 ms 148784 KB Output is correct
176 Correct 224 ms 148448 KB Output is correct
177 Correct 257 ms 151584 KB Output is correct
178 Correct 250 ms 149708 KB Output is correct
179 Correct 228 ms 148732 KB Output is correct
180 Correct 207 ms 148408 KB Output is correct
181 Correct 203 ms 153536 KB Output is correct
182 Correct 223 ms 153724 KB Output is correct
183 Correct 190 ms 153600 KB Output is correct
184 Correct 217 ms 153896 KB Output is correct
185 Correct 233 ms 153652 KB Output is correct
186 Correct 252 ms 153768 KB Output is correct
187 Correct 188 ms 153764 KB Output is correct
188 Correct 221 ms 153604 KB Output is correct
189 Correct 261 ms 153544 KB Output is correct
190 Correct 240 ms 153732 KB Output is correct
191 Correct 210 ms 156320 KB Output is correct
192 Correct 228 ms 156344 KB Output is correct
193 Correct 583 ms 201048 KB Output is correct
194 Correct 583 ms 201500 KB Output is correct
195 Correct 1047 ms 261048 KB Output is correct
196 Correct 1072 ms 261424 KB Output is correct
197 Correct 1275 ms 286860 KB Output is correct
198 Correct 1235 ms 287040 KB Output is correct
199 Correct 1644 ms 211980 KB Output is correct
200 Correct 1356 ms 192920 KB Output is correct
201 Correct 1374 ms 192220 KB Output is correct
202 Correct 1650 ms 216020 KB Output is correct
203 Correct 1372 ms 193000 KB Output is correct
204 Correct 1368 ms 191776 KB Output is correct
205 Correct 1742 ms 216688 KB Output is correct
206 Correct 1332 ms 192404 KB Output is correct
207 Correct 1779 ms 192020 KB Output is correct
208 Correct 1101 ms 202304 KB Output is correct
209 Correct 1140 ms 202320 KB Output is correct
210 Correct 1103 ms 202236 KB Output is correct
211 Correct 1111 ms 202368 KB Output is correct
212 Correct 1441 ms 202304 KB Output is correct
213 Correct 2223 ms 269004 KB Output is correct
214 Correct 1908 ms 233336 KB Output is correct
215 Correct 2258 ms 218456 KB Output is correct
216 Correct 2399 ms 210660 KB Output is correct
217 Correct 2072 ms 267292 KB Output is correct
218 Correct 2043 ms 232916 KB Output is correct
219 Correct 1859 ms 216824 KB Output is correct
220 Correct 1955 ms 211824 KB Output is correct
221 Correct 2496 ms 281928 KB Output is correct
222 Correct 3731 ms 269540 KB Output is correct
223 Correct 2061 ms 267220 KB Output is correct
224 Correct 2192 ms 265504 KB Output is correct
225 Correct 2183 ms 288904 KB Output is correct
226 Correct 2218 ms 292248 KB Output is correct
227 Correct 2097 ms 294796 KB Output is correct
228 Correct 2289 ms 294568 KB Output is correct
229 Correct 2248 ms 275476 KB Output is correct
230 Correct 2144 ms 241392 KB Output is correct
231 Correct 2074 ms 224592 KB Output is correct
232 Correct 1666 ms 217688 KB Output is correct
233 Correct 2214 ms 276184 KB Output is correct
234 Correct 1973 ms 240116 KB Output is correct
235 Correct 1992 ms 225772 KB Output is correct
236 Correct 1688 ms 218540 KB Output is correct
237 Correct 2418 ms 289432 KB Output is correct
238 Correct 2582 ms 276972 KB Output is correct
239 Correct 2409 ms 274656 KB Output is correct
240 Correct 2445 ms 273004 KB Output is correct
241 Correct 2520 ms 294748 KB Output is correct
242 Correct 2255 ms 294584 KB Output is correct
243 Correct 2597 ms 294604 KB Output is correct
244 Correct 2575 ms 294148 KB Output is correct
245 Correct 1217 ms 217864 KB Output is correct
246 Correct 1205 ms 217884 KB Output is correct
247 Correct 1214 ms 217800 KB Output is correct
248 Correct 1135 ms 217744 KB Output is correct
249 Correct 1782 ms 219912 KB Output is correct
250 Correct 1626 ms 219120 KB Output is correct
251 Correct 1509 ms 219364 KB Output is correct
252 Correct 1397 ms 217896 KB Output is correct
253 Correct 2029 ms 266144 KB Output is correct
254 Correct 1912 ms 234452 KB Output is correct
255 Correct 1788 ms 222716 KB Output is correct
256 Correct 1283 ms 217812 KB Output is correct
257 Correct 1922 ms 247632 KB Output is correct
258 Correct 1927 ms 230720 KB Output is correct
259 Correct 1765 ms 222012 KB Output is correct
260 Correct 1417 ms 217896 KB Output is correct
261 Correct 1283 ms 268056 KB Output is correct
262 Correct 1747 ms 268180 KB Output is correct
263 Correct 1028 ms 253620 KB Output is correct
264 Correct 1333 ms 253576 KB Output is correct
265 Correct 1187 ms 268312 KB Output is correct
266 Correct 1540 ms 268204 KB Output is correct
267 Correct 975 ms 253476 KB Output is correct
268 Correct 1641 ms 253756 KB Output is correct
269 Correct 1408 ms 294468 KB Output is correct
270 Correct 1296 ms 294640 KB Output is correct
271 Correct 1798 ms 222140 KB Output is correct
272 Correct 1340 ms 198412 KB Output is correct
273 Correct 1945 ms 222720 KB Output is correct
274 Correct 1424 ms 198804 KB Output is correct
275 Correct 1460 ms 219480 KB Output is correct