Submission #986484

# Submission time Handle Problem Language Result Execution time Memory
986484 2024-05-20T15:52:27 Z huutuan New Home (APIO18_new_home) C++14
100 / 100
4736 ms 608740 KB
#include<bits/stdc++.h>

using namespace std;

const int N=1e6+10, inf=1e9;

long long stk[N*64];
int stk_size;

vector<pair<pair<int, int>, pair<int, int>>> vq[N];
int ans[N];
vector<pair<int, int>> vpos;
vector<int> vtime;

struct SegmentTree1{
   int n;
   pair<int, int> t[N*2];
   void init(int _n){
      n=_n;
      for (int i=0; i<=n*2; ++i) t[i]={-inf, -inf};
   }
   void update(int pos, pair<int, int> val){
      --pos;
      pos+=n;
      stk[++stk_size]=(((long long)pos)<<32)|(t[pos].first&((1ll<<32)-1));
      stk[++stk_size]=(((long long)pos)<<32)|(t[pos].second&((1ll<<32)-1));
      t[pos]=val;
      for (; pos>1; pos>>=1){
         stk[++stk_size]=(((long long)(pos>>1))<<32)|(t[pos>>1].first&((1ll<<32)-1));
         stk[++stk_size]=(((long long)(pos>>1))<<32)|(t[pos>>1].second&((1ll<<32)-1));
         t[pos>>1].first=max(t[pos].first, t[pos^1].first);
         t[pos>>1].second=max(t[pos].second, t[pos^1].second);
      }
   }
   int getl(int l, int r){
      --l;
      int res=-inf;
      for (l+=n, r+=n; l<r; l>>=1, r>>=1){
         if (l&1) res=max(res, t[l++].first);
         if (r&1) res=max(res, t[--r].first);
      }
      return res;
   }
   int getr(int l, int r){
      --l;
      int res=-inf;
      for (l+=n, r+=n; l<r; l>>=1, r>>=1){
         if (l&1) res=max(res, t[l++].second);
         if (r&1) res=max(res, t[--r].second);
      }
      return res;
   }
} st1;

struct SegmentTree2{
   int n;
   vector<pair<int, pair<int, int>>> t[N*4];
   void init(int _n){
      n=_n;
   }
   void update(int k, int l, int r, int L, int R, pair<int, pair<int, int>> val){
      if (r<L || R<l) return;
      if (L<=l && r<=R){
         t[k].push_back(val);
         return;
      }
      int mid=(l+r)>>1;
      update(k<<1, l, mid, L, R, val);
      update(k<<1|1, mid+1, r, L, R, val);
   }
   void dfs(int k, int l, int r){
      int size=stk_size;
      for (auto &i:t[k]){
         #ifdef sus
         // cout << "update l " << i.first << ' ' << i.second.first << ' ' << i.second.second << endl;
         // cout << "update r " << i.first << ' ' << i.second.first << ' ' << i.second.second << endl;
         #endif
         st1.update(i.first, {i.second.first+i.second.second, i.second.second-i.second.first});
      }
      if (l==r){
         for (auto &i:vq[l]){
            ans[i.second.first]=max(st1.getl(1, i.first.first)-i.second.second, st1.getr(i.first.second, st1.n)+i.second.second)/2;
         }
      }else{
         int mid=(l+r)>>1;
         dfs(k<<1, l, mid);
         dfs(k<<1|1, mid+1, r);
      }
      while (stk_size!=size){
         st1.t[stk[stk_size]>>32].second=(int)(stk[stk_size]&((1ll<<32)-1));
         --stk_size;
         st1.t[stk[stk_size]>>32].first=(int)(stk[stk_size]&((1ll<<32)-1));
         --stk_size;
      }
   }
} st2;

int n, q, k;
vector<pair<int, int>> v[N];

