Submission #311812

# Submission time Handle Problem Language Result Execution time Memory
311812 2020-10-11T19:46:12 Z lukameladze Interval Collection (CCO20_day2problem2) C++14
25 / 25
4892 ms 286456 KB
# include <bits/stdc++.h>
using namespace std;
# define mnri first.second
#define mxle  first.first
pair <pair <long long, long long> , long long>  tree[4000005];
long long  x,l,r,le1,ri1,ans,q,mnr,mxl,mx=1000005;
char ch;
multiset<long long>::iterator it;
multiset< long long> le,ri,ms1[1000005],ms2[1000005];
void update(long long node, long long le, long long ri, long long idx, long long val, int ty)
{
    
    if (le>idx || ri<idx) return;
    if (le==ri)
    {
        if (ty==0)
        {
            tree[node].mnri=val;
        }
        else tree[node].mxle=val;
        tree[node].second=tree[node].mnri-tree[node].mxle;
        //cout<<node<<" "<<idx<<" "<<le<<" "<<ri<<" ";
       // cout<<tree[node].second<<" "<<tree[node].mnri<<" "<<tree[node].mxle<<endl;
        return;
    }
    long long mid=(le+ri)/2;
    update(2*node,le,mid,idx,val, ty);
    update(2*node+1, mid+1, ri, idx, val, ty);
    tree[node].mnri=min(tree[2*node].mnri, tree[2*node+1].mnri);
    tree[node].mxle=max(tree[2*node].mxle, tree[2*node+1].mxle);
    x=min(tree[2*node].second, tree[2*node+1].second);
    tree[node].second=min(x,tree[2*node+1].mnri-tree[2*node].mxle);
}
int main()
{
    cin>>q;
    for (long long i=1; i<=4*1000005; i++)
    {
        tree[i].mnri=1e9;
        tree[i].mxle=-1e9;
        tree[i].second=2e9;
    }
    while (q--)
    {
        cin>>ch>>l>>r;
        if (ch=='R')
        {
            le.erase(le.find(l));
            ri.erase(ri.find(r));
            ms1[l].erase(ms1[l].find(r));
            ms2[r].erase(ms2[r].find(l));
            if (!ms1[l].size()) ms1[l].insert(1e9);
            if (!ms2[r].size()) ms2[r].insert(-1e9);
            mnr=*ms1[l].begin();
            update(1,1,mx,l,mnr,0);
            
                it=ms2[r].end();
                it--;
            mxl=*it;
            //cout<<r<<" "<<mxl<<endl;
            update(1,1,mx,r,mxl,1);
        }
        else
        {
            ms1[l].insert(r);
            ms2[r].insert(l);
            //cout<<l<<endl<<endl;
            le.insert(l);
            ri.insert(r);
            mnr=*ms1[l].begin();
            it=ms2[r].end();
            it--;
            mxl=*it;
           // cout<<l<<" "<<mnr<<" "<<r<<" "<<mxl<<endl;
            update(1,1,mx,l,mnr,0);
           // cout<<endl<<endl;
            update(1,1,mx,r,mxl,1);
        }
        //if (l==6)
        //{
         //   for (multiset<long long>::iterator it=le.begin(); it!=le.end(); it++)
           // cout<<*it<<" ";
            //cout<<endl<<endl;
       // }
       // cout<<*(--le.end())<<" max"<<endl;
       it=le.end();
       it--;
        mxl=*it;
        mnr=*(ri.begin());
       // cout<<mnr<<" "<<mxl<<endl;
        if (mnr<=mxl)
        {
           //cout<<"s"<<endl;
            cout<<tree[1].second<<endl;//<<"  "<<tree[1].mnri<<" "<<tree[1].mxle<<endl;
        }
        else
        {
            ri1=*(ms1[mxl].begin());
            it=ms2[mnr].end();
            it--;
            le1=*it;
            cout<<ri1-le1<<endl;
        }
    }
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:39:21: warning: iteration 4000004 invokes undefined behavior [-Waggressive-loop-optimizations]
   39 |         tree[i].mnri=1e9;
      |         ~~~~~~~~~~~~^~~~
Main.cpp:37:26: note: within this loop
   37 |     for (long long i=1; i<=4*1000005; i++)
      |                         ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 114 ms 188280 KB Output is correct
2 Correct 114 ms 188152 KB Output is correct
3 Correct 114 ms 188152 KB Output is correct
4 Correct 113 ms 188152 KB Output is correct
5 Correct 114 ms 188280 KB Output is correct
6 Correct 114 ms 188152 KB Output is correct
7 Correct 114 ms 188152 KB Output is correct
8 Correct 113 ms 188152 KB Output is correct
9 Correct 114 ms 188284 KB Output is correct
10 Correct 115 ms 188280 KB Output is correct
11 Correct 114 ms 188280 KB Output is correct
12 Correct 115 ms 188280 KB Output is correct
13 Correct 115 ms 188412 KB Output is correct
14 Correct 117 ms 188280 KB Output is correct
15 Correct 113 ms 188280 KB Output is correct
16 Correct 117 ms 188280 KB Output is correct
17 Correct 118 ms 188268 KB Output is correct
18 Correct 119 ms 188280 KB Output is correct
19 Correct 114 ms 188152 KB Output is correct
20 Correct 115 ms 188368 KB Output is correct
21 Correct 115 ms 188280 KB Output is correct
22 Correct 114 ms 188152 KB Output is correct
23 Correct 115 ms 188280 KB Output is correct
24 Correct 115 ms 188180 KB Output is correct
25 Correct 115 ms 188280 KB Output is correct
26 Correct 114 ms 188280 KB Output is correct
27 Correct 115 ms 188280 KB Output is correct
28 Correct 114 ms 188280 KB Output is correct
29 Correct 113 ms 188280 KB Output is correct
30 Correct 116 ms 188204 KB Output is correct
31 Correct 114 ms 188280 KB Output is correct
32 Correct 119 ms 188280 KB Output is correct
33 Correct 113 ms 188152 KB Output is correct
34 Correct 115 ms 188152 KB Output is correct
35 Correct 114 ms 188184 KB Output is correct
36 Correct 114 ms 188152 KB Output is correct
37 Correct 116 ms 188152 KB Output is correct
38 Correct 114 ms 188156 KB Output is correct
39 Correct 114 ms 188280 KB Output is correct
40 Correct 116 ms 188152 KB Output is correct
41 Correct 116 ms 188280 KB Output is correct
42 Correct 116 ms 188152 KB Output is correct
43 Correct 115 ms 188152 KB Output is correct
44 Correct 121 ms 188152 KB Output is correct
45 Correct 116 ms 188280 KB Output is correct
46 Correct 114 ms 188152 KB Output is correct
47 Correct 114 ms 188152 KB Output is correct
48 Correct 115 ms 188152 KB Output is correct
49 Correct 115 ms 188284 KB Output is correct
50 Correct 113 ms 188280 KB Output is correct
51 Correct 112 ms 188280 KB Output is correct
52 Correct 115 ms 188280 KB Output is correct
53 Correct 113 ms 188280 KB Output is correct
54 Correct 114 ms 188300 KB Output is correct
55 Correct 116 ms 188280 KB Output is correct
56 Correct 114 ms 188280 KB Output is correct
57 Correct 114 ms 188280 KB Output is correct
58 Correct 115 ms 188280 KB Output is correct
59 Correct 113 ms 188280 KB Output is correct
60 Correct 115 ms 188280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 114 ms 188280 KB Output is correct
2 Correct 114 ms 188152 KB Output is correct
3 Correct 114 ms 188152 KB Output is correct
4 Correct 113 ms 188152 KB Output is correct
5 Correct 114 ms 188280 KB Output is correct
6 Correct 114 ms 188152 KB Output is correct
7 Correct 114 ms 188152 KB Output is correct
8 Correct 113 ms 188152 KB Output is correct
9 Correct 114 ms 188284 KB Output is correct
10 Correct 115 ms 188280 KB Output is correct
11 Correct 114 ms 188280 KB Output is correct
12 Correct 115 ms 188280 KB Output is correct
13 Correct 115 ms 188412 KB Output is correct
14 Correct 117 ms 188280 KB Output is correct
15 Correct 113 ms 188280 KB Output is correct
16 Correct 117 ms 188280 KB Output is correct
17 Correct 118 ms 188268 KB Output is correct
18 Correct 119 ms 188280 KB Output is correct
19 Correct 114 ms 188152 KB Output is correct
20 Correct 115 ms 188368 KB Output is correct
21 Correct 115 ms 188280 KB Output is correct
22 Correct 114 ms 188152 KB Output is correct
23 Correct 115 ms 188280 KB Output is correct
24 Correct 115 ms 188180 KB Output is correct
25 Correct 115 ms 188280 KB Output is correct
26 Correct 114 ms 188280 KB Output is correct
27 Correct 115 ms 188280 KB Output is correct
28 Correct 114 ms 188280 KB Output is correct
29 Correct 113 ms 188280 KB Output is correct
30 Correct 116 ms 188204 KB Output is correct
31 Correct 114 ms 188280 KB Output is correct
32 Correct 119 ms 188280 KB Output is correct
33 Correct 113 ms 188152 KB Output is correct
34 Correct 115 ms 188152 KB Output is correct
35 Correct 114 ms 188184 KB Output is correct
36 Correct 114 ms 188152 KB Output is correct
37 Correct 116 ms 188152 KB Output is correct
38 Correct 114 ms 188156 KB Output is correct
39 Correct 114 ms 188280 KB Output is correct
40 Correct 116 ms 188152 KB Output is correct
41 Correct 116 ms 188280 KB Output is correct
42 Correct 116 ms 188152 KB Output is correct
43 Correct 115 ms 188152 KB Output is correct
44 Correct 121 ms 188152 KB Output is correct
45 Correct 116 ms 188280 KB Output is correct
46 Correct 114 ms 188152 KB Output is correct
47 Correct 114 ms 188152 KB Output is correct
48 Correct 115 ms 188152 KB Output is correct
49 Correct 115 ms 188284 KB Output is correct
50 Correct 113 ms 188280 KB Output is correct
51 Correct 112 ms 188280 KB Output is correct
52 Correct 115 ms 188280 KB Output is correct
53 Correct 113 ms 188280 KB Output is correct
54 Correct 114 ms 188300 KB Output is correct
55 Correct 116 ms 188280 KB Output is correct
56 Correct 114 ms 188280 KB Output is correct
57 Correct 114 ms 188280 KB Output is correct
58 Correct 115 ms 188280 KB Output is correct
59 Correct 113 ms 188280 KB Output is correct
60 Correct 115 ms 188280 KB Output is correct
61 Correct 112 ms 188152 KB Output is correct
62 Correct 111 ms 188152 KB Output is correct
63 Correct 112 ms 188152 KB Output is correct
64 Correct 193 ms 189816 KB Output is correct
65 Correct 188 ms 189176 KB Output is correct
66 Correct 184 ms 189048 KB Output is correct
67 Correct 177 ms 189052 KB Output is correct
68 Correct 194 ms 189816 KB Output is correct
69 Correct 186 ms 189176 KB Output is correct
70 Correct 197 ms 189176 KB Output is correct
71 Correct 182 ms 188976 KB Output is correct
72 Correct 207 ms 190380 KB Output is correct
73 Correct 204 ms 190200 KB Output is correct
74 Correct 203 ms 190060 KB Output is correct
75 Correct 205 ms 189944 KB Output is correct
76 Correct 203 ms 190704 KB Output is correct
77 Correct 206 ms 190712 KB Output is correct
78 Correct 202 ms 190732 KB Output is correct
79 Correct 204 ms 190712 KB Output is correct
80 Correct 197 ms 189820 KB Output is correct
81 Correct 189 ms 189176 KB Output is correct
82 Correct 203 ms 189048 KB Output is correct
83 Correct 205 ms 189092 KB Output is correct
84 Correct 192 ms 189816 KB Output is correct
85 Correct 189 ms 189176 KB Output is correct
86 Correct 183 ms 189048 KB Output is correct
87 Correct 182 ms 189048 KB Output is correct
88 Correct 196 ms 190328 KB Output is correct
89 Correct 195 ms 190072 KB Output is correct
90 Correct 194 ms 189944 KB Output is correct
91 Correct 192 ms 189944 KB Output is correct
92 Correct 196 ms 190712 KB Output is correct
93 Correct 198 ms 190696 KB Output is correct
94 Correct 199 ms 190776 KB Output is correct
95 Correct 199 ms 190816 KB Output is correct
96 Correct 180 ms 189048 KB Output is correct
97 Correct 179 ms 189048 KB Output is correct
98 Correct 180 ms 189048 KB Output is correct
99 Correct 177 ms 189048 KB Output is correct
100 Correct 182 ms 189048 KB Output is correct
101 Correct 181 ms 189048 KB Output is correct
102 Correct 183 ms 189048 KB Output is correct
103 Correct 181 ms 189048 KB Output is correct
104 Correct 192 ms 189688 KB Output is correct
105 Correct 186 ms 189176 KB Output is correct
106 Correct 182 ms 189052 KB Output is correct
107 Correct 177 ms 189176 KB Output is correct
108 Correct 189 ms 189560 KB Output is correct
109 Correct 187 ms 189048 KB Output is correct
110 Correct 182 ms 189176 KB Output is correct
111 Correct 176 ms 189048 KB Output is correct
112 Correct 179 ms 189816 KB Output is correct
113 Correct 180 ms 189816 KB Output is correct
114 Correct 174 ms 189688 KB Output is correct
115 Correct 179 ms 189688 KB Output is correct
116 Correct 178 ms 189844 KB Output is correct
117 Correct 180 ms 189784 KB Output is correct
118 Correct 177 ms 189820 KB Output is correct
119 Correct 179 ms 189688 KB Output is correct
120 Correct 177 ms 189816 KB Output is correct
121 Correct 181 ms 189816 KB Output is correct
122 Correct 181 ms 190712 KB Output is correct
123 Correct 182 ms 190584 KB Output is correct
124 Correct 174 ms 189048 KB Output is correct
125 Correct 170 ms 188664 KB Output is correct
126 Correct 169 ms 188536 KB Output is correct
127 Correct 175 ms 189176 KB Output is correct
128 Correct 169 ms 188664 KB Output is correct
129 Correct 168 ms 188536 KB Output is correct
130 Correct 173 ms 189304 KB Output is correct
131 Correct 167 ms 188664 KB Output is correct
132 Correct 168 ms 188536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 114 ms 188280 KB Output is correct
2 Correct 114 ms 188152 KB Output is correct
3 Correct 114 ms 188152 KB Output is correct
4 Correct 113 ms 188152 KB Output is correct
5 Correct 114 ms 188280 KB Output is correct
6 Correct 114 ms 188152 KB Output is correct
7 Correct 114 ms 188152 KB Output is correct
8 Correct 113 ms 188152 KB Output is correct
9 Correct 114 ms 188284 KB Output is correct
10 Correct 115 ms 188280 KB Output is correct
11 Correct 114 ms 188280 KB Output is correct
12 Correct 115 ms 188280 KB Output is correct
13 Correct 115 ms 188412 KB Output is correct
14 Correct 117 ms 188280 KB Output is correct
15 Correct 113 ms 188280 KB Output is correct
16 Correct 117 ms 188280 KB Output is correct
17 Correct 118 ms 188268 KB Output is correct
18 Correct 119 ms 188280 KB Output is correct
19 Correct 114 ms 188152 KB Output is correct
20 Correct 115 ms 188368 KB Output is correct
21 Correct 115 ms 188280 KB Output is correct
22 Correct 114 ms 188152 KB Output is correct
23 Correct 115 ms 188280 KB Output is correct
24 Correct 115 ms 188180 KB Output is correct
25 Correct 115 ms 188280 KB Output is correct
26 Correct 114 ms 188280 KB Output is correct
27 Correct 115 ms 188280 KB Output is correct
28 Correct 114 ms 188280 KB Output is correct
29 Correct 113 ms 188280 KB Output is correct
30 Correct 116 ms 188204 KB Output is correct
31 Correct 114 ms 188280 KB Output is correct
32 Correct 119 ms 188280 KB Output is correct
33 Correct 113 ms 188152 KB Output is correct
34 Correct 115 ms 188152 KB Output is correct
35 Correct 114 ms 188184 KB Output is correct
36 Correct 114 ms 188152 KB Output is correct
37 Correct 116 ms 188152 KB Output is correct
38 Correct 114 ms 188156 KB Output is correct
39 Correct 114 ms 188280 KB Output is correct
40 Correct 116 ms 188152 KB Output is correct
41 Correct 116 ms 188280 KB Output is correct
42 Correct 116 ms 188152 KB Output is correct
43 Correct 115 ms 188152 KB Output is correct
44 Correct 121 ms 188152 KB Output is correct
45 Correct 116 ms 188280 KB Output is correct
46 Correct 114 ms 188152 KB Output is correct
47 Correct 114 ms 188152 KB Output is correct
48 Correct 115 ms 188152 KB Output is correct
49 Correct 115 ms 188284 KB Output is correct
50 Correct 113 ms 188280 KB Output is correct
51 Correct 112 ms 188280 KB Output is correct
52 Correct 115 ms 188280 KB Output is correct
53 Correct 113 ms 188280 KB Output is correct
54 Correct 114 ms 188300 KB Output is correct
55 Correct 116 ms 188280 KB Output is correct
56 Correct 114 ms 188280 KB Output is correct
57 Correct 114 ms 188280 KB Output is correct
58 Correct 115 ms 188280 KB Output is correct
59 Correct 113 ms 188280 KB Output is correct
60 Correct 115 ms 188280 KB Output is correct
61 Correct 112 ms 188152 KB Output is correct
62 Correct 111 ms 188152 KB Output is correct
63 Correct 112 ms 188152 KB Output is correct
64 Correct 193 ms 189816 KB Output is correct
65 Correct 188 ms 189176 KB Output is correct
66 Correct 184 ms 189048 KB Output is correct
67 Correct 177 ms 189052 KB Output is correct
68 Correct 194 ms 189816 KB Output is correct
69 Correct 186 ms 189176 KB Output is correct
70 Correct 197 ms 189176 KB Output is correct
71 Correct 182 ms 188976 KB Output is correct
72 Correct 207 ms 190380 KB Output is correct
73 Correct 204 ms 190200 KB Output is correct
74 Correct 203 ms 190060 KB Output is correct
75 Correct 205 ms 189944 KB Output is correct
76 Correct 203 ms 190704 KB Output is correct
77 Correct 206 ms 190712 KB Output is correct
78 Correct 202 ms 190732 KB Output is correct
79 Correct 204 ms 190712 KB Output is correct
80 Correct 197 ms 189820 KB Output is correct
81 Correct 189 ms 189176 KB Output is correct
82 Correct 203 ms 189048 KB Output is correct
83 Correct 205 ms 189092 KB Output is correct
84 Correct 192 ms 189816 KB Output is correct
85 Correct 189 ms 189176 KB Output is correct
86 Correct 183 ms 189048 KB Output is correct
87 Correct 182 ms 189048 KB Output is correct
88 Correct 196 ms 190328 KB Output is correct
89 Correct 195 ms 190072 KB Output is correct
90 Correct 194 ms 189944 KB Output is correct
91 Correct 192 ms 189944 KB Output is correct
92 Correct 196 ms 190712 KB Output is correct
93 Correct 198 ms 190696 KB Output is correct
94 Correct 199 ms 190776 KB Output is correct
95 Correct 199 ms 190816 KB Output is correct
96 Correct 180 ms 189048 KB Output is correct
97 Correct 179 ms 189048 KB Output is correct
98 Correct 180 ms 189048 KB Output is correct
99 Correct 177 ms 189048 KB Output is correct
100 Correct 182 ms 189048 KB Output is correct
101 Correct 181 ms 189048 KB Output is correct
102 Correct 183 ms 189048 KB Output is correct
103 Correct 181 ms 189048 KB Output is correct
104 Correct 192 ms 189688 KB Output is correct
105 Correct 186 ms 189176 KB Output is correct
106 Correct 182 ms 189052 KB Output is correct
107 Correct 177 ms 189176 KB Output is correct
108 Correct 189 ms 189560 KB Output is correct
109 Correct 187 ms 189048 KB Output is correct
110 Correct 182 ms 189176 KB Output is correct
111 Correct 176 ms 189048 KB Output is correct
112 Correct 179 ms 189816 KB Output is correct
113 Correct 180 ms 189816 KB Output is correct
114 Correct 174 ms 189688 KB Output is correct
115 Correct 179 ms 189688 KB Output is correct
116 Correct 178 ms 189844 KB Output is correct
117 Correct 180 ms 189784 KB Output is correct
118 Correct 177 ms 189820 KB Output is correct
119 Correct 179 ms 189688 KB Output is correct
120 Correct 177 ms 189816 KB Output is correct
121 Correct 181 ms 189816 KB Output is correct
122 Correct 181 ms 190712 KB Output is correct
123 Correct 182 ms 190584 KB Output is correct
124 Correct 174 ms 189048 KB Output is correct
125 Correct 170 ms 188664 KB Output is correct
126 Correct 169 ms 188536 KB Output is correct
127 Correct 175 ms 189176 KB Output is correct
128 Correct 169 ms 188664 KB Output is correct
129 Correct 168 ms 188536 KB Output is correct
130 Correct 173 ms 189304 KB Output is correct
131 Correct 167 ms 188664 KB Output is correct
132 Correct 168 ms 188536 KB Output is correct
133 Correct 489 ms 195352 KB Output is correct
134 Correct 440 ms 192220 KB Output is correct
135 Correct 421 ms 191608 KB Output is correct
136 Correct 386 ms 191608 KB Output is correct
137 Correct 486 ms 195140 KB Output is correct
138 Correct 453 ms 192376 KB Output is correct
139 Correct 426 ms 191864 KB Output is correct
140 Correct 403 ms 191556 KB Output is correct
141 Correct 495 ms 197240 KB Output is correct
142 Correct 506 ms 196216 KB Output is correct
143 Correct 489 ms 195960 KB Output is correct
144 Correct 484 ms 195960 KB Output is correct
145 Correct 515 ms 198648 KB Output is correct
146 Correct 509 ms 198776 KB Output is correct
147 Correct 511 ms 198672 KB Output is correct
148 Correct 510 ms 198648 KB Output is correct
149 Correct 477 ms 194936 KB Output is correct
150 Correct 448 ms 192376 KB Output is correct
151 Correct 421 ms 191608 KB Output is correct
152 Correct 388 ms 191480 KB Output is correct
153 Correct 506 ms 195064 KB Output is correct
154 Correct 450 ms 192248 KB Output is correct
155 Correct 425 ms 191608 KB Output is correct
156 Correct 405 ms 191480 KB Output is correct
157 Correct 494 ms 197112 KB Output is correct
158 Correct 490 ms 195960 KB Output is correct
159 Correct 475 ms 195704 KB Output is correct
160 Correct 481 ms 195704 KB Output is correct
161 Correct 498 ms 198520 KB Output is correct
162 Correct 507 ms 198560 KB Output is correct
163 Correct 497 ms 198648 KB Output is correct
164 Correct 510 ms 198648 KB Output is correct
165 Correct 390 ms 191608 KB Output is correct
166 Correct 384 ms 191608 KB Output is correct
167 Correct 388 ms 191608 KB Output is correct
168 Correct 387 ms 191736 KB Output is correct
169 Correct 406 ms 191616 KB Output is correct
170 Correct 398 ms 191608 KB Output is correct
171 Correct 396 ms 191608 KB Output is correct
172 Correct 387 ms 191736 KB Output is correct
173 Correct 477 ms 194680 KB Output is correct
174 Correct 433 ms 192120 KB Output is correct
175 Correct 417 ms 191736 KB Output is correct
176 Correct 386 ms 191608 KB Output is correct
177 Correct 475 ms 193912 KB Output is correct
178 Correct 440 ms 192248 KB Output is correct
179 Correct 416 ms 191736 KB Output is correct
180 Correct 388 ms 191608 KB Output is correct
181 Correct 399 ms 195064 KB Output is correct
182 Correct 433 ms 195064 KB Output is correct
183 Correct 380 ms 194552 KB Output is correct
184 Correct 405 ms 194680 KB Output is correct
185 Correct 395 ms 194944 KB Output is correct
186 Correct 417 ms 194936 KB Output is correct
187 Correct 379 ms 194680 KB Output is correct
188 Correct 404 ms 194556 KB Output is correct
189 Correct 392 ms 195064 KB Output is correct
190 Correct 420 ms 194936 KB Output is correct
191 Correct 396 ms 198508 KB Output is correct
192 Correct 389 ms 198392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1196 ms 227820 KB Output is correct
2 Correct 1213 ms 227704 KB Output is correct
3 Correct 2285 ms 266108 KB Output is correct
4 Correct 2299 ms 265720 KB Output is correct
5 Correct 2837 ms 284924 KB Output is correct
6 Correct 2867 ms 284780 KB Output is correct
7 Correct 3175 ms 200444 KB Output is correct
8 Correct 2627 ms 193232 KB Output is correct
9 Correct 2549 ms 192756 KB Output is correct
10 Correct 3379 ms 203808 KB Output is correct
11 Correct 2618 ms 193428 KB Output is correct
12 Correct 2531 ms 192660 KB Output is correct
13 Correct 3382 ms 205512 KB Output is correct
14 Correct 2609 ms 193656 KB Output is correct
15 Correct 2553 ms 192760 KB Output is correct
16 Correct 2541 ms 204416 KB Output is correct
17 Correct 2533 ms 204408 KB Output is correct
18 Correct 2539 ms 204536 KB Output is correct
19 Correct 2534 ms 204732 KB Output is correct
20 Correct 2551 ms 204668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 114 ms 188280 KB Output is correct
2 Correct 114 ms 188152 KB Output is correct
3 Correct 114 ms 188152 KB Output is correct
4 Correct 113 ms 188152 KB Output is correct
5 Correct 114 ms 188280 KB Output is correct
6 Correct 114 ms 188152 KB Output is correct
7 Correct 114 ms 188152 KB Output is correct
8 Correct 113 ms 188152 KB Output is correct
9 Correct 114 ms 188284 KB Output is correct
10 Correct 115 ms 188280 KB Output is correct
11 Correct 114 ms 188280 KB Output is correct
12 Correct 115 ms 188280 KB Output is correct
13 Correct 115 ms 188412 KB Output is correct
14 Correct 117 ms 188280 KB Output is correct
15 Correct 113 ms 188280 KB Output is correct
16 Correct 117 ms 188280 KB Output is correct
17 Correct 118 ms 188268 KB Output is correct
18 Correct 119 ms 188280 KB Output is correct
19 Correct 114 ms 188152 KB Output is correct
20 Correct 115 ms 188368 KB Output is correct
21 Correct 115 ms 188280 KB Output is correct
22 Correct 114 ms 188152 KB Output is correct
23 Correct 115 ms 188280 KB Output is correct
24 Correct 115 ms 188180 KB Output is correct
25 Correct 115 ms 188280 KB Output is correct
26 Correct 114 ms 188280 KB Output is correct
27 Correct 115 ms 188280 KB Output is correct
28 Correct 114 ms 188280 KB Output is correct
29 Correct 113 ms 188280 KB Output is correct
30 Correct 116 ms 188204 KB Output is correct
31 Correct 114 ms 188280 KB Output is correct
32 Correct 119 ms 188280 KB Output is correct
33 Correct 113 ms 188152 KB Output is correct
34 Correct 115 ms 188152 KB Output is correct
35 Correct 114 ms 188184 KB Output is correct
36 Correct 114 ms 188152 KB Output is correct
37 Correct 116 ms 188152 KB Output is correct
38 Correct 114 ms 188156 KB Output is correct
39 Correct 114 ms 188280 KB Output is correct
40 Correct 116 ms 188152 KB Output is correct
41 Correct 116 ms 188280 KB Output is correct
42 Correct 116 ms 188152 KB Output is correct
43 Correct 115 ms 188152 KB Output is correct
44 Correct 121 ms 188152 KB Output is correct
45 Correct 116 ms 188280 KB Output is correct
46 Correct 114 ms 188152 KB Output is correct
47 Correct 114 ms 188152 KB Output is correct
48 Correct 115 ms 188152 KB Output is correct
49 Correct 115 ms 188284 KB Output is correct
50 Correct 113 ms 188280 KB Output is correct
51 Correct 112 ms 188280 KB Output is correct
52 Correct 115 ms 188280 KB Output is correct
53 Correct 113 ms 188280 KB Output is correct
54 Correct 114 ms 188300 KB Output is correct
55 Correct 116 ms 188280 KB Output is correct
56 Correct 114 ms 188280 KB Output is correct
57 Correct 114 ms 188280 KB Output is correct
58 Correct 115 ms 188280 KB Output is correct
59 Correct 113 ms 188280 KB Output is correct
60 Correct 115 ms 188280 KB Output is correct
61 Correct 112 ms 188152 KB Output is correct
62 Correct 111 ms 188152 KB Output is correct
63 Correct 112 ms 188152 KB Output is correct
64 Correct 193 ms 189816 KB Output is correct
65 Correct 188 ms 189176 KB Output is correct
66 Correct 184 ms 189048 KB Output is correct
67 Correct 177 ms 189052 KB Output is correct
68 Correct 194 ms 189816 KB Output is correct
69 Correct 186 ms 189176 KB Output is correct
70 Correct 197 ms 189176 KB Output is correct
71 Correct 182 ms 188976 KB Output is correct
72 Correct 207 ms 190380 KB Output is correct
73 Correct 204 ms 190200 KB Output is correct
74 Correct 203 ms 190060 KB Output is correct
75 Correct 205 ms 189944 KB Output is correct
76 Correct 203 ms 190704 KB Output is correct
77 Correct 206 ms 190712 KB Output is correct
78 Correct 202 ms 190732 KB Output is correct
79 Correct 204 ms 190712 KB Output is correct
80 Correct 197 ms 189820 KB Output is correct
81 Correct 189 ms 189176 KB Output is correct
82 Correct 203 ms 189048 KB Output is correct
83 Correct 205 ms 189092 KB Output is correct
84 Correct 192 ms 189816 KB Output is correct
85 Correct 189 ms 189176 KB Output is correct
86 Correct 183 ms 189048 KB Output is correct
87 Correct 182 ms 189048 KB Output is correct
88 Correct 196 ms 190328 KB Output is correct
89 Correct 195 ms 190072 KB Output is correct
90 Correct 194 ms 189944 KB Output is correct
91 Correct 192 ms 189944 KB Output is correct
92 Correct 196 ms 190712 KB Output is correct
93 Correct 198 ms 190696 KB Output is correct
94 Correct 199 ms 190776 KB Output is correct
95 Correct 199 ms 190816 KB Output is correct
96 Correct 180 ms 189048 KB Output is correct
97 Correct 179 ms 189048 KB Output is correct
98 Correct 180 ms 189048 KB Output is correct
99 Correct 177 ms 189048 KB Output is correct
100 Correct 182 ms 189048 KB Output is correct
101 Correct 181 ms 189048 KB Output is correct
102 Correct 183 ms 189048 KB Output is correct
103 Correct 181 ms 189048 KB Output is correct
104 Correct 192 ms 189688 KB Output is correct
105 Correct 186 ms 189176 KB Output is correct
106 Correct 182 ms 189052 KB Output is correct
107 Correct 177 ms 189176 KB Output is correct
108 Correct 189 ms 189560 KB Output is correct
109 Correct 187 ms 189048 KB Output is correct
110 Correct 182 ms 189176 KB Output is correct
111 Correct 176 ms 189048 KB Output is correct
112 Correct 179 ms 189816 KB Output is correct
113 Correct 180 ms 189816 KB Output is correct
114 Correct 174 ms 189688 KB Output is correct
115 Correct 179 ms 189688 KB Output is correct
116 Correct 178 ms 189844 KB Output is correct
117 Correct 180 ms 189784 KB Output is correct
118 Correct 177 ms 189820 KB Output is correct
119 Correct 179 ms 189688 KB Output is correct
120 Correct 177 ms 189816 KB Output is correct
121 Correct 181 ms 189816 KB Output is correct
122 Correct 181 ms 190712 KB Output is correct
123 Correct 182 ms 190584 KB Output is correct
124 Correct 174 ms 189048 KB Output is correct
125 Correct 170 ms 188664 KB Output is correct
126 Correct 169 ms 188536 KB Output is correct
127 Correct 175 ms 189176 KB Output is correct
128 Correct 169 ms 188664 KB Output is correct
129 Correct 168 ms 188536 KB Output is correct
130 Correct 173 ms 189304 KB Output is correct
131 Correct 167 ms 188664 KB Output is correct
132 Correct 168 ms 188536 KB Output is correct
133 Correct 489 ms 195352 KB Output is correct
134 Correct 440 ms 192220 KB Output is correct
135 Correct 421 ms 191608 KB Output is correct
136 Correct 386 ms 191608 KB Output is correct
137 Correct 486 ms 195140 KB Output is correct
138 Correct 453 ms 192376 KB Output is correct
139 Correct 426 ms 191864 KB Output is correct
140 Correct 403 ms 191556 KB Output is correct
141 Correct 495 ms 197240 KB Output is correct
142 Correct 506 ms 196216 KB Output is correct
143 Correct 489 ms 195960 KB Output is correct
144 Correct 484 ms 195960 KB Output is correct
145 Correct 515 ms 198648 KB Output is correct
146 Correct 509 ms 198776 KB Output is correct
147 Correct 511 ms 198672 KB Output is correct
148 Correct 510 ms 198648 KB Output is correct
149 Correct 477 ms 194936 KB Output is correct
150 Correct 448 ms 192376 KB Output is correct
151 Correct 421 ms 191608 KB Output is correct
152 Correct 388 ms 191480 KB Output is correct
153 Correct 506 ms 195064 KB Output is correct
154 Correct 450 ms 192248 KB Output is correct
155 Correct 425 ms 191608 KB Output is correct
156 Correct 405 ms 191480 KB Output is correct
157 Correct 494 ms 197112 KB Output is correct
158 Correct 490 ms 195960 KB Output is correct
159 Correct 475 ms 195704 KB Output is correct
160 Correct 481 ms 195704 KB Output is correct
161 Correct 498 ms 198520 KB Output is correct
162 Correct 507 ms 198560 KB Output is correct
163 Correct 497 ms 198648 KB Output is correct
164 Correct 510 ms 198648 KB Output is correct
165 Correct 390 ms 191608 KB Output is correct
166 Correct 384 ms 191608 KB Output is correct
167 Correct 388 ms 191608 KB Output is correct
168 Correct 387 ms 191736 KB Output is correct
169 Correct 406 ms 191616 KB Output is correct
170 Correct 398 ms 191608 KB Output is correct
171 Correct 396 ms 191608 KB Output is correct
172 Correct 387 ms 191736 KB Output is correct
173 Correct 477 ms 194680 KB Output is correct
174 Correct 433 ms 192120 KB Output is correct
175 Correct 417 ms 191736 KB Output is correct
176 Correct 386 ms 191608 KB Output is correct
177 Correct 475 ms 193912 KB Output is correct
178 Correct 440 ms 192248 KB Output is correct
179 Correct 416 ms 191736 KB Output is correct
180 Correct 388 ms 191608 KB Output is correct
181 Correct 399 ms 195064 KB Output is correct
182 Correct 433 ms 195064 KB Output is correct
183 Correct 380 ms 194552 KB Output is correct
184 Correct 405 ms 194680 KB Output is correct
185 Correct 395 ms 194944 KB Output is correct
186 Correct 417 ms 194936 KB Output is correct
187 Correct 379 ms 194680 KB Output is correct
188 Correct 404 ms 194556 KB Output is correct
189 Correct 392 ms 195064 KB Output is correct
190 Correct 420 ms 194936 KB Output is correct
191 Correct 396 ms 198508 KB Output is correct
192 Correct 389 ms 198392 KB Output is correct
193 Correct 1196 ms 227820 KB Output is correct
194 Correct 1213 ms 227704 KB Output is correct
195 Correct 2285 ms 266108 KB Output is correct
196 Correct 2299 ms 265720 KB Output is correct
197 Correct 2837 ms 284924 KB Output is correct
198 Correct 2867 ms 284780 KB Output is correct
199 Correct 3175 ms 200444 KB Output is correct
200 Correct 2627 ms 193232 KB Output is correct
201 Correct 2549 ms 192756 KB Output is correct
202 Correct 3379 ms 203808 KB Output is correct
203 Correct 2618 ms 193428 KB Output is correct
204 Correct 2531 ms 192660 KB Output is correct
205 Correct 3382 ms 205512 KB Output is correct
206 Correct 2609 ms 193656 KB Output is correct
207 Correct 2553 ms 192760 KB Output is correct
208 Correct 2541 ms 204416 KB Output is correct
209 Correct 2533 ms 204408 KB Output is correct
210 Correct 2539 ms 204536 KB Output is correct
211 Correct 2534 ms 204732 KB Output is correct
212 Correct 2551 ms 204668 KB Output is correct
213 Correct 4620 ms 246376 KB Output is correct
214 Correct 4203 ms 219024 KB Output is correct
215 Correct 3573 ms 212472 KB Output is correct
216 Correct 2960 ms 212288 KB Output is correct
217 Correct 4604 ms 246552 KB Output is correct
218 Correct 4298 ms 218616 KB Output is correct
219 Correct 3714 ms 212444 KB Output is correct
220 Correct 3113 ms 211828 KB Output is correct
221 Correct 4691 ms 269768 KB Output is correct
222 Correct 4648 ms 258112 KB Output is correct
223 Correct 4564 ms 255728 KB Output is correct
224 Correct 4575 ms 255332 KB Output is correct
225 Correct 4709 ms 286104 KB Output is correct
226 Correct 4750 ms 286156 KB Output is correct
227 Correct 4892 ms 286076 KB Output is correct
228 Correct 4874 ms 286424 KB Output is correct
229 Correct 4610 ms 246452 KB Output is correct
230 Correct 4194 ms 218084 KB Output is correct
231 Correct 3585 ms 211628 KB Output is correct
232 Correct 3007 ms 211408 KB Output is correct
233 Correct 4625 ms 246476 KB Output is correct
234 Correct 4250 ms 217784 KB Output is correct
235 Correct 3669 ms 212088 KB Output is correct
236 Correct 3117 ms 211064 KB Output is correct
237 Correct 4677 ms 270144 KB Output is correct
238 Correct 4685 ms 258220 KB Output is correct
239 Correct 4648 ms 255948 KB Output is correct
240 Correct 4614 ms 255440 KB Output is correct
241 Correct 4765 ms 286404 KB Output is correct
242 Correct 4765 ms 286456 KB Output is correct
243 Correct 4792 ms 286076 KB Output is correct
244 Correct 4788 ms 286132 KB Output is correct
245 Correct 2814 ms 212520 KB Output is correct
246 Correct 2820 ms 212360 KB Output is correct
247 Correct 2809 ms 212448 KB Output is correct
248 Correct 2830 ms 212728 KB Output is correct
249 Correct 3070 ms 212476 KB Output is correct
250 Correct 3080 ms 212296 KB Output is correct
251 Correct 3111 ms 212440 KB Output is correct
252 Correct 2910 ms 212728 KB Output is correct
253 Correct 4578 ms 245284 KB Output is correct
254 Correct 4110 ms 218760 KB Output is correct
255 Correct 3536 ms 212788 KB Output is correct
256 Correct 2941 ms 212620 KB Output is correct
257 Correct 4471 ms 239320 KB Output is correct
258 Correct 4117 ms 217772 KB Output is correct
259 Correct 3550 ms 212600 KB Output is correct
260 Correct 2944 ms 212376 KB Output is correct
261 Correct 3178 ms 248068 KB Output is correct
262 Correct 3874 ms 248664 KB Output is correct
263 Correct 2602 ms 241504 KB Output is correct
264 Correct 3117 ms 241900 KB Output is correct
265 Correct 3221 ms 249000 KB Output is correct
266 Correct 3781 ms 248952 KB Output is correct
267 Correct 2577 ms 241524 KB Output is correct
268 Correct 3130 ms 241912 KB Output is correct
269 Correct 2806 ms 285952 KB Output is correct
270 Correct 2870 ms 285956 KB Output is correct
271 Correct 3215 ms 202460 KB Output is correct
272 Correct 2644 ms 194320 KB Output is correct
273 Correct 3364 ms 206636 KB Output is correct
274 Correct 2648 ms 194680 KB Output is correct
275 Correct 2513 ms 241652 KB Output is correct