Submission #200673

# Submission time Handle Problem Language Result Execution time Memory
200673 2020-02-08T02:32:50 Z gs18115 New Home (APIO18_new_home) C++14
100 / 100
4590 ms 273424 KB
#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define semicolon ;
#define ryan bear
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+8;
const ll INF=1e18;
const int siz=1010101;
struct seg
{
    int t[2020202];
    seg()
    {
        fill(t,t+2020202,-inf);
    }
    void si(int n,int s,int e,int x,int p)
    {
        if(s==e)
        {
            t[n]=p;
            return;
        }
        int m=s+e>>1;
        if(x>m)
            si(n*2+1,m+1,e,x,p);
        else
            si(n*2,s,m,x,p);
        t[n]=max(t[n*2],t[n*2+1]);
        return;
    }
    int sq(int n,int s,int e,int S,int E)
    {
        if(s>E||S>e)
            return -inf;
        if(S<=s&&e<=E)
            return t[n];
        int m=s+e>>1;
        return max(sq(n*2,s,m,S,E),sq(n*2+1,m+1,e,S,E));
    }
}st1,st2;
priority_queue<int>pq1[siz],pq2[siz];
priority_queue<int>dl1[siz],dl2[siz];
inline int get(priority_queue<int>&x,priority_queue<int>&y)
{
    while(!y.empty()&&x.top()==y.top())
        x.pop(),y.pop();
    return x.empty()?-inf:x.top();
}
vector<int>cp;
inline void add1(int x0,int x)
{
    if(x0==-inf)
        return;
    int ci=upper_bound(all(cp),x)-cp.begin()-1;
    pq1[ci].ep(-x0);
    st1.si(1,0,cp.size()-1,ci,get(pq1[ci],dl1[ci]));
    return;
}
inline void add2(int x0,int x)
{
    if(x0==inf)
        return;
    int ci=lower_bound(all(cp),x)-cp.begin();
    pq2[ci].ep(x0);
    st2.si(1,0,cp.size()-1,ci,get(pq2[ci],dl2[ci]));
    return;
}
inline void del1(int x0,int x)
{
    if(x0==-inf)
        return;
    int ci=upper_bound(all(cp),x)-cp.begin()-1;
    dl1[ci].ep(-x0);
    st1.si(1,0,cp.size()-1,ci,get(pq1[ci],dl1[ci]));
    return;
}
inline void del2(int x0,int x)
{
    if(x0==inf)
        return;
    int ci=lower_bound(all(cp),x)-cp.begin();
    dl2[ci].ep(x0);
    st2.si(1,0,cp.size()-1,ci,get(pq2[ci],dl2[ci]));
    return;
}
multiset<int>pts[siz];
inline void add(int tp,int x)
{
    auto it=pts[tp].lower_bound(x);
    int nxt=*it;
    if(nxt==x)
    {
        pts[tp].ep(x);
        return;
    }
    int prv=*--it;
    del1(prv,prv+nxt>>1);
    del2(nxt,prv+nxt>>1);
    add1(prv,prv+x>>1);
    add2(x,prv+x>>1);
    add1(x,x+nxt>>1);
    add2(nxt,x+nxt>>1);
    pts[tp].ep(x);
    return;
}
inline void del(int tp,int x)
{
    pts[tp].erase(pts[tp].find(x));
    auto it=pts[tp].lower_bound(x);
    int nxt=*it;
    if(nxt==x)
        return;
    int prv=*--it;
    del1(prv,prv+x>>1);
    del2(x,prv+x>>1);
    del1(x,x+nxt>>1);
    del2(nxt,x+nxt>>1);
    add1(prv,prv+nxt>>1);
    add2(nxt,prv+nxt>>1);
    return;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,k,q;
    cin>>n>>k>>q;
    vector<pair<int,pi> >va,vb;
    for(int i=0;i<n;i++)
    {
        int x,t,a,b;
        cin>>x>>t>>a>>b;
        va.eb(a-1,pi(x*2,t-1));
        vb.eb(b,pi(x*2,t-1));
    }
    vector<pair<int,pi> >qv;
    for(int i=0;i<q;i++)
    {
        int x,y;
        cin>>x>>y;
        qv.eb(y,pi(x*2,i));
        cp.eb(x*2);
    }
    cp.eb(-inf);
    cp.eb(inf);
    sort(all(cp));
    cp.erase(unique(all(cp)),cp.end());
    for(int i=0;i<k;i++)
    {
        pts[i].ep(-inf);
        pts[i].ep(inf);
    }
    sort(all(va));
    sort(all(vb));
    sort(all(qv));
    vector<int>ans(q,0);
    int c=0;
    int ai=0;
    int bi=0;
    vector<int>ct(k,0);
    for(auto&t:qv)
    {
        while(ai<va.size()&&va[ai].fi<t.fi)
        {
            add(va[ai].se.se,va[ai].se.fi);
            if(ct[va[ai].se.se]++==0)
                c++;
            ai++;
        }
        while(bi<vb.size()&&vb[bi].fi<t.fi)
        {
            del(vb[bi].se.se,vb[bi].se.fi);
            if(--ct[vb[bi].se.se]==0)
                c--;
            bi++;
        }
        if(c<k)
        {
            ans[t.se.se]=-2;
            continue;
        }
        int x=lower_bound(all(cp),t.se.fi)-cp.begin();
        int m1=st1.sq(1,0,cp.size()-1,x,cp.size()-1);
        int m2=st2.sq(1,0,cp.size()-1,0,x);
        ans[t.se.se]=max(t.se.fi+m1,m2-t.se.fi);
    }
    for(int i=0;i<q;i++)
        cout<<ans[i]/2<<'\n';
    cout.flush();
    return 0;
}