int32_t main(){
   ios_base::sync_with_stdio(false);
   cin.tie(nullptr);
   cin >> n >> k >> q;
   vtime.push_back(-inf*2); vpos.emplace_back(-inf*2, -1);
   vector<pair<int, pair<int, int>>> check;
   {
      vector<array<int, 4>> mp, mp2;
      for (int i=1; i<=n; ++i){
         int x, t, l, r;
         cin >> x >> t >> l >> r; x*=2;
         mp.push_back({x, t, l, r});
      }
      sort(mp.begin(), mp.end());
      for (int i=0; i<(int)mp.size(); ){
         int j=i;
         while (j+1<(int)mp.size() && mp[i][0]==mp[j+1][0] && mp[i][1]==mp[j+1][1]) ++j;
         for (; i<=j; ++i){
            if (mp2.size() && mp2.back()[0]==mp[i][0] && mp2.back()[1]==mp[i][1] && mp2.back()[3]+1>=mp[i][2]){
               mp2.back()[3]=max(mp2.back()[3], mp[i][3]);
            }else mp2.push_back(mp[i]);
         }
      }
      for (auto &i:mp2){
         int x=i[0], t=i[1], l=i[2], r=i[3];
         v[t].emplace_back(l, x);
         v[t].emplace_back(r+1, -x);
         check.push_back({l, {1, t}});
         check.push_back({r+1, {-1, t}});
      }
   }
   vector<vector<int>> events;
   for (int i=1; i<=k; ++i){
      set<int> st;
      unordered_map<int, int> mp;
      sort(v[i].begin(), v[i].end());
      for (auto &j:v[i]){
         int pos=abs(j.second), t=j.first;
         auto it=st.lower_bound(pos);
         if (j.second>0){
            if (st.size()){
               int x=0, y=0;
               if (it==st.begin()) x=-*it, y=*it*2;
               else if (it==st.end()) x=inf+*prev(it), y=inf;
               else x=(*it+*prev(it))>>1, y=(*it-*prev(it))>>1; 
               events.push_back({mp[x], t-1, x, y});
               mp.erase(x);
            }
            {
               int x=0;
               if (it==st.begin()) x=-pos;
               else x=(pos+*prev(it))>>1;
               mp[x]=t;
            }
            {
               int x=0;
               if (it==st.end()) x=inf+pos;
               else x=(*it+pos)>>1;
               mp[x]=t;
            }
            st.emplace_hint(it, pos);
         }else{
            {
               int x=0, y=0;
               if (it==st.begin()) x=-pos, y=pos*2;
               else x=(pos+*prev(it))>>1, y=(pos-*prev(it))>>1;
               events.push_back({mp[x], t-1, x, y});
               mp.erase(x);
            }
            {
               int x=0, y=0;
               if (next(it)==st.end()) x=inf+pos, y=inf;
               else x=(*next(it)+pos)>>1, y=(*next(it)-pos)>>1;
               events.push_back({mp[x], t-1, x, y});
               mp.erase(x);
            }
            if ((int)st.size()>1){
               int x=0;
               if (it==st.begin()) x=-*next(it);
               else if (next(it)==st.end()) x=inf+*prev(it);
               else x=(*next(it)+*prev(it))>>1;
               mp[x]=t;
            }
            st.erase(it);
         }
      }
   }
   for (int i=0; i<(int)events.size(); ++i){
      vpos.emplace_back(events[i][2], i);
   }
   sort(vpos.begin(), vpos.end());
   vector<pair<int, int>> query(q);
   for (auto &i:query) cin >> i.first >> i.second, vtime.push_back(i.second), i.first*=2;
   sort(vtime.begin(), vtime.end()); vtime.resize(unique(vtime.begin(), vtime.end())-vtime.begin());
   for (int i=1; i<=q; ++i){
      int pl=lower_bound(vpos.begin(), vpos.end(), make_pair(query[i-1].first, -inf))-vpos.begin();
      int pr=lower_bound(vpos.begin(), vpos.end(), make_pair(query[i-1].first, inf))-vpos.begin()-1;
      vq[lower_bound(vtime.begin(), vtime.end(), query[i-1].second)-vtime.begin()].push_back({{pr, pl}, {i, query[i-1].first}});
      check.push_back({query[i-1].second, {2, i}});
   }
   st1.init((int)vpos.size()-1);
   st2.init((int)vtime.size()-1);
   for (int i=0; i<(int)events.size(); ++i){
      events[i][0]=lower_bound(vtime.begin(), vtime.end(), events[i][0])-vtime.begin();
      events[i][1]=upper_bound(vtime.begin(), vtime.end(), events[i][1])-vtime.begin()-1;
      if (events[i][0]<=events[i][1]) st2.update(1, 1, st2.n, events[i][0], events[i][1], {lower_bound(vpos.begin(), vpos.end(), make_pair(events[i][2], i))-vpos.begin(), {events[i][2], events[i][3]}});
   }
   st2.dfs(1, 1, st2.n);
   sort(check.begin(), check.end());
   vector<int> cnt(k+1); int cnt0=k;
   for (auto &i:check){
      if (abs(i.second.first)==1){
         cnt0-=!cnt[i.second.second];
         cnt[i.second.second]+=i.second.first;
         cnt0+=!cnt[i.second.second];
      }else{
         if (cnt0) ans[i.second.second]=-1;
      }
   }
   for (int i=1; i<=q; ++i) cout << ans[i] << '\n';
   return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 61 ms 158292 KB Output is correct
2 Correct 64 ms 160432 KB Output is correct
3 Correct 63 ms 160188 KB Output is correct
4 Correct 62 ms 158296 KB Output is correct
5 Correct 65 ms 158288 KB Output is correct
6 Correct 65 ms 158652 KB Output is correct
7 Correct 70 ms 158824 KB Output is correct
8 Correct 66 ms 158632 KB Output is correct
9 Correct 66 ms 158548 KB Output is correct
10 Correct 65 ms 158544 KB Output is correct
11 Correct 67 ms 158616 KB Output is correct
12 Correct 71 ms 158572 KB Output is correct
13 Correct 65 ms 158548 KB Output is correct
14 Correct 65 ms 158580 KB Output is correct
15 Correct 66 ms 158648 KB Output is correct
16 Correct 65 ms 158544 KB Output is correct
17 Correct 66 ms 158896 KB Output is correct
18 Correct 65 ms 158732 KB Output is correct
19 Correct 67 ms 158544 KB Output is correct
20 Correct 66 ms 158548 KB Output is correct
21 Correct 65 ms 158544 KB Output is correct
22 Correct 66 ms 158668 KB Output is correct
23 Correct 66 ms 158596 KB Output is correct
24 Correct 65 ms 158544 KB Output is correct
25 Correct 72 ms 158548 KB Output is correct
26 Correct 66 ms 158564 KB Output is correct
27 Correct 64 ms 158612 KB Output is correct
28 Correct 66 ms 158548 KB Output is correct
29 Correct 65 ms 158548 KB Output is correct
30 Correct 65 ms 158560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 158292 KB Output is correct
2 Correct 64 ms 160432 KB Output is correct
3 Correct 63 ms 160188 KB Output is correct
4 Correct 62 ms 158296 KB Output is correct
5 Correct 65 ms 158288 KB Output is correct
6 Correct 65 ms 158652 KB Output is correct
7 Correct 70 ms 158824 KB Output is correct
8 Correct 66 ms 158632 KB Output is correct
9 Correct 66 ms 158548 KB Output is correct
10 Correct 65 ms 158544 KB Output is correct
11 Correct 67 ms 158616 KB Output is correct
12 Correct 71 ms 158572 KB Output is correct
13 Correct 65 ms 158548 KB Output is correct
14 Correct 65 ms 158580 KB Output is correct
15 Correct 66 ms 158648 KB Output is correct
16 Correct 65 ms 158544 KB Output is correct
17 Correct 66 ms 158896 KB Output is correct
18 Correct 65 ms 158732 KB Output is correct
19 Correct 67 ms 158544 KB Output is correct
20 Correct 66 ms 158548 KB Output is correct
21 Correct 65 ms 158544 KB Output is correct
22 Correct 66 ms 158668 KB Output is correct
23 Correct 66 ms 158596 KB Output is correct
24 Correct 65 ms 158544 KB Output is correct
25 Correct 72 ms 158548 KB Output is correct
26 Correct 66 ms 158564 KB Output is correct
27 Correct 64 ms 158612 KB Output is correct
28 Correct 66 ms 158548 KB Output is correct
29 Correct 65 ms 158548 KB Output is correct
30 Correct 65 ms 158560 KB Output is correct
31 Correct 604 ms 231892 KB Output is correct
32 Correct 107 ms 162596 KB Output is correct
33 Correct 589 ms 218660 KB Output is correct
34 Correct 570 ms 219332 KB Output is correct
35 Correct 598 ms 231164 KB Output is correct
36 Correct 614 ms 231128 KB Output is correct
37 Correct 483 ms 207868 KB Output is correct
38 Correct 467 ms 207472 KB Output is correct
39 Correct 361 ms 196564 KB Output is correct
40 Correct 383 ms 199124 KB Output is correct
41 Correct 481 ms 202716 KB Output is correct
42 Correct 493 ms 203692 KB Output is correct
43 Correct 105 ms 165572 KB Output is correct
44 Correct 456 ms 202204 KB Output is correct
45 Correct 397 ms 196700 KB Output is correct
46 Correct 336 ms 188000 KB Output is correct
47 Correct 265 ms 186144 KB Output is correct
48 Correct 259 ms 184460 KB Output is correct
49 Correct 318 ms 190480 KB Output is correct
50 Correct 402 ms 200404 KB Output is correct
51 Correct 292 ms 188188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1040 ms 385512 KB Output is correct
2 Correct 973 ms 369432 KB Output is correct
3 Correct 1047 ms 456952 KB Output is correct
4 Correct 1056 ms 396176 KB Output is correct
5 Correct 1047 ms 372456 KB Output is correct
6 Correct 946 ms 369224 KB Output is correct
7 Correct 1084 ms 457164 KB Output is correct
8 Correct 1053 ms 395696 KB Output is correct
9 Correct 1018 ms 377200 KB Output is correct
10 Correct 953 ms 370748 KB Output is correct
11 Correct 801 ms 365560 KB Output is correct
12 Correct 860 ms 368772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2871 ms 474904 KB Output is correct
2 Correct 271 ms 181064 KB Output is correct
3 Correct 2676 ms 474272 KB Output is correct
4 Correct 2223 ms 524864 KB Output is correct
5 Correct 2868 ms 484896 KB Output is correct
6 Correct 2811 ms 491356 KB Output is correct
7 Correct 3229 ms 476440 KB Output is correct
8 Correct 2781 ms 474132 KB Output is correct
9 Correct 2340 ms 523548 KB Output is correct
10 Correct 2892 ms 483912 KB Output is correct
11 Correct 2872 ms 477504 KB Output is correct
12 Correct 2812 ms 476464 KB Output is correct
13 Correct 1499 ms 423484 KB Output is correct
14 Correct 1467 ms 418988 KB Output is correct
15 Correct 1767 ms 438856 KB Output is correct
16 Correct 2000 ms 453520 KB Output is correct
17 Correct 1840 ms 445316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 158292 KB Output is correct
2 Correct 64 ms 160432 KB Output is correct
3 Correct 63 ms 160188 KB Output is correct
4 Correct 62 ms 158296 KB Output is correct
5 Correct 65 ms 158288 KB Output is correct
6 Correct 65 ms 158652 KB Output is correct
7 Correct 70 ms 158824 KB Output is correct
8 Correct 66 ms 158632 KB Output is correct
9 Correct 66 ms 158548 KB Output is correct
10 Correct 65 ms 158544 KB Output is correct
11 Correct 67 ms 158616 KB Output is correct
12 Correct 71 ms 158572 KB Output is correct
13 Correct 65 ms 158548 KB Output is correct
14 Correct 65 ms 158580 KB Output is correct
15 Correct 66 ms 158648 KB Output is correct
16 Correct 65 ms 158544 KB Output is correct
17 Correct 66 ms 158896 KB Output is correct
18 Correct 65 ms 158732 KB Output is correct
19 Correct 67 ms 158544 KB Output is correct
20 Correct 66 ms 158548 KB Output is correct
21 Correct 65 ms 158544 KB Output is correct
22 Correct 66 ms 158668 KB Output is correct
23 Correct 66 ms 158596 KB Output is correct
24 Correct 65 ms 158544 KB Output is correct
25 Correct 72 ms 158548 KB Output is correct
26 Correct 66 ms 158564 KB Output is correct
27 Correct 64 ms 158612 KB Output is correct
28 Correct 66 ms 158548 KB Output is correct
29 Correct 65 ms 158548 KB Output is correct
30 Correct 65 ms 158560 KB Output is correct
31 Correct 604 ms 231892 KB Output is correct
32 Correct 107 ms 162596 KB Output is correct
33 Correct 589 ms 218660 KB Output is correct
34 Correct 570 ms 219332 KB Output is correct
35 Correct 598 ms 231164 KB Output is correct
36 Correct 614 ms 231128 KB Output is correct
37 Correct 483 ms 207868 KB Output is correct
38 Correct 467 ms 207472 KB Output is correct
39 Correct 361 ms 196564 KB Output is correct
40 Correct 383 ms 199124 KB Output is correct
41 Correct 481 ms 202716 KB Output is correct
42 Correct 493 ms 203692 KB Output is correct
43 Correct 105 ms 165572 KB Output is correct
44 Correct 456 ms 202204 KB Output is correct
45 Correct 397 ms 196700 KB Output is correct
46 Correct 336 ms 188000 KB Output is correct
47 Correct 265 ms 186144 KB Output is correct
48 Correct 259 ms 184460 KB Output is correct
49 Correct 318 ms 190480 KB Output is correct
50 Correct 402 ms 200404 KB Output is correct
51 Correct 292 ms 188188 KB Output is correct
52 Correct 458 ms 236120 KB Output is correct
53 Correct 443 ms 213092 KB Output is correct
54 Correct 578 ms 233924 KB Output is correct
55 Correct 492 ms 219796 KB Output is correct
56 Correct 535 ms 225816 KB Output is correct
57 Correct 504 ms 207768 KB Output is correct
58 Correct 483 ms 217036 KB Output is correct
59 Correct 497 ms 223680 KB Output is correct
60 Correct 483 ms 207816 KB Output is correct
61 Correct 173 ms 211504 KB Output is correct
62 Correct 463 ms 239840 KB Output is correct
63 Correct 562 ms 232748 KB Output is correct
64 Correct 580 ms 229148 KB Output is correct
65 Correct 603 ms 218408 KB Output is correct
66 Correct 565 ms 207196 KB Output is correct
67 Correct 279 ms 187380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 158292 KB Output is correct
2 Correct 64 ms 160432 KB Output is correct
3 Correct 63 ms 160188 KB Output is correct
4 Correct 62 ms 158296 KB Output is correct
5 Correct 65 ms 158288 KB Output is correct
6 Correct 65 ms 158652 KB Output is correct
7 Correct 70 ms 158824 KB Output is correct
8 Correct 66 ms 158632 KB Output is correct
9 Correct 66 ms 158548 KB Output is correct
10 Correct 65 ms 158544 KB Output is correct
11 Correct 67 ms 158616 KB Output is correct
12 Correct 71 ms 158572 KB Output is correct
13 Correct 65 ms 158548 KB Output is correct
14 Correct 65 ms 158580 KB Output is correct
15 Correct 66 ms 158648 KB Output is correct
16 Correct 65 ms 158544 KB Output is correct
17 Correct 66 ms 158896 KB Output is correct
18 Correct 65 ms 158732 KB Output is correct
19 Correct 67 ms 158544 KB Output is correct
20 Correct 66 ms 158548 KB Output is correct
21 Correct 65 ms 158544 KB Output is correct
22 Correct 66 ms 158668 KB Output is correct
23 Correct 66 ms 158596 KB Output is correct
24 Correct 65 ms 158544 KB Output is correct
25 Correct 72 ms 158548 KB Output is correct
26 Correct 66 ms 158564 KB Output is correct
27 Correct 64 ms 158612 KB Output is correct
28 Correct 66 ms 158548 KB Output is correct
29 Correct 65 ms 158548 KB Output is correct
30 Correct 65 ms 158560 KB Output is correct
31 Correct 604 ms 231892 KB Output is correct
32 Correct 107 ms 162596 KB Output is correct
33 Correct 589 ms 218660 KB Output is correct
34 Correct 570 ms 219332 KB Output is correct
35 Correct 598 ms 231164 KB Output is correct
36 Correct 614 ms 231128 KB Output is correct
37 Correct 483 ms 207868 KB Output is correct
38 Correct 467 ms 207472 KB Output is correct
39 Correct 361 ms 196564 KB Output is correct
40 Correct 383 ms 199124 KB Output is correct
41 Correct 481 ms 202716 KB Output is correct
42 Correct 493 ms 203692 KB Output is correct
43 Correct 105 ms 165572 KB Output is correct
44 Correct 456 ms 202204 KB Output is correct
45 Correct 397 ms 196700 KB Output is correct
46 Correct 336 ms 188000 KB Output is correct
47 Correct 265 ms 186144 KB Output is correct
48 Correct 259 ms 184460 KB Output is correct
49 Correct 318 ms 190480 KB Output is correct
50 Correct 402 ms 200404 KB Output is correct
51 Correct 292 ms 188188 KB Output is correct
52 Correct 1040 ms 385512 KB Output is correct
53 Correct 973 ms 369432 KB Output is correct
54 Correct 1047 ms 456952 KB Output is correct
55 Correct 1056 ms 396176 KB Output is correct
56 Correct 1047 ms 372456 KB Output is correct
57 Correct 946 ms 369224 KB Output is correct
58 Correct 1084 ms 457164 KB Output is correct
59 Correct 1053 ms 395696 KB Output is correct
60 Correct 1018 ms 377200 KB Output is correct
61 Correct 953 ms 370748 KB Output is correct
62 Correct 801 ms 365560 KB Output is correct
63 Correct 860 ms 368772 KB Output is correct
64 Correct 2871 ms 474904 KB Output is correct
65 Correct 271 ms 181064 KB Output is correct
66 Correct 2676 ms 474272 KB Output is correct
67 Correct 2223 ms 524864 KB Output is correct
68 Correct 2868 ms 484896 KB Output is correct
69 Correct 2811 ms 491356 KB Output is correct
70 Correct 3229 ms 476440 KB Output is correct
71 Correct 2781 ms 474132 KB Output is correct
72 Correct 2340 ms 523548 KB Output is correct
73 Correct 2892 ms 483912 KB Output is correct
74 Correct 2872 ms 477504 KB Output is correct
75 Correct 2812 ms 476464 KB Output is correct
76 Correct 1499 ms 423484 KB Output is correct
77 Correct 1467 ms 418988 KB Output is correct
78 Correct 1767 ms 438856 KB Output is correct
79 Correct 2000 ms 453520 KB Output is correct
80 Correct 1840 ms 445316 KB Output is correct
81 Correct 458 ms 236120 KB Output is correct
82 Correct 443 ms 213092 KB Output is correct
83 Correct 578 ms 233924 KB Output is correct
84 Correct 492 ms 219796 KB Output is correct
85 Correct 535 ms 225816 KB Output is correct
86 Correct 504 ms 207768 KB Output is correct
87 Correct 483 ms 217036 KB Output is correct
88 Correct 497 ms 223680 KB Output is correct
89 Correct 483 ms 207816 KB Output is correct
90 Correct 173 ms 211504 KB Output is correct
91 Correct 463 ms 239840 KB Output is correct
92 Correct 562 ms 232748 KB Output is correct
93 Correct 580 ms 229148 KB Output is correct
94 Correct 603 ms 218408 KB Output is correct
95 Correct 565 ms 207196 KB Output is correct
96 Correct 279 ms 187380 KB Output is correct
97 Correct 3472 ms 608740 KB Output is correct
98 Correct 289 ms 182992 KB Output is correct
99 Correct 4736 ms 489860 KB Output is correct
100 Correct 3295 ms 464000 KB Output is correct
101 Correct 4692 ms 588948 KB Output is correct
102 Correct 4725 ms 575908 KB Output is correct
103 Correct 2843 ms 433664 KB Output is correct
104 Correct 2756 ms 434172 KB Output is correct
105 Correct 2081 ms 383632 KB Output is correct
106 Correct 2140 ms 396092 KB Output is correct
107 Correct 3335 ms 489636 KB Output is correct
108 Correct 3589 ms 538668 KB Output is correct
109 Correct 3169 ms 427316 KB Output is correct
110 Correct 3260 ms 473556 KB Output is correct
111 Correct 3214 ms 509252 KB Output is correct
112 Correct 3101 ms 425496 KB Output is correct
113 Correct 606 ms 454776 KB Output is correct
114 Correct 3392 ms 597156 KB Output is correct
115 Correct 4196 ms 581316 KB Output is correct
116 Correct 4371 ms 551236 KB Output is correct
117 Correct 4443 ms 491740 KB Output is correct
118 Correct 3614 ms 429268 KB Output is correct
119 Correct 1284 ms 307444 KB Output is correct
120 Correct 1020 ms 285216 KB Output is correct
121 Correct 1290 ms 306328 KB Output is correct
122 Correct 1130 ms 293336 KB Output is correct
123 Correct 1759 ms 322900 KB Output is correct
124 Correct 2227 ms 374708 KB Output is correct
125 Correct 1453 ms 310344 KB Output is correct
126 Correct 2578 ms 400912 KB Output is correct