답안 #313607

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
313607 2020-10-16T11:22:48 Z gurkot Interval Collection (CCO20_day2problem2) C++14
25 / 25
3963 ms 245100 KB
#include <iostream>
#include <set>
using namespace std;

multiset <int> setl,setr;
multiset <int> msl[1000001],msr[1000001];
struct Node { int maxl,minr,ans;} tree[4000001];
const int TS=1000000; 
int q,a,b;
char ch;
    
void update_L(int u,int a,int b,int pos,int val) {
 //cout<<a<<"   -L-   "<<b<<" u="<<u<<endl;
 if(a==b) {
  tree[u].maxl=val; tree[u].ans=tree[u].minr-val; 
  //cout<<"tree_L: ans="<<tree[u].ans<<endl;
  //cout<<a<<"   -L-   "<<b<<" u="<<u<<endl;
  return;
 } 
 int c=(a+b)/2;
 int l,r;
 l=2*u; r=l+1;
 if(pos<=c) update_L(l,a,c,pos,val);
       else update_L(r, c+1,b,pos,val);
 
 tree[u].maxl=max(tree[l].maxl,tree[r].maxl);
 tree[u].minr=min(tree[l].minr,tree[r].minr);      
 tree[u].ans=min(tree[l].ans,tree[r].ans);
 tree[u].ans=min(tree[u].ans,tree[r].minr-tree[l].maxl);       
}


void update_R(int u,int a,int b,int pos,int val) {
 //cout<<a<<"   -R-   "<<b<<" u="<<u<<endl;
 if(a==b) {
  tree[u].minr=val;	tree[u].ans=val-tree[u].maxl;  
  //cout<<"tree_R: ans="<<tree[u].ans<<endl;
  //cout<<a<<"   -R-   "<<b<<" u="<<u<<endl;
  return;
 } 
 int c=(a+b)/2;
 int l,r;
 l=2*u; r=l+1;
 if(pos<=c) {
  update_R(l,a,  c,pos,val);
  tree[u].maxl=max(tree[l].maxl,tree[r].maxl);
  tree[u].minr=min(tree[l].minr,tree[r].minr);
  
 } else {
  update_R(r,c+1,b,pos,val);
  tree[u].maxl=max(tree[l].maxl,tree[r].maxl);
  tree[u].minr=min(tree[l].minr,tree[r].minr);  
 }
  
  
      
 tree[u].ans=min(tree[l].ans,tree[r].ans);
 tree[u].ans=min(tree[u].ans,tree[r].minr-tree[l].maxl);       
}

main(){ 
 for (int i=1;i<=4000000;i++){ 
   tree[i].maxl=-10000000, tree[i].minr=10000000;
   tree[i].ans=2000001;
 }
   
 ios::sync_with_stdio(false);
 cin>>q;
 while(q--) {
  cin>>ch>>a>>b;
  if(ch=='A') {
   setl.insert(a); setr.insert(b);
   msl[b].insert(a); msr[a].insert(b); 
   
   //cout<<*msl[b].rbegin()<<"  - ok1- "<<*msr[a].begin()<<endl;   
   //system("pause");
                
   
   update_R(1,1,TS,a,*msr[a].begin());
   update_L(1,1,TS,b,*msl[b].rbegin());
   
   
  } else { 
   setl.erase(setl.find(a));        setr.erase(setr.find(b));
   msl[b].erase(msl[b].find(a));    msr[a].erase(msr[a].find(b));
   
   
     
   if (msr[a].size()==0) update_R(1,1,TS,a,10000000);
                   else  update_R(1,1,TS,a,*msr[a].begin());
                   
   if (msl[b].size()==0) update_L(1,1,TS,b,-10000000);
                   else  update_L(1,1,TS,b,*msl[b].rbegin());
   
  }
  
  a=*setl.rbegin();  b=*setr.begin(); 
   //cout<<"a="<<a<<" <- ok4 -> "<<"b="<<b<<endl;
   
  /* 
   cout<<"tree\n";
   for (int i=1;i<10;i++) 
    cout<<"node "<<i<<":    "<<
	  tree[i].maxl<<" "<<tree[i].minr<<"  ans="<<tree[i].ans<<endl;
   system("pause");
  */
           
  if(a<b)   cout<<(*msr[a].begin()-*msl[b].rbegin())<<endl;
     else   cout<<tree[1].ans<<endl;  
 }//while
}

Compilation message