Compilation message

new_home.cpp: In member function 'void seg::si(int, int, int, int, int)':
new_home.cpp:34:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
         int m=s+e>>1;
               ~^~
new_home.cpp: In member function 'int seg::sq(int, int, int, int, int)':
new_home.cpp:48:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
         int m=s+e>>1;
               ~^~
new_home.cpp: In function 'void add(int, int)':
new_home.cpp:108:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     del1(prv,prv+nxt>>1);
              ~~~^~~~
new_home.cpp:109:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     del2(nxt,prv+nxt>>1);
              ~~~^~~~
new_home.cpp:110:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     add1(prv,prv+x>>1);
              ~~~^~
new_home.cpp:111:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     add2(x,prv+x>>1);
            ~~~^~
new_home.cpp:112:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     add1(x,x+nxt>>1);
            ~^~~~
new_home.cpp:113:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     add2(nxt,x+nxt>>1);
              ~^~~~
new_home.cpp: In function 'void del(int, int)':
new_home.cpp:125:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     del1(prv,prv+x>>1);
              ~~~^~
new_home.cpp:126:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     del2(x,prv+x>>1);
            ~~~^~
new_home.cpp:127:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     del1(x,x+nxt>>1);
            ~^~~~
new_home.cpp:128:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     del2(nxt,x+nxt>>1);
              ~^~~~
new_home.cpp:129:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     add1(prv,prv+nxt>>1);
              ~~~^~~~
new_home.cpp:130:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     add2(nxt,prv+nxt>>1);
              ~~~^~~~
new_home.cpp: In function 'int main()':
new_home.cpp:174:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while(ai<va.size()&&va[ai].fi<t.fi)
               ~~^~~~~~~~~~
new_home.cpp:181:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while(bi<vb.size()&&vb[bi].fi<t.fi)
               ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 138 ms 190204 KB Output is correct
2 Correct 125 ms 190072 KB Output is correct
3 Correct 126 ms 190072 KB Output is correct
4 Correct 128 ms 190072 KB Output is correct
5 Correct 130 ms 190072 KB Output is correct
6 Correct 126 ms 190200 KB Output is correct
7 Correct 124 ms 190200 KB Output is correct
8 Correct 129 ms 190328 KB Output is correct
9 Correct 132 ms 190200 KB Output is correct
10 Correct 128 ms 190240 KB Output is correct
11 Correct 134 ms 190200 KB Output is correct
12 Correct 130 ms 190204 KB Output is correct
13 Correct 130 ms 190200 KB Output is correct
14 Correct 124 ms 190200 KB Output is correct
15 Correct 131 ms 190200 KB Output is correct
16 Correct 126 ms 190200 KB Output is correct
17 Correct 130 ms 190200 KB Output is correct
18 Correct 125 ms 190200 KB Output is correct
19 Correct 129 ms 190200 KB Output is correct
20 Correct 134 ms 190204 KB Output is correct
21 Correct 130 ms 190200 KB Output is correct
22 Correct 131 ms 190200 KB Output is correct
23 Correct 130 ms 190200 KB Output is correct
24 Correct 127 ms 190204 KB Output is correct
25 Correct 130 ms 190200 KB Output is correct
26 Correct 131 ms 190116 KB Output is correct
27 Correct 128 ms 190200 KB Output is correct
28 Correct 130 ms 190204 KB Output is correct
29 Correct 139 ms 190220 KB Output is correct
30 Correct 131 ms 190204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 138 ms 190204 KB Output is correct
2 Correct 125 ms 190072 KB Output is correct
3 Correct 126 ms 190072 KB Output is correct
4 Correct 128 ms 190072 KB Output is correct
5 Correct 130 ms 190072 KB Output is correct
6 Correct 126 ms 190200 KB Output is correct
7 Correct 124 ms 190200 KB Output is correct
8 Correct 129 ms 190328 KB Output is correct
9 Correct 132 ms 190200 KB Output is correct
10 Correct 128 ms 190240 KB Output is correct
11 Correct 134 ms 190200 KB Output is correct
12 Correct 130 ms 190204 KB Output is correct
13 Correct 130 ms 190200 KB Output is correct
14 Correct 124 ms 190200 KB Output is correct
15 Correct 131 ms 190200 KB Output is correct
16 Correct 126 ms 190200 KB Output is correct
17 Correct 130 ms 190200 KB Output is correct
18 Correct 125 ms 190200 KB Output is correct
19 Correct 129 ms 190200 KB Output is correct
20 Correct 134 ms 190204 KB Output is correct
21 Correct 130 ms 190200 KB Output is correct
22 Correct 131 ms 190200 KB Output is correct
23 Correct 130 ms 190200 KB Output is correct
24 Correct 127 ms 190204 KB Output is correct
25 Correct 130 ms 190200 KB Output is correct
26 Correct 131 ms 190116 KB Output is correct
27 Correct 128 ms 190200 KB Output is correct
28 Correct 130 ms 190204 KB Output is correct
29 Correct 139 ms 190220 KB Output is correct
30 Correct 131 ms 190204 KB Output is correct
31 Correct 781 ms 203788 KB Output is correct
32 Correct 201 ms 195116 KB Output is correct
33 Correct 703 ms 202460 KB Output is correct
34 Correct 712 ms 202408 KB Output is correct
35 Correct 805 ms 203692 KB Output is correct
36 Correct 762 ms 203816 KB Output is correct
37 Correct 523 ms 202028 KB Output is correct
38 Correct 523 ms 201900 KB Output is correct
39 Correct 441 ms 201644 KB Output is correct
40 Correct 453 ms 201644 KB Output is correct
41 Correct 463 ms 201000 KB Output is correct
42 Correct 445 ms 200872 KB Output is correct
43 Correct 199 ms 198440 KB Output is correct
44 Correct 432 ms 201008 KB Output is correct
45 Correct 466 ms 200892 KB Output is correct
46 Correct 438 ms 200244 KB Output is correct
47 Correct 321 ms 199432 KB Output is correct
48 Correct 317 ms 199592 KB Output is correct
49 Correct 351 ms 199728 KB Output is correct
50 Correct 362 ms 199720 KB Output is correct
51 Correct 360 ms 200236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1485 ms 237348 KB Output is correct
2 Correct 1117 ms 229384 KB Output is correct
3 Correct 1091 ms 254388 KB Output is correct
4 Correct 1391 ms 241984 KB Output is correct
5 Correct 1027 ms 231428 KB Output is correct
6 Correct 1132 ms 231024 KB Output is correct
7 Correct 1076 ms 253860 KB Output is correct
8 Correct 1406 ms 241036 KB Output is correct
9 Correct 1464 ms 235712 KB Output is correct
10 Correct 1374 ms 230652 KB Output is correct
11 Correct 1036 ms 229888 KB Output is correct
12 Correct 1174 ms 230468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3529 ms 239120 KB Output is correct
2 Correct 490 ms 222924 KB Output is correct
3 Correct 3124 ms 249524 KB Output is correct
4 Correct 1105 ms 270536 KB Output is correct
5 Correct 2540 ms 257040 KB Output is correct
6 Correct 2122 ms 258688 KB Output is correct
7 Correct 2678 ms 248684 KB Output is correct
8 Correct 3041 ms 249232 KB Output is correct
9 Correct 1396 ms 271988 KB Output is correct
10 Correct 2578 ms 259256 KB Output is correct
11 Correct 3326 ms 253888 KB Output is correct
12 Correct 3529 ms 250444 KB Output is correct
13 Correct 1521 ms 245624 KB Output is correct
14 Correct 1460 ms 245348 KB Output is correct
15 Correct 1727 ms 247320 KB Output is correct
16 Correct 2041 ms 248876 KB Output is correct
17 Correct 1814 ms 247380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 138 ms 190204 KB Output is correct
2 Correct 125 ms 190072 KB Output is correct
3 Correct 126 ms 190072 KB Output is correct
4 Correct 128 ms 190072 KB Output is correct
5 Correct 130 ms 190072 KB Output is correct
6 Correct 126 ms 190200 KB Output is correct
7 Correct 124 ms 190200 KB Output is correct
8 Correct 129 ms 190328 KB Output is correct
9 Correct 132 ms 190200 KB Output is correct
10 Correct 128 ms 190240 KB Output is correct
11 Correct 134 ms 190200 KB Output is correct
12 Correct 130 ms 190204 KB Output is correct
13 Correct 130 ms 190200 KB Output is correct
14 Correct 124 ms 190200 KB Output is correct
15 Correct 131 ms 190200 KB Output is correct
16 Correct 126 ms 190200 KB Output is correct
17 Correct 130 ms 190200 KB Output is correct
18 Correct 125 ms 190200 KB Output is correct
19 Correct 129 ms 190200 KB Output is correct
20 Correct 134 ms 190204 KB Output is correct
21 Correct 130 ms 190200 KB Output is correct
22 Correct 131 ms 190200 KB Output is correct
23 Correct 130 ms 190200 KB Output is correct
24 Correct 127 ms 190204 KB Output is correct
25 Correct 130 ms 190200 KB Output is correct
26 Correct 131 ms 190116 KB Output is correct
27 Correct 128 ms 190200 KB Output is correct
28 Correct 130 ms 190204 KB Output is correct
29 Correct 139 ms 190220 KB Output is correct
30 Correct 131 ms 190204 KB Output is correct
31 Correct 781 ms 203788 KB Output is correct
32 Correct 201 ms 195116 KB Output is correct
33 Correct 703 ms 202460 KB Output is correct
34 Correct 712 ms 202408 KB Output is correct
35 Correct 805 ms 203692 KB Output is correct
36 Correct 762 ms 203816 KB Output is correct
37 Correct 523 ms 202028 KB Output is correct
38 Correct 523 ms 201900 KB Output is correct
39 Correct 441 ms 201644 KB Output is correct
40 Correct 453 ms 201644 KB Output is correct
41 Correct 463 ms 201000 KB Output is correct
42 Correct 445 ms 200872 KB Output is correct
43 Correct 199 ms 198440 KB Output is correct
44 Correct 432 ms 201008 KB Output is correct
45 Correct 466 ms 200892 KB Output is correct
46 Correct 438 ms 200244 KB Output is correct
47 Correct 321 ms 199432 KB Output is correct
48 Correct 317 ms 199592 KB Output is correct
49 Correct 351 ms 199728 KB Output is correct
50 Correct 362 ms 199720 KB Output is correct
51 Correct 360 ms 200236 KB Output is correct
52 Correct 325 ms 206120 KB Output is correct
53 Correct 275 ms 204328 KB Output is correct
54 Correct 490 ms 204392 KB Output is correct
55 Correct 419 ms 203564 KB Output is correct
56 Correct 376 ms 204456 KB Output is correct
57 Correct 437 ms 201768 KB Output is correct
58 Correct 395 ms 203180 KB Output is correct
59 Correct 379 ms 204204 KB Output is correct
60 Correct 454 ms 201588 KB Output is correct
61 Correct 209 ms 204860 KB Output is correct
62 Correct 311 ms 205996 KB Output is correct
63 Correct 399 ms 204588 KB Output is correct
64 Correct 463 ms 203904 KB Output is correct
65 Correct 502 ms 201896 KB Output is correct
66 Correct 475 ms 201004 KB Output is correct
67 Correct 282 ms 198272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 138 ms 190204 KB Output is correct
2 Correct 125 ms 190072 KB Output is correct
3 Correct 126 ms 190072 KB Output is correct
4 Correct 128 ms 190072 KB Output is correct
5 Correct 130 ms 190072 KB Output is correct
6 Correct 126 ms 190200 KB Output is correct
7 Correct 124 ms 190200 KB Output is correct
8 Correct 129 ms 190328 KB Output is correct
9 Correct 132 ms 190200 KB Output is correct
10 Correct 128 ms 190240 KB Output is correct
11 Correct 134 ms 190200 KB Output is correct
12 Correct 130 ms 190204 KB Output is correct
13 Correct 130 ms 190200 KB Output is correct
14 Correct 124 ms 190200 KB Output is correct
15 Correct 131 ms 190200 KB Output is correct
16 Correct 126 ms 190200 KB Output is correct
17 Correct 130 ms 190200 KB Output is correct
18 Correct 125 ms 190200 KB Output is correct
19 Correct 129 ms 190200 KB Output is correct
20 Correct 134 ms 190204 KB Output is correct
21 Correct 130 ms 190200 KB Output is correct
22 Correct 131 ms 190200 KB Output is correct
23 Correct 130 ms 190200 KB Output is correct
24 Correct 127 ms 190204 KB Output is correct
25 Correct 130 ms 190200 KB Output is correct
26 Correct 131 ms 190116 KB Output is correct
27 Correct 128 ms 190200 KB Output is correct
28 Correct 130 ms 190204 KB Output is correct
29 Correct 139 ms 190220 KB Output is correct
30 Correct 131 ms 190204 KB Output is correct
31 Correct 781 ms 203788 KB Output is correct
32 Correct 201 ms 195116 KB Output is correct
33 Correct 703 ms 202460 KB Output is correct
34 Correct 712 ms 202408 KB Output is correct
35 Correct 805 ms 203692 KB Output is correct
36 Correct 762 ms 203816 KB Output is correct
37 Correct 523 ms 202028 KB Output is correct
38 Correct 523 ms 201900 KB Output is correct
39 Correct 441 ms 201644 KB Output is correct
40 Correct 453 ms 201644 KB Output is correct
41 Correct 463 ms 201000 KB Output is correct
42 Correct 445 ms 200872 KB Output is correct
43 Correct 199 ms 198440 KB Output is correct
44 Correct 432 ms 201008 KB Output is correct
45 Correct 466 ms 200892 KB Output is correct
46 Correct 438 ms 200244 KB Output is correct
47 Correct 321 ms 199432 KB Output is correct
48 Correct 317 ms 199592 KB Output is correct
49 Correct 351 ms 199728 KB Output is correct
50 Correct 362 ms 199720 KB Output is correct
51 Correct 360 ms 200236 KB Output is correct
52 Correct 1485 ms 237348 KB Output is correct
53 Correct 1117 ms 229384 KB Output is correct
54 Correct 1091 ms 254388 KB Output is correct
55 Correct 1391 ms 241984 KB Output is correct
56 Correct 1027 ms 231428 KB Output is correct
57 Correct 1132 ms 231024 KB Output is correct
58 Correct 1076 ms 253860 KB Output is correct
59 Correct 1406 ms 241036 KB Output is correct
60 Correct 1464 ms 235712 KB Output is correct
61 Correct 1374 ms 230652 KB Output is correct
62 Correct 1036 ms 229888 KB Output is correct
63 Correct 1174 ms 230468 KB Output is correct
64 Correct 3529 ms 239120 KB Output is correct
65 Correct 490 ms 222924 KB Output is correct
66 Correct 3124 ms 249524 KB Output is correct
67 Correct 1105 ms 270536 KB Output is correct
68 Correct 2540 ms 257040 KB Output is correct
69 Correct 2122 ms 258688 KB Output is correct
70 Correct 2678 ms 248684 KB Output is correct
71 Correct 3041 ms 249232 KB Output is correct
72 Correct 1396 ms 271988 KB Output is correct
73 Correct 2578 ms 259256 KB Output is correct
74 Correct 3326 ms 253888 KB Output is correct
75 Correct 3529 ms 250444 KB Output is correct
76 Correct 1521 ms 245624 KB Output is correct
77 Correct 1460 ms 245348 KB Output is correct
78 Correct 1727 ms 247320 KB Output is correct
79 Correct 2041 ms 248876 KB Output is correct
80 Correct 1814 ms 247380 KB Output is correct
81 Correct 325 ms 206120 KB Output is correct
82 Correct 275 ms 204328 KB Output is correct
83 Correct 490 ms 204392 KB Output is correct
84 Correct 419 ms 203564 KB Output is correct
85 Correct 376 ms 204456 KB Output is correct
86 Correct 437 ms 201768 KB Output is correct
87 Correct 395 ms 203180 KB Output is correct
88 Correct 379 ms 204204 KB Output is correct
89 Correct 454 ms 201588 KB Output is correct
90 Correct 209 ms 204860 KB Output is correct
91 Correct 311 ms 205996 KB Output is correct
92 Correct 399 ms 204588 KB Output is correct
93 Correct 463 ms 203904 KB Output is correct
94 Correct 502 ms 201896 KB Output is correct
95 Correct 475 ms 201004 KB Output is correct
96 Correct 282 ms 198272 KB Output is correct
97 Correct 1281 ms 272668 KB Output is correct
98 Correct 511 ms 216064 KB Output is correct
99 Correct 4444 ms 250928 KB Output is correct
100 Correct 1121 ms 263308 KB Output is correct
101 Correct 2409 ms 261376 KB Output is correct
102 Correct 4590 ms 257220 KB Output is correct
103 Correct 3395 ms 249756 KB Output is correct
104 Correct 3196 ms 249488 KB Output is correct
105 Correct 2001 ms 248728 KB Output is correct
106 Correct 2163 ms 248812 KB Output is correct
107 Correct 2173 ms 256860 KB Output is correct
108 Correct 1850 ms 264704 KB Output is correct
109 Correct 2318 ms 249084 KB Output is correct
110 Correct 2117 ms 255640 KB Output is correct
111 Correct 1784 ms 263768 KB Output is correct
112 Correct 2210 ms 247652 KB Output is correct
113 Correct 540 ms 265292 KB Output is correct
114 Correct 1214 ms 273424 KB Output is correct
115 Correct 1910 ms 265880 KB Output is correct
116 Correct 2211 ms 261168 KB Output is correct
117 Correct 2585 ms 249740 KB Output is correct
118 Correct 2660 ms 245564 KB Output is correct
119 Correct 1069 ms 230016 KB Output is correct
120 Correct 1036 ms 234652 KB Output is correct
121 Correct 1255 ms 238604 KB Output is correct
122 Correct 1263 ms 238944 KB Output is correct
123 Correct 1387 ms 239248 KB Output is correct
124 Correct 1482 ms 239820 KB Output is correct
125 Correct 1497 ms 239924 KB Output is correct
126 Correct 1499 ms 239408 KB Output is correct