Main.cpp:61:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   61 | main(){
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 141304 KB Output is correct
2 Correct 88 ms 141176 KB Output is correct
3 Correct 87 ms 141176 KB Output is correct
4 Correct 88 ms 141176 KB Output is correct
5 Correct 88 ms 141304 KB Output is correct
6 Correct 88 ms 141304 KB Output is correct
7 Correct 90 ms 141192 KB Output is correct
8 Correct 89 ms 141204 KB Output is correct
9 Correct 88 ms 141360 KB Output is correct
10 Correct 90 ms 141304 KB Output is correct
11 Correct 91 ms 141304 KB Output is correct
12 Correct 90 ms 141304 KB Output is correct
13 Correct 90 ms 141304 KB Output is correct
14 Correct 91 ms 141304 KB Output is correct
15 Correct 94 ms 141432 KB Output is correct
16 Correct 88 ms 141304 KB Output is correct
17 Correct 87 ms 141304 KB Output is correct
18 Correct 87 ms 141176 KB Output is correct
19 Correct 88 ms 141176 KB Output is correct
20 Correct 90 ms 141308 KB Output is correct
21 Correct 90 ms 141304 KB Output is correct
22 Correct 90 ms 141304 KB Output is correct
23 Correct 91 ms 141176 KB Output is correct
24 Correct 92 ms 141304 KB Output is correct
25 Correct 91 ms 141304 KB Output is correct
26 Correct 90 ms 141304 KB Output is correct
27 Correct 89 ms 141304 KB Output is correct
28 Correct 88 ms 141304 KB Output is correct
29 Correct 90 ms 141304 KB Output is correct
30 Correct 89 ms 141304 KB Output is correct
31 Correct 88 ms 141304 KB Output is correct
32 Correct 88 ms 141304 KB Output is correct
33 Correct 88 ms 141176 KB Output is correct
34 Correct 87 ms 141180 KB Output is correct
35 Correct 88 ms 141176 KB Output is correct
36 Correct 87 ms 141176 KB Output is correct
37 Correct 89 ms 141176 KB Output is correct
38 Correct 88 ms 141176 KB Output is correct
39 Correct 88 ms 141176 KB Output is correct
40 Correct 88 ms 141236 KB Output is correct
41 Correct 88 ms 141304 KB Output is correct
42 Correct 89 ms 141176 KB Output is correct
43 Correct 90 ms 141176 KB Output is correct
44 Correct 90 ms 141432 KB Output is correct
45 Correct 87 ms 141292 KB Output is correct
46 Correct 87 ms 141304 KB Output is correct
47 Correct 89 ms 141176 KB Output is correct
48 Correct 88 ms 141176 KB Output is correct
49 Correct 88 ms 141304 KB Output is correct
50 Correct 88 ms 141304 KB Output is correct
51 Correct 88 ms 141304 KB Output is correct
52 Correct 88 ms 141432 KB Output is correct
53 Correct 87 ms 141304 KB Output is correct
54 Correct 88 ms 141304 KB Output is correct
55 Correct 89 ms 141256 KB Output is correct
56 Correct 89 ms 141336 KB Output is correct
57 Correct 88 ms 141308 KB Output is correct
58 Correct 89 ms 141304 KB Output is correct
59 Correct 90 ms 141304 KB Output is correct
60 Correct 89 ms 141304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 141304 KB Output is correct
2 Correct 88 ms 141176 KB Output is correct
3 Correct 87 ms 141176 KB Output is correct
4 Correct 88 ms 141176 KB Output is correct
5 Correct 88 ms 141304 KB Output is correct
6 Correct 88 ms 141304 KB Output is correct
7 Correct 90 ms 141192 KB Output is correct
8 Correct 89 ms 141204 KB Output is correct
9 Correct 88 ms 141360 KB Output is correct
10 Correct 90 ms 141304 KB Output is correct
11 Correct 91 ms 141304 KB Output is correct
12 Correct 90 ms 141304 KB Output is correct
13 Correct 90 ms 141304 KB Output is correct
14 Correct 91 ms 141304 KB Output is correct
15 Correct 94 ms 141432 KB Output is correct
16 Correct 88 ms 141304 KB Output is correct
17 Correct 87 ms 141304 KB Output is correct
18 Correct 87 ms 141176 KB Output is correct
19 Correct 88 ms 141176 KB Output is correct
20 Correct 90 ms 141308 KB Output is correct
21 Correct 90 ms 141304 KB Output is correct
22 Correct 90 ms 141304 KB Output is correct
23 Correct 91 ms 141176 KB Output is correct
24 Correct 92 ms 141304 KB Output is correct
25 Correct 91 ms 141304 KB Output is correct
26 Correct 90 ms 141304 KB Output is correct
27 Correct 89 ms 141304 KB Output is correct
28 Correct 88 ms 141304 KB Output is correct
29 Correct 90 ms 141304 KB Output is correct
30 Correct 89 ms 141304 KB Output is correct
31 Correct 88 ms 141304 KB Output is correct
32 Correct 88 ms 141304 KB Output is correct
33 Correct 88 ms 141176 KB Output is correct
34 Correct 87 ms 141180 KB Output is correct
35 Correct 88 ms 141176 KB Output is correct
36 Correct 87 ms 141176 KB Output is correct
37 Correct 89 ms 141176 KB Output is correct
38 Correct 88 ms 141176 KB Output is correct
39 Correct 88 ms 141176 KB Output is correct
40 Correct 88 ms 141236 KB Output is correct
41 Correct 88 ms 141304 KB Output is correct
42 Correct 89 ms 141176 KB Output is correct
43 Correct 90 ms 141176 KB Output is correct
44 Correct 90 ms 141432 KB Output is correct
45 Correct 87 ms 141292 KB Output is correct
46 Correct 87 ms 141304 KB Output is correct
47 Correct 89 ms 141176 KB Output is correct
48 Correct 88 ms 141176 KB Output is correct
49 Correct 88 ms 141304 KB Output is correct
50 Correct 88 ms 141304 KB Output is correct
51 Correct 88 ms 141304 KB Output is correct
52 Correct 88 ms 141432 KB Output is correct
53 Correct 87 ms 141304 KB Output is correct
54 Correct 88 ms 141304 KB Output is correct
55 Correct 89 ms 141256 KB Output is correct
56 Correct 89 ms 141336 KB Output is correct
57 Correct 88 ms 141308 KB Output is correct
58 Correct 89 ms 141304 KB Output is correct
59 Correct 90 ms 141304 KB Output is correct
60 Correct 89 ms 141304 KB Output is correct
61 Correct 86 ms 141304 KB Output is correct
62 Correct 86 ms 141240 KB Output is correct
63 Correct 89 ms 141308 KB Output is correct
64 Correct 151 ms 142584 KB Output is correct
65 Correct 142 ms 141688 KB Output is correct
66 Correct 138 ms 141560 KB Output is correct
67 Correct 133 ms 141688 KB Output is correct
68 Correct 147 ms 142584 KB Output is correct
69 Correct 141 ms 141688 KB Output is correct
70 Correct 135 ms 141560 KB Output is correct
71 Correct 141 ms 141560 KB Output is correct
72 Correct 153 ms 143296 KB Output is correct
73 Correct 148 ms 142968 KB Output is correct
74 Correct 148 ms 142968 KB Output is correct
75 Correct 144 ms 142840 KB Output is correct
76 Correct 152 ms 143784 KB Output is correct
77 Correct 149 ms 143736 KB Output is correct
78 Correct 155 ms 143832 KB Output is correct
79 Correct 152 ms 143736 KB Output is correct
80 Correct 164 ms 142596 KB Output is correct
81 Correct 142 ms 141888 KB Output is correct
82 Correct 134 ms 141568 KB Output is correct
83 Correct 131 ms 141560 KB Output is correct
84 Correct 150 ms 142840 KB Output is correct
85 Correct 141 ms 141736 KB Output is correct
86 Correct 142 ms 141688 KB Output is correct
87 Correct 133 ms 141560 KB Output is correct
88 Correct 153 ms 143352 KB Output is correct
89 Correct 149 ms 142968 KB Output is correct
90 Correct 149 ms 142968 KB Output is correct
91 Correct 149 ms 142840 KB Output is correct
92 Correct 157 ms 143736 KB Output is correct
93 Correct 148 ms 143736 KB Output is correct
94 Correct 149 ms 143736 KB Output is correct
95 Correct 153 ms 143864 KB Output is correct
96 Correct 147 ms 141560 KB Output is correct
97 Correct 131 ms 141560 KB Output is correct
98 Correct 133 ms 141560 KB Output is correct
99 Correct 133 ms 141564 KB Output is correct
100 Correct 136 ms 141560 KB Output is correct
101 Correct 134 ms 141560 KB Output is correct
102 Correct 137 ms 141560 KB Output is correct
103 Correct 130 ms 141560 KB Output is correct
104 Correct 143 ms 142584 KB Output is correct
105 Correct 138 ms 141688 KB Output is correct
106 Correct 135 ms 141560 KB Output is correct
107 Correct 130 ms 141560 KB Output is correct
108 Correct 143 ms 142584 KB Output is correct
109 Correct 141 ms 141656 KB Output is correct
110 Correct 137 ms 141540 KB Output is correct
111 Correct 130 ms 141560 KB Output is correct
112 Correct 130 ms 142712 KB Output is correct
113 Correct 136 ms 142712 KB Output is correct
114 Correct 133 ms 142584 KB Output is correct
115 Correct 135 ms 142584 KB Output is correct
116 Correct 132 ms 142584 KB Output is correct
117 Correct 136 ms 142712 KB Output is correct
118 Correct 132 ms 142560 KB Output is correct
119 Correct 134 ms 142712 KB Output is correct
120 Correct 133 ms 142712 KB Output is correct
121 Correct 138 ms 142712 KB Output is correct
122 Correct 135 ms 143736 KB Output is correct
123 Correct 138 ms 143736 KB Output is correct
124 Correct 134 ms 141688 KB Output is correct
125 Correct 125 ms 141560 KB Output is correct
126 Correct 124 ms 141560 KB Output is correct
127 Correct 131 ms 142024 KB Output is correct
128 Correct 128 ms 141560 KB Output is correct
129 Correct 126 ms 141560 KB Output is correct
130 Correct 141 ms 142072 KB Output is correct
131 Correct 126 ms 141560 KB Output is correct
132 Correct 125 ms 141560 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 141304 KB Output is correct
2 Correct 88 ms 141176 KB Output is correct
3 Correct 87 ms 141176 KB Output is correct
4 Correct 88 ms 141176 KB Output is correct
5 Correct 88 ms 141304 KB Output is correct
6 Correct 88 ms 141304 KB Output is correct
7 Correct 90 ms 141192 KB Output is correct
8 Correct 89 ms 141204 KB Output is correct
9 Correct 88 ms 141360 KB Output is correct
10 Correct 90 ms 141304 KB Output is correct
11 Correct 91 ms 141304 KB Output is correct
12 Correct 90 ms 141304 KB Output is correct
13 Correct 90 ms 141304 KB Output is correct
14 Correct 91 ms 141304 KB Output is correct
15 Correct 94 ms 141432 KB Output is correct
16 Correct 88 ms 141304 KB Output is correct
17 Correct 87 ms 141304 KB Output is correct
18 Correct 87 ms 141176 KB Output is correct
19 Correct 88 ms 141176 KB Output is correct
20 Correct 90 ms 141308 KB Output is correct
21 Correct 90 ms 141304 KB Output is correct
22 Correct 90 ms 141304 KB Output is correct
23 Correct 91 ms 141176 KB Output is correct
24 Correct 92 ms 141304 KB Output is correct
25 Correct 91 ms 141304 KB Output is correct
26 Correct 90 ms 141304 KB Output is correct
27 Correct 89 ms 141304 KB Output is correct
28 Correct 88 ms 141304 KB Output is correct
29 Correct 90 ms 141304 KB Output is correct
30 Correct 89 ms 141304 KB Output is correct
31 Correct 88 ms 141304 KB Output is correct
32 Correct 88 ms 141304 KB Output is correct
33 Correct 88 ms 141176 KB Output is correct
34 Correct 87 ms 141180 KB Output is correct
35 Correct 88 ms 141176 KB Output is correct
36 Correct 87 ms 141176 KB Output is correct
37 Correct 89 ms 141176 KB Output is correct
38 Correct 88 ms 141176 KB Output is correct
39 Correct 88 ms 141176 KB Output is correct
40 Correct 88 ms 141236 KB Output is correct
41 Correct 88 ms 141304 KB Output is correct
42 Correct 89 ms 141176 KB Output is correct
43 Correct 90 ms 141176 KB Output is correct
44 Correct 90 ms 141432 KB Output is correct
45 Correct 87 ms 141292 KB Output is correct
46 Correct 87 ms 141304 KB Output is correct
47 Correct 89 ms 141176 KB Output is correct
48 Correct 88 ms 141176 KB Output is correct
49 Correct 88 ms 141304 KB Output is correct
50 Correct 88 ms 141304 KB Output is correct
51 Correct 88 ms 141304 KB Output is correct
52 Correct 88 ms 141432 KB Output is correct
53 Correct 87 ms 141304 KB Output is correct
54 Correct 88 ms 141304 KB Output is correct
55 Correct 89 ms 141256 KB Output is correct
56 Correct 89 ms 141336 KB Output is correct
57 Correct 88 ms 141308 KB Output is correct
58 Correct 89 ms 141304 KB Output is correct
59 Correct 90 ms 141304 KB Output is correct
60 Correct 89 ms 141304 KB Output is correct
61 Correct 86 ms 141304 KB Output is correct
62 Correct 86 ms 141240 KB Output is correct
63 Correct 89 ms 141308 KB Output is correct
64 Correct 151 ms 142584 KB Output is correct
65 Correct 142 ms 141688 KB Output is correct
66 Correct 138 ms 141560 KB Output is correct
67 Correct 133 ms 141688 KB Output is correct
68 Correct 147 ms 142584 KB Output is correct
69 Correct 141 ms 141688 KB Output is correct
70 Correct 135 ms 141560 KB Output is correct
71 Correct 141 ms 141560 KB Output is correct
72 Correct 153 ms 143296 KB Output is correct
73 Correct 148 ms 142968 KB Output is correct
74 Correct 148 ms 142968 KB Output is correct
75 Correct 144 ms 142840 KB Output is correct
76 Correct 152 ms 143784 KB Output is correct
77 Correct 149 ms 143736 KB Output is correct
78 Correct 155 ms 143832 KB Output is correct
79 Correct 152 ms 143736 KB Output is correct
80 Correct 164 ms 142596 KB Output is correct
81 Correct 142 ms 141888 KB Output is correct
82 Correct 134 ms 141568 KB Output is correct
83 Correct 131 ms 141560 KB Output is correct
84 Correct 150 ms 142840 KB Output is correct
85 Correct 141 ms 141736 KB Output is correct
86 Correct 142 ms 141688 KB Output is correct
87 Correct 133 ms 141560 KB Output is correct
88 Correct 153 ms 143352 KB Output is correct
89 Correct 149 ms 142968 KB Output is correct
90 Correct 149 ms 142968 KB Output is correct
91 Correct 149 ms 142840 KB Output is correct
92 Correct 157 ms 143736 KB Output is correct
93 Correct 148 ms 143736 KB Output is correct
94 Correct 149 ms 143736 KB Output is correct
95 Correct 153 ms 143864 KB Output is correct
96 Correct 147 ms 141560 KB Output is correct
97 Correct 131 ms 141560 KB Output is correct
98 Correct 133 ms 141560 KB Output is correct
99 Correct 133 ms 141564 KB Output is correct
100 Correct 136 ms 141560 KB Output is correct
101 Correct 134 ms 141560 KB Output is correct
102 Correct 137 ms 141560 KB Output is correct
103 Correct 130 ms 141560 KB Output is correct
104 Correct 143 ms 142584 KB Output is correct
105 Correct 138 ms 141688 KB Output is correct
106 Correct 135 ms 141560 KB Output is correct
107 Correct 130 ms 141560 KB Output is correct
108 Correct 143 ms 142584 KB Output is correct
109 Correct 141 ms 141656 KB Output is correct
110 Correct 137 ms 141540 KB Output is correct
111 Correct 130 ms 141560 KB Output is correct
112 Correct 130 ms 142712 KB Output is correct
113 Correct 136 ms 142712 KB Output is correct
114 Correct 133 ms 142584 KB Output is correct
115 Correct 135 ms 142584 KB Output is correct
116 Correct 132 ms 142584 KB Output is correct
117 Correct 136 ms 142712 KB Output is correct
118 Correct 132 ms 142560 KB Output is correct
119 Correct 134 ms 142712 KB Output is correct
120 Correct 133 ms 142712 KB Output is correct
121 Correct 138 ms 142712 KB Output is correct
122 Correct 135 ms 143736 KB Output is correct
123 Correct 138 ms 143736 KB Output is correct
124 Correct 134 ms 141688 KB Output is correct
125 Correct 125 ms 141560 KB Output is correct
126 Correct 124 ms 141560 KB Output is correct
127 Correct 131 ms 142024 KB Output is correct
128 Correct 128 ms 141560 KB Output is correct
129 Correct 126 ms 141560 KB Output is correct
130 Correct 141 ms 142072 KB Output is correct
131 Correct 126 ms 141560 KB Output is correct
132 Correct 125 ms 141560 KB Output is correct
133 Correct 370 ms 147096 KB Output is correct
134 Correct 329 ms 143160 KB Output is correct
135 Correct 303 ms 142456 KB Output is correct
136 Correct 277 ms 142460 KB Output is correct
137 Correct 373 ms 146996 KB Output is correct
138 Correct 325 ms 143352 KB Output is correct
139 Correct 303 ms 142496 KB Output is correct
140 Correct 291 ms 142456 KB Output is correct
141 Correct 385 ms 149752 KB Output is correct
142 Correct 373 ms 148344 KB Output is correct
143 Correct 365 ms 147960 KB Output is correct
144 Correct 370 ms 147960 KB Output is correct
145 Correct 388 ms 151672 KB Output is correct
146 Correct 397 ms 151660 KB Output is correct
147 Correct 389 ms 151672 KB Output is correct
148 Correct 394 ms 151672 KB Output is correct
149 Correct 373 ms 146936 KB Output is correct
150 Correct 326 ms 143224 KB Output is correct
151 Correct 300 ms 142456 KB Output is correct
152 Correct 275 ms 142496 KB Output is correct
153 Correct 368 ms 146940 KB Output is correct
154 Correct 329 ms 143224 KB Output is correct
155 Correct 304 ms 142456 KB Output is correct
156 Correct 291 ms 142584 KB Output is correct
157 Correct 394 ms 149752 KB Output is correct
158 Correct 376 ms 148344 KB Output is correct
159 Correct 365 ms 148088 KB Output is correct
160 Correct 376 ms 147832 KB Output is correct
161 Correct 397 ms 151672 KB Output is correct
162 Correct 395 ms 151672 KB Output is correct
163 Correct 391 ms 151672 KB Output is correct
164 Correct 402 ms 151672 KB Output is correct
165 Correct 278 ms 142328 KB Output is correct
166 Correct 277 ms 142584 KB Output is correct
167 Correct 272 ms 142328 KB Output is correct
168 Correct 279 ms 142332 KB Output is correct
169 Correct 293 ms 142512 KB Output is correct
170 Correct 290 ms 142404 KB Output is correct
171 Correct 281 ms 142456 KB Output is correct
172 Correct 274 ms 142328 KB Output is correct
173 Correct 379 ms 146912 KB Output is correct
174 Correct 325 ms 143224 KB Output is correct
175 Correct 302 ms 142584 KB Output is correct
176 Correct 274 ms 142328 KB Output is correct
177 Correct 356 ms 147064 KB Output is correct
178 Correct 329 ms 143224 KB Output is correct
179 Correct 303 ms 142460 KB Output is correct
180 Correct 273 ms 142328 KB Output is correct
181 Correct 283 ms 147060 KB Output is correct
182 Correct 308 ms 147064 KB Output is correct
183 Correct 268 ms 147064 KB Output is correct
184 Correct 300 ms 147064 KB Output is correct
185 Correct 286 ms 147064 KB Output is correct
186 Correct 313 ms 147104 KB Output is correct
187 Correct 270 ms 147064 KB Output is correct
188 Correct 295 ms 147192 KB Output is correct
189 Correct 281 ms 147064 KB Output is correct
190 Correct 309 ms 147064 KB Output is correct
191 Correct 286 ms 151536 KB Output is correct
192 Correct 294 ms 151544 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 883 ms 182520 KB Output is correct
2 Correct 902 ms 182392 KB Output is correct
3 Correct 1641 ms 223636 KB Output is correct
4 Correct 1700 ms 223528 KB Output is correct
5 Correct 2125 ms 243932 KB Output is correct
6 Correct 2221 ms 243956 KB Output is correct
7 Correct 2288 ms 152000 KB Output is correct
8 Correct 1984 ms 149220 KB Output is correct
9 Correct 1871 ms 148880 KB Output is correct
10 Correct 2319 ms 155356 KB Output is correct
11 Correct 1910 ms 149300 KB Output is correct
12 Correct 1859 ms 148936 KB Output is correct
13 Correct 2377 ms 156916 KB Output is correct
14 Correct 1925 ms 149256 KB Output is correct
15 Correct 1887 ms 149112 KB Output is correct
16 Correct 1823 ms 150048 KB Output is correct
17 Correct 1825 ms 150008 KB Output is correct
18 Correct 1817 ms 150052 KB Output is correct
19 Correct 1848 ms 149860 KB Output is correct
20 Correct 1813 ms 150196 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 141304 KB Output is correct
2 Correct 88 ms 141176 KB Output is correct
3 Correct 87 ms 141176 KB Output is correct
4 Correct 88 ms 141176 KB Output is correct
5 Correct 88 ms 141304 KB Output is correct
6 Correct 88 ms 141304 KB Output is correct
7 Correct 90 ms 141192 KB Output is correct
8 Correct 89 ms 141204 KB Output is correct
9 Correct 88 ms 141360 KB Output is correct
10 Correct 90 ms 141304 KB Output is correct
11 Correct 91 ms 141304 KB Output is correct
12 Correct 90 ms 141304 KB Output is correct
13 Correct 90 ms 141304 KB Output is correct
14 Correct 91 ms 141304 KB Output is correct
15 Correct 94 ms 141432 KB Output is correct
16 Correct 88 ms 141304 KB Output is correct
17 Correct 87 ms 141304 KB Output is correct
18 Correct 87 ms 141176 KB Output is correct
19 Correct 88 ms 141176 KB Output is correct
20 Correct 90 ms 141308 KB Output is correct
21 Correct 90 ms 141304 KB Output is correct
22 Correct 90 ms 141304 KB Output is correct
23 Correct 91 ms 141176 KB Output is correct
24 Correct 92 ms 141304 KB Output is correct
25 Correct 91 ms 141304 KB Output is correct
26 Correct 90 ms 141304 KB Output is correct
27 Correct 89 ms 141304 KB Output is correct
28 Correct 88 ms 141304 KB Output is correct
29 Correct 90 ms 141304 KB Output is correct
30 Correct 89 ms 141304 KB Output is correct
31 Correct 88 ms 141304 KB Output is correct
32 Correct 88 ms 141304 KB Output is correct
33 Correct 88 ms 141176 KB Output is correct
34 Correct 87 ms 141180 KB Output is correct
35 Correct 88 ms 141176 KB Output is correct
36 Correct 87 ms 141176 KB Output is correct
37 Correct 89 ms 141176 KB Output is correct
38 Correct 88 ms 141176 KB Output is correct
39 Correct 88 ms 141176 KB Output is correct
40 Correct 88 ms 141236 KB Output is correct
41 Correct 88 ms 141304 KB Output is correct
42 Correct 89 ms 141176 KB Output is correct
43 Correct 90 ms 141176 KB Output is correct
44 Correct 90 ms 141432 KB Output is correct
45 Correct 87 ms 141292 KB Output is correct
46 Correct 87 ms 141304 KB Output is correct
47 Correct 89 ms 141176 KB Output is correct
48 Correct 88 ms 141176 KB Output is correct
49 Correct 88 ms 141304 KB Output is correct
50 Correct 88 ms 141304 KB Output is correct
51 Correct 88 ms 141304 KB Output is correct
52 Correct 88 ms 141432 KB Output is correct
53 Correct 87 ms 141304 KB Output is correct
54 Correct 88 ms 141304 KB Output is correct
55 Correct 89 ms 141256 KB Output is correct
56 Correct 89 ms 141336 KB Output is correct
57 Correct 88 ms 141308 KB Output is correct
58 Correct 89 ms 141304 KB Output is correct
59 Correct 90 ms 141304 KB Output is correct
60 Correct 89 ms 141304 KB Output is correct
61 Correct 86 ms 141304 KB Output is correct
62 Correct 86 ms 141240 KB Output is correct
63 Correct 89 ms 141308 KB Output is correct
64 Correct 151 ms 142584 KB Output is correct
65 Correct 142 ms 141688 KB Output is correct
66 Correct 138 ms 141560 KB Output is correct
67 Correct 133 ms 141688 KB Output is correct
68 Correct 147 ms 142584 KB Output is correct
69 Correct 141 ms 141688 KB Output is correct
70 Correct 135 ms 141560 KB Output is correct
71 Correct 141 ms 141560 KB Output is correct
72 Correct 153 ms 143296 KB Output is correct
73 Correct 148 ms 142968 KB Output is correct
74 Correct 148 ms 142968 KB Output is correct
75 Correct 144 ms 142840 KB Output is correct
76 Correct 152 ms 143784 KB Output is correct
77 Correct 149 ms 143736 KB Output is correct
78 Correct 155 ms 143832 KB Output is correct
79 Correct 152 ms 143736 KB Output is correct
80 Correct 164 ms 142596 KB Output is correct
81 Correct 142 ms 141888 KB Output is correct
82 Correct 134 ms 141568 KB Output is correct
83 Correct 131 ms 141560 KB Output is correct
84 Correct 150 ms 142840 KB Output is correct
85 Correct 141 ms 141736 KB Output is correct
86 Correct 142 ms 141688 KB Output is correct
87 Correct 133 ms 141560 KB Output is correct
88 Correct 153 ms 143352 KB Output is correct
89 Correct 149 ms 142968 KB Output is correct
90 Correct 149 ms 142968 KB Output is correct
91 Correct 149 ms 142840 KB Output is correct
92 Correct 157 ms 143736 KB Output is correct
93 Correct 148 ms 143736 KB Output is correct
94 Correct 149 ms 143736 KB Output is correct
95 Correct 153 ms 143864 KB Output is correct
96 Correct 147 ms 141560 KB Output is correct
97 Correct 131 ms 141560 KB Output is correct
98 Correct 133 ms 141560 KB Output is correct
99 Correct 133 ms 141564 KB Output is correct
100 Correct 136 ms 141560 KB Output is correct
101 Correct 134 ms 141560 KB Output is correct
102 Correct 137 ms 141560 KB Output is correct
103 Correct 130 ms 141560 KB Output is correct
104 Correct 143 ms 142584 KB Output is correct
105 Correct 138 ms 141688 KB Output is correct
106 Correct 135 ms 141560 KB Output is correct
107 Correct 130 ms 141560 KB Output is correct
108 Correct 143 ms 142584 KB Output is correct
109 Correct 141 ms 141656 KB Output is correct
110 Correct 137 ms 141540 KB Output is correct
111 Correct 130 ms 141560 KB Output is correct
112 Correct 130 ms 142712 KB Output is correct
113 Correct 136 ms 142712 KB Output is correct
114 Correct 133 ms 142584 KB Output is correct
115 Correct 135 ms 142584 KB Output is correct
116 Correct 132 ms 142584 KB Output is correct
117 Correct 136 ms 142712 KB Output is correct
118 Correct 132 ms 142560 KB Output is correct
119 Correct 134 ms 142712 KB Output is correct
120 Correct 133 ms 142712 KB Output is correct
121 Correct 138 ms 142712 KB Output is correct
122 Correct 135 ms 143736 KB Output is correct
123 Correct 138 ms 143736 KB Output is correct
124 Correct 134 ms 141688 KB Output is correct
125 Correct 125 ms 141560 KB Output is correct
126 Correct 124 ms 141560 KB Output is correct
127 Correct 131 ms 142024 KB Output is correct
128 Correct 128 ms 141560 KB Output is correct
129 Correct 126 ms 141560 KB Output is correct
130 Correct 141 ms 142072 KB Output is correct
131 Correct 126 ms 141560 KB Output is correct
132 Correct 125 ms 141560 KB Output is correct
133 Correct 370 ms 147096 KB Output is correct
134 Correct 329 ms 143160 KB Output is correct
135 Correct 303 ms 142456 KB Output is correct
136 Correct 277 ms 142460 KB Output is correct
137 Correct 373 ms 146996 KB Output is correct
138 Correct 325 ms 143352 KB Output is correct
139 Correct 303 ms 142496 KB Output is correct
140 Correct 291 ms 142456 KB Output is correct
141 Correct 385 ms 149752 KB Output is correct
142 Correct 373 ms 148344 KB Output is correct
143 Correct 365 ms 147960 KB Output is correct
144 Correct 370 ms 147960 KB Output is correct
145 Correct 388 ms 151672 KB Output is correct
146 Correct 397 ms 151660 KB Output is correct
147 Correct 389 ms 151672 KB Output is correct
148 Correct 394 ms 151672 KB Output is correct
149 Correct 373 ms 146936 KB Output is correct
150 Correct 326 ms 143224 KB Output is correct
151 Correct 300 ms 142456 KB Output is correct
152 Correct 275 ms 142496 KB Output is correct
153 Correct 368 ms 146940 KB Output is correct
154 Correct 329 ms 143224 KB Output is correct
155 Correct 304 ms 142456 KB Output is correct
156 Correct 291 ms 142584 KB Output is correct
157 Correct 394 ms 149752 KB Output is correct
158 Correct 376 ms 148344 KB Output is correct
159 Correct 365 ms 148088 KB Output is correct
160 Correct 376 ms 147832 KB Output is correct
161 Correct 397 ms 151672 KB Output is correct
162 Correct 395 ms 151672 KB Output is correct
163 Correct 391 ms 151672 KB Output is correct
164 Correct 402 ms 151672 KB Output is correct
165 Correct 278 ms 142328 KB Output is correct
166 Correct 277 ms 142584 KB Output is correct
167 Correct 272 ms 142328 KB Output is correct
168 Correct 279 ms 142332 KB Output is correct
169 Correct 293 ms 142512 KB Output is correct
170 Correct 290 ms 142404 KB Output is correct
171 Correct 281 ms 142456 KB Output is correct
172 Correct 274 ms 142328 KB Output is correct
173 Correct 379 ms 146912 KB Output is correct
174 Correct 325 ms 143224 KB Output is correct
175 Correct 302 ms 142584 KB Output is correct
176 Correct 274 ms 142328 KB Output is correct
177 Correct 356 ms 147064 KB Output is correct
178 Correct 329 ms 143224 KB Output is correct
179 Correct 303 ms 142460 KB Output is correct
180 Correct 273 ms 142328 KB Output is correct
181 Correct 283 ms 147060 KB Output is correct
182 Correct 308 ms 147064 KB Output is correct
183 Correct 268 ms 147064 KB Output is correct
184 Correct 300 ms 147064 KB Output is correct
185 Correct 286 ms 147064 KB Output is correct
186 Correct 313 ms 147104 KB Output is correct
187 Correct 270 ms 147064 KB Output is correct
188 Correct 295 ms 147192 KB Output is correct
189 Correct 281 ms 147064 KB Output is correct
190 Correct 309 ms 147064 KB Output is correct
191 Correct 286 ms 151536 KB Output is correct
192 Correct 294 ms 151544 KB Output is correct
193 Correct 883 ms 182520 KB Output is correct
194 Correct 902 ms 182392 KB Output is correct
195 Correct 1641 ms 223636 KB Output is correct
196 Correct 1700 ms 223528 KB Output is correct
197 Correct 2125 ms 243932 KB Output is correct
198 Correct 2221 ms 243956 KB Output is correct
199 Correct 2288 ms 152000 KB Output is correct
200 Correct 1984 ms 149220 KB Output is correct
201 Correct 1871 ms 148880 KB Output is correct
202 Correct 2319 ms 155356 KB Output is correct
203 Correct 1910 ms 149300 KB Output is correct
204 Correct 1859 ms 148936 KB Output is correct
205 Correct 2377 ms 156916 KB Output is correct
206 Correct 1925 ms 149256 KB Output is correct
207 Correct 1887 ms 149112 KB Output is correct
208 Correct 1823 ms 150048 KB Output is correct
209 Correct 1825 ms 150008 KB Output is correct
210 Correct 1817 ms 150052 KB Output is correct
211 Correct 1848 ms 149860 KB Output is correct
212 Correct 1813 ms 150196 KB Output is correct
213 Correct 3692 ms 198300 KB Output is correct
214 Correct 3243 ms 160620 KB Output is correct
215 Correct 2581 ms 152828 KB Output is correct
216 Correct 2092 ms 152376 KB Output is correct
217 Correct 3714 ms 198088 KB Output is correct
218 Correct 3200 ms 160836 KB Output is correct
219 Correct 2565 ms 152812 KB Output is correct
220 Correct 2182 ms 152052 KB Output is correct
221 Correct 3785 ms 226280 KB Output is correct
222 Correct 3735 ms 211312 KB Output is correct
223 Correct 3722 ms 207864 KB Output is correct
224 Correct 3720 ms 207436 KB Output is correct
225 Correct 3920 ms 245020 KB Output is correct
226 Correct 3963 ms 245000 KB Output is correct
227 Correct 3909 ms 245100 KB Output is correct
228 Correct 3877 ms 245032 KB Output is correct
229 Correct 3750 ms 197920 KB Output is correct
230 Correct 3255 ms 160328 KB Output is correct
231 Correct 2533 ms 152620 KB Output is correct
232 Correct 2088 ms 152324 KB Output is correct
233 Correct 3732 ms 197956 KB Output is correct
234 Correct 3321 ms 160504 KB Output is correct
235 Correct 2572 ms 152932 KB Output is correct
236 Correct 2217 ms 151904 KB Output is correct
237 Correct 3884 ms 226128 KB Output is correct
238 Correct 3810 ms 211012 KB Output is correct
239 Correct 3731 ms 207992 KB Output is correct
240 Correct 3742 ms 207316 KB Output is correct
241 Correct 3899 ms 244848 KB Output is correct
242 Correct 3894 ms 244904 KB Output is correct
243 Correct 3899 ms 244836 KB Output is correct
244 Correct 3956 ms 244508 KB Output is correct
245 Correct 1961 ms 152428 KB Output is correct
246 Correct 1972 ms 152428 KB Output is correct
247 Correct 1978 ms 152484 KB Output is correct
248 Correct 1967 ms 152716 KB Output is correct
249 Correct 2163 ms 152312 KB Output is correct
250 Correct 2184 ms 152312 KB Output is correct
251 Correct 2187 ms 152312 KB Output is correct
252 Correct 2027 ms 152564 KB Output is correct
253 Correct 3611 ms 197828 KB Output is correct
254 Correct 3049 ms 160704 KB Output is correct
255 Correct 2467 ms 153060 KB Output is correct
256 Correct 2048 ms 152396 KB Output is correct
257 Correct 3481 ms 198268 KB Output is correct
258 Correct 3053 ms 160760 KB Output is correct
259 Correct 2490 ms 153208 KB Output is correct
260 Correct 2051 ms 152356 KB Output is correct
261 Correct 2381 ms 199700 KB Output is correct
262 Correct 2879 ms 199584 KB Output is correct
263 Correct 1900 ms 198444 KB Output is correct
264 Correct 2444 ms 198412 KB Output is correct
265 Correct 2373 ms 199544 KB Output is correct
266 Correct 2885 ms 199612 KB Output is correct
267 Correct 1891 ms 198616 KB Output is correct
268 Correct 2414 ms 198416 KB Output is correct
269 Correct 2083 ms 244088 KB Output is correct
270 Correct 2121 ms 244008 KB Output is correct
271 Correct 2224 ms 152824 KB Output is correct
272 Correct 1893 ms 149368 KB Output is correct
273 Correct 2345 ms 156368 KB Output is correct
274 Correct 1894 ms 149368 KB Output is correct
275 Correct 1917 ms 197752 KB Output is correct