Submission #782298

# Submission time Handle Problem Language Result Execution time Memory
782298 2023-07-13T19:06:37 Z FEDIKUS Radio Towers (IOI22_towers) C++17
100 / 100
1198 ms 85460 KB
#include "towers.h"

#include <bits/stdc++.h>

using namespace std;

using pii = pair<int,int>;
using mim = pair<pii,pii>;

const int maxn=1e5+10;
const int logg=18;

int n;
int h[maxn];
multiset<pii > res;
mim sparse[logg][maxn];
int klk;
int dovi[maxn];
int poz[maxn];
pair<int,int> najs[2][logg][maxn];
int staq[maxn];

mim comb(mim &a,mim &b){
  mim ret=a;
  ret.first=max(ret.first,b.first);
  ret.second=min(ret.second,b.second);
  return ret;
}

mim qry(int l,int r){
  mim ret={{h[l],l},{h[l],l}};
  for(int i=logg-1;i>=0;i--){
    if(r-(1<<i)+1>=l){
      ret=comb(ret,sparse[i][r]);
      r-=(1<<i);
    }
  }
  return ret;
}

void resi(int l,int r,multiset<pii > &ret,int naj=2e9+10){
  if(r<l) return;
  najs[0][0][l]=max(najs[0][0][l],{naj,l});
  najs[1][0][r]=max(najs[1][0][r],{naj,r});
  auto temp=qry(l,r);
  pii maxi=temp.first;
  pii mini=temp.second;
  multiset<pii> levi; multiset<pii> desni;
  resi(l,maxi.second-1,levi,maxi.first);
  resi(maxi.second+1,r,desni,maxi.first);
  if(levi.size()>desni.size()) swap(levi,desni);
  for(auto i:desni) levi.emplace(i);
  if(!levi.empty()){
    auto najv=--levi.end();
    int d=naj-mini.first;
    if((*najv).first<d){
        levi.erase(najv);
        levi.emplace(pii(d,mini.second));
    }
  }else{
    levi.emplace(pii(naj-mini.first,mini.second));
  }
  swap(ret,levi);
}

const int siz=4*maxn*logg+10;
int segtsiz=0;
pair<int,pii> segt[siz];
int segtl[siz];
int segtr[siz];

pair<int,pii> combseg(const pair<int,pii> a,const pair<int,pii> b){
	pair<int,pii> ret;
	ret.first=a.first+b.first;
	ret.second.first=max(a.second.first,b.second.first);
	ret.second.second=min(a.second.second,b.second.second);
	return ret;
}

int update(int t,int v,int ind,int l=0,int r=n-1){
  if(l==r){
		segt[segtsiz++]={1,{v,v}};
		return segtsiz-1;
	}
	int mid=l+(r-l)/2;
	int levi=segtl[ind];
	int desni=segtr[ind];
	if(t<=mid) levi=update(t,v,segtl[ind],l,mid);
	else desni=update(t,v,segtr[ind],mid+1,r);
	segt[segtsiz++]=combseg(segt[levi],segt[desni]);
	segtl[segtsiz-1]=levi;
	segtr[segtsiz-1]=desni;
	return segtsiz-1;
}

pair<int,pii> query(int tl,int tr,int ind,int l=0,int r=n-1){
	if(tl<=l && r<=tr) return segt[ind];
	int mid=l+(r-l)/2;
	if(tr<=mid) return query(tl,tr,segtl[ind],l,mid);
	if(tl>mid) return query(tl,tr,segtr[ind],mid+1,r);
	return combseg(query(tl,tr,segtl[ind],l,mid),query(tl,tr,segtr[ind],mid+1,r));
}

int build(int l=0,int r=n-1){
	if(l==r){
		segt[segtsiz++]={0,{-1,INT_MAX}};
		return segtsiz-1;
	}
	int mid=l+(r-l)/2;
	int levi=build(l,mid);
	int desni=build(mid+1,r);
	segt[segtsiz++]=combseg(segt[levi],segt[desni]);
	segtl[segtsiz-1]=levi;
	segtr[segtsiz-1]=desni;
	return segtsiz-1;
}

void init(int _n, vector<int> _h) {
  n=_n;
  for(int i=0;i<n;i++) najs[0][0][i]=najs[1][0][i]={-1,-1};
  for(int i=0;i<n;i++) h[i]=_h[i];

  for(int i=0;i<logg;i++){
    for(int j=0;j<n;j++){
      if(i==0) sparse[i][j]={{h[j],j},{h[j],j}};
      else if(j-(1<<(i-1))>=0) sparse[i][j]=comb(sparse[i-1][j],sparse[i-1][j-(1<<(i-1))]);
      else sparse[i][j]=sparse[i-1][j];
  	}
  }

  resi(0,n-1,res);

  for(int i=1;i<logg;i++){
    for(int j=0;j<n;j++){
      if(j-(1<<(i-1))>=0) najs[0][i][j]=max(najs[0][i-1][j],najs[0][i-1][j-(1<<(i-1))]);
      else najs[0][i][j]=najs[0][i-1][j];

      if(j-(1<<(i-1))>=0) najs[1][i][j]=max(najs[1][i-1][j],najs[1][i-1][j-(1<<(i-1))]);
      else najs[1][i][j]=najs[1][i-1][j];
    }
  }

	klk=0;
  for(auto i:res) {dovi[klk++]=i.first; poz[klk-1]=i.second;}
	staq[klk]=build();
  for(int i=klk-1;i>=0;i--){
		staq[i]=update(poz[i],poz[i],staq[i+1]);
	}
}

pii najupit(int l,int r,int koji){
  pii ret={-1,-1};
  for(int i=logg-1;i>=0;i--){
    if(r-(1<<i)+1>=l){
      ret=max(ret,najs[koji][i][r]);
      r-=(1<<i);
    }
  }
  return ret;
}

int max_towers(int l, int r, int d) {
	if(l==r) return 1;
	int koga=lower_bound(dovi,dovi+klk,d)-dovi;
	auto temp=query(l,r,staq[koga]);
  int ret=temp.first;
	int prvi=temp.second.second;
	int posl=temp.second.first;
	if(prvi==INT_MAX){
		prvi=r+1;
		posl=l-1;
	}

	// za levo
	if(prvi-1>=l){
		auto tmp=najupit(l,prvi-1,1);
		int koji=tmp.second;
		int naj=tmp.first;
		if(qry(l,koji).second.first<=naj-d) ret++;
	}
	// za desno
	if(posl+1<=r){
		auto tmp=najupit(posl+1,r,0);
		int koji=tmp.second;
		int naj=tmp.first;
		if(qry(koji,r).second.first<=naj-d) ret++;
	}
	if(ret==0) ret=1;
  return ret;
}
# Verdict Execution time Memory Grader output
1 Correct 474 ms 48584 KB Output is correct
2 Correct 964 ms 83864 KB Output is correct
3 Correct 1064 ms 84140 KB Output is correct
4 Correct 963 ms 85224 KB Output is correct
5 Correct 935 ms 85168 KB Output is correct
6 Correct 1032 ms 85048 KB Output is correct
7 Correct 921 ms 85244 KB Output is correct
8 Correct 0 ms 592 KB Output is correct
9 Correct 2 ms 2256 KB Output is correct
10 Correct 2 ms 2256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 848 KB Output is correct
2 Correct 2 ms 2000 KB Output is correct
3 Correct 2 ms 2000 KB Output is correct
4 Correct 2 ms 2128 KB Output is correct
5 Correct 2 ms 2128 KB Output is correct
6 Correct 2 ms 2128 KB Output is correct
7 Correct 2 ms 2128 KB Output is correct
8 Correct 2 ms 2256 KB Output is correct
9 Correct 2 ms 2256 KB Output is correct
10 Correct 2 ms 2128 KB Output is correct
11 Correct 3 ms 2256 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 2 ms 2256 KB Output is correct
14 Correct 2 ms 2256 KB Output is correct
15 Correct 2 ms 2000 KB Output is correct
16 Correct 3 ms 2128 KB Output is correct
17 Correct 2 ms 2128 KB Output is correct
18 Correct 2 ms 2256 KB Output is correct
19 Correct 2 ms 2128 KB Output is correct
20 Correct 2 ms 2000 KB Output is correct
21 Correct 3 ms 2128 KB Output is correct
22 Correct 2 ms 2128 KB Output is correct
23 Correct 2 ms 2256 KB Output is correct
24 Correct 2 ms 2128 KB Output is correct
25 Correct 1 ms 1232 KB Output is correct
26 Correct 2 ms 2000 KB Output is correct
27 Correct 2 ms 2000 KB Output is correct
28 Correct 4 ms 2128 KB Output is correct
29 Correct 2 ms 2128 KB Output is correct
30 Correct 3 ms 2128 KB Output is correct
31 Correct 2 ms 2128 KB Output is correct
32 Correct 2 ms 2256 KB Output is correct
33 Correct 2 ms 2276 KB Output is correct
34 Correct 2 ms 2128 KB Output is correct
35 Correct 2 ms 2256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 848 KB Output is correct
2 Correct 2 ms 2000 KB Output is correct
3 Correct 2 ms 2000 KB Output is correct
4 Correct 2 ms 2128 KB Output is correct
5 Correct 2 ms 2128 KB Output is correct
6 Correct 2 ms 2128 KB Output is correct
7 Correct 2 ms 2128 KB Output is correct
8 Correct 2 ms 2256 KB Output is correct
9 Correct 2 ms 2256 KB Output is correct
10 Correct 2 ms 2128 KB Output is correct
11 Correct 3 ms 2256 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 2 ms 2256 KB Output is correct
14 Correct 2 ms 2256 KB Output is correct
15 Correct 2 ms 2000 KB Output is correct
16 Correct 3 ms 2128 KB Output is correct
17 Correct 2 ms 2128 KB Output is correct
18 Correct 2 ms 2256 KB Output is correct
19 Correct 2 ms 2128 KB Output is correct
20 Correct 2 ms 2000 KB Output is correct
21 Correct 3 ms 2128 KB Output is correct
22 Correct 2 ms 2128 KB Output is correct
23 Correct 2 ms 2256 KB Output is correct
24 Correct 2 ms 2128 KB Output is correct
25 Correct 1 ms 1232 KB Output is correct
26 Correct 2 ms 2000 KB Output is correct
27 Correct 2 ms 2000 KB Output is correct
28 Correct 4 ms 2128 KB Output is correct
29 Correct 2 ms 2128 KB Output is correct
30 Correct 3 ms 2128 KB Output is correct
31 Correct 2 ms 2128 KB Output is correct
32 Correct 2 ms 2256 KB Output is correct
33 Correct 2 ms 2276 KB Output is correct
34 Correct 2 ms 2128 KB Output is correct
35 Correct 2 ms 2256 KB Output is correct
36 Correct 73 ms 49476 KB Output is correct
37 Correct 116 ms 76760 KB Output is correct
38 Correct 110 ms 76380 KB Output is correct
39 Correct 156 ms 83244 KB Output is correct
40 Correct 142 ms 83228 KB Output is correct
41 Correct 137 ms 83216 KB Output is correct
42 Correct 147 ms 83580 KB Output is correct
43 Correct 62 ms 85168 KB Output is correct
44 Correct 60 ms 85184 KB Output is correct
45 Correct 62 ms 78760 KB Output is correct
46 Correct 63 ms 76420 KB Output is correct
47 Correct 113 ms 76428 KB Output is correct
48 Correct 142 ms 84204 KB Output is correct
49 Correct 141 ms 83748 KB Output is correct
50 Correct 62 ms 85172 KB Output is correct
51 Correct 68 ms 84648 KB Output is correct
52 Correct 115 ms 76524 KB Output is correct
53 Correct 146 ms 83744 KB Output is correct
54 Correct 138 ms 83252 KB Output is correct
55 Correct 63 ms 85180 KB Output is correct
56 Correct 64 ms 83004 KB Output is correct
57 Correct 111 ms 73844 KB Output is correct
58 Correct 110 ms 76216 KB Output is correct
59 Correct 125 ms 76232 KB Output is correct
60 Correct 147 ms 83712 KB Output is correct
61 Correct 137 ms 83372 KB Output is correct
62 Correct 144 ms 83912 KB Output is correct
63 Correct 151 ms 83308 KB Output is correct
64 Correct 73 ms 85168 KB Output is correct
65 Correct 62 ms 85176 KB Output is correct
66 Correct 59 ms 76060 KB Output is correct
67 Correct 64 ms 83824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 806 ms 75708 KB Output is correct
2 Correct 949 ms 76352 KB Output is correct
3 Correct 1018 ms 76160 KB Output is correct
4 Correct 899 ms 84056 KB Output is correct
5 Correct 1046 ms 83336 KB Output is correct
6 Correct 1012 ms 84276 KB Output is correct
7 Correct 960 ms 83276 KB Output is correct
8 Correct 969 ms 85272 KB Output is correct
9 Correct 1031 ms 85192 KB Output is correct
10 Correct 1079 ms 79248 KB Output is correct
11 Correct 1117 ms 79288 KB Output is correct
12 Correct 940 ms 85056 KB Output is correct
13 Correct 1099 ms 85180 KB Output is correct
14 Correct 0 ms 592 KB Output is correct
15 Correct 1 ms 2256 KB Output is correct
16 Correct 2 ms 2328 KB Output is correct
17 Correct 116 ms 76456 KB Output is correct
18 Correct 169 ms 84152 KB Output is correct
19 Correct 143 ms 83632 KB Output is correct
20 Correct 62 ms 85140 KB Output is correct
21 Correct 68 ms 84696 KB Output is correct
22 Correct 124 ms 76488 KB Output is correct
23 Correct 145 ms 83788 KB Output is correct
24 Correct 144 ms 83260 KB Output is correct
25 Correct 66 ms 85460 KB Output is correct
26 Correct 66 ms 83032 KB Output is correct
27 Correct 2 ms 2000 KB Output is correct
28 Correct 3 ms 2128 KB Output is correct
29 Correct 2 ms 2108 KB Output is correct
30 Correct 2 ms 2256 KB Output is correct
31 Correct 2 ms 2128 KB Output is correct
32 Correct 2 ms 2000 KB Output is correct
33 Correct 3 ms 2128 KB Output is correct
34 Correct 3 ms 2128 KB Output is correct
35 Correct 2 ms 2256 KB Output is correct
36 Correct 2 ms 2128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 294 ms 18568 KB Output is correct
2 Correct 882 ms 76796 KB Output is correct
3 Correct 763 ms 76368 KB Output is correct
4 Correct 857 ms 83996 KB Output is correct
5 Correct 1053 ms 83276 KB Output is correct
6 Correct 870 ms 83268 KB Output is correct
7 Correct 961 ms 83632 KB Output is correct
8 Correct 711 ms 85236 KB Output is correct
9 Correct 674 ms 85164 KB Output is correct
10 Correct 696 ms 75848 KB Output is correct
11 Correct 816 ms 77648 KB Output is correct
12 Correct 134 ms 76508 KB Output is correct
13 Correct 144 ms 83692 KB Output is correct
14 Correct 145 ms 83412 KB Output is correct
15 Correct 65 ms 85208 KB Output is correct
16 Correct 64 ms 83036 KB Output is correct
17 Correct 107 ms 73844 KB Output is correct
18 Correct 128 ms 76256 KB Output is correct
19 Correct 135 ms 76332 KB Output is correct
20 Correct 143 ms 83784 KB Output is correct
21 Correct 151 ms 83324 KB Output is correct
22 Correct 155 ms 84128 KB Output is correct
23 Correct 142 ms 83292 KB Output is correct
24 Correct 62 ms 85328 KB Output is correct
25 Correct 67 ms 85232 KB Output is correct
26 Correct 62 ms 76112 KB Output is correct
27 Correct 68 ms 83768 KB Output is correct
28 Correct 2 ms 2000 KB Output is correct
29 Correct 2 ms 2128 KB Output is correct
30 Correct 2 ms 2128 KB Output is correct
31 Correct 2 ms 2256 KB Output is correct
32 Correct 2 ms 2128 KB Output is correct
33 Correct 1 ms 1232 KB Output is correct
34 Correct 2 ms 2084 KB Output is correct
35 Correct 2 ms 2000 KB Output is correct
36 Correct 3 ms 2128 KB Output is correct
37 Correct 3 ms 2128 KB Output is correct
38 Correct 3 ms 2128 KB Output is correct
39 Correct 2 ms 2128 KB Output is correct
40 Correct 2 ms 2256 KB Output is correct
41 Correct 2 ms 2256 KB Output is correct
42 Correct 2 ms 2128 KB Output is correct
43 Correct 2 ms 2256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 848 KB Output is correct
2 Correct 2 ms 2000 KB Output is correct
3 Correct 2 ms 2000 KB Output is correct
4 Correct 2 ms 2128 KB Output is correct
5 Correct 2 ms 2128 KB Output is correct
6 Correct 2 ms 2128 KB Output is correct
7 Correct 2 ms 2128 KB Output is correct
8 Correct 2 ms 2256 KB Output is correct
9 Correct 2 ms 2256 KB Output is correct
10 Correct 2 ms 2128 KB Output is correct
11 Correct 3 ms 2256 KB Output is correct
12 Correct 1 ms 592 KB Output is correct
13 Correct 2 ms 2256 KB Output is correct
14 Correct 2 ms 2256 KB Output is correct
15 Correct 2 ms 2000 KB Output is correct
16 Correct 3 ms 2128 KB Output is correct
17 Correct 2 ms 2128 KB Output is correct
18 Correct 2 ms 2256 KB Output is correct
19 Correct 2 ms 2128 KB Output is correct
20 Correct 2 ms 2000 KB Output is correct
21 Correct 3 ms 2128 KB Output is correct
22 Correct 2 ms 2128 KB Output is correct
23 Correct 2 ms 2256 KB Output is correct
24 Correct 2 ms 2128 KB Output is correct
25 Correct 1 ms 1232 KB Output is correct
26 Correct 2 ms 2000 KB Output is correct
27 Correct 2 ms 2000 KB Output is correct
28 Correct 4 ms 2128 KB Output is correct
29 Correct 2 ms 2128 KB Output is correct
30 Correct 3 ms 2128 KB Output is correct
31 Correct 2 ms 2128 KB Output is correct
32 Correct 2 ms 2256 KB Output is correct
33 Correct 2 ms 2276 KB Output is correct
34 Correct 2 ms 2128 KB Output is correct
35 Correct 2 ms 2256 KB Output is correct
36 Correct 73 ms 49476 KB Output is correct
37 Correct 116 ms 76760 KB Output is correct
38 Correct 110 ms 76380 KB Output is correct
39 Correct 156 ms 83244 KB Output is correct
40 Correct 142 ms 83228 KB Output is correct
41 Correct 137 ms 83216 KB Output is correct
42 Correct 147 ms 83580 KB Output is correct
43 Correct 62 ms 85168 KB Output is correct
44 Correct 60 ms 85184 KB Output is correct
45 Correct 62 ms 78760 KB Output is correct
46 Correct 63 ms 76420 KB Output is correct
47 Correct 113 ms 76428 KB Output is correct
48 Correct 142 ms 84204 KB Output is correct
49 Correct 141 ms 83748 KB Output is correct
50 Correct 62 ms 85172 KB Output is correct
51 Correct 68 ms 84648 KB Output is correct
52 Correct 115 ms 76524 KB Output is correct
53 Correct 146 ms 83744 KB Output is correct
54 Correct 138 ms 83252 KB Output is correct
55 Correct 63 ms 85180 KB Output is correct
56 Correct 64 ms 83004 KB Output is correct
57 Correct 111 ms 73844 KB Output is correct
58 Correct 110 ms 76216 KB Output is correct
59 Correct 125 ms 76232 KB Output is correct
60 Correct 147 ms 83712 KB Output is correct
61 Correct 137 ms 83372 KB Output is correct
62 Correct 144 ms 83912 KB Output is correct
63 Correct 151 ms 83308 KB Output is correct
64 Correct 73 ms 85168 KB Output is correct
65 Correct 62 ms 85176 KB Output is correct
66 Correct 59 ms 76060 KB Output is correct
67 Correct 64 ms 83824 KB Output is correct
68 Correct 806 ms 75708 KB Output is correct
69 Correct 949 ms 76352 KB Output is correct
70 Correct 1018 ms 76160 KB Output is correct
71 Correct 899 ms 84056 KB Output is correct
72 Correct 1046 ms 83336 KB Output is correct
73 Correct 1012 ms 84276 KB Output is correct
74 Correct 960 ms 83276 KB Output is correct
75 Correct 969 ms 85272 KB Output is correct
76 Correct 1031 ms 85192 KB Output is correct
77 Correct 1079 ms 79248 KB Output is correct
78 Correct 1117 ms 79288 KB Output is correct
79 Correct 940 ms 85056 KB Output is correct
80 Correct 1099 ms 85180 KB Output is correct
81 Correct 0 ms 592 KB Output is correct
82 Correct 1 ms 2256 KB Output is correct
83 Correct 2 ms 2328 KB Output is correct
84 Correct 116 ms 76456 KB Output is correct
85 Correct 169 ms 84152 KB Output is correct
86 Correct 143 ms 83632 KB Output is correct
87 Correct 62 ms 85140 KB Output is correct
88 Correct 68 ms 84696 KB Output is correct
89 Correct 124 ms 76488 KB Output is correct
90 Correct 145 ms 83788 KB Output is correct
91 Correct 144 ms 83260 KB Output is correct
92 Correct 66 ms 85460 KB Output is correct
93 Correct 66 ms 83032 KB Output is correct
94 Correct 2 ms 2000 KB Output is correct
95 Correct 3 ms 2128 KB Output is correct
96 Correct 2 ms 2108 KB Output is correct
97 Correct 2 ms 2256 KB Output is correct
98 Correct 2 ms 2128 KB Output is correct
99 Correct 2 ms 2000 KB Output is correct
100 Correct 3 ms 2128 KB Output is correct
101 Correct 3 ms 2128 KB Output is correct
102 Correct 2 ms 2256 KB Output is correct
103 Correct 2 ms 2128 KB Output is correct
104 Correct 850 ms 67720 KB Output is correct
105 Correct 940 ms 76368 KB Output is correct
106 Correct 801 ms 76344 KB Output is correct
107 Correct 1168 ms 83944 KB Output is correct
108 Correct 1087 ms 83744 KB Output is correct
109 Correct 1031 ms 83472 KB Output is correct
110 Correct 899 ms 83784 KB Output is correct
111 Correct 969 ms 85192 KB Output is correct
112 Correct 891 ms 85188 KB Output is correct
113 Correct 918 ms 80288 KB Output is correct
114 Correct 935 ms 72672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 474 ms 48584 KB Output is correct
2 Correct 964 ms 83864 KB Output is correct
3 Correct 1064 ms 84140 KB Output is correct
4 Correct 963 ms 85224 KB Output is correct
5 Correct 935 ms 85168 KB Output is correct
6 Correct 1032 ms 85048 KB Output is correct
7 Correct 921 ms 85244 KB Output is correct
8 Correct 0 ms 592 KB Output is correct
9 Correct 2 ms 2256 KB Output is correct
10 Correct 2 ms 2256 KB Output is correct
11 Correct 1 ms 848 KB Output is correct
12 Correct 2 ms 2000 KB Output is correct
13 Correct 2 ms 2000 KB Output is correct
14 Correct 2 ms 2128 KB Output is correct
15 Correct 2 ms 2128 KB Output is correct
16 Correct 2 ms 2128 KB Output is correct
17 Correct 2 ms 2128 KB Output is correct
18 Correct 2 ms 2256 KB Output is correct
19 Correct 2 ms 2256 KB Output is correct
20 Correct 2 ms 2128 KB Output is correct
21 Correct 3 ms 2256 KB Output is correct
22 Correct 1 ms 592 KB Output is correct
23 Correct 2 ms 2256 KB Output is correct
24 Correct 2 ms 2256 KB Output is correct
25 Correct 2 ms 2000 KB Output is correct
26 Correct 3 ms 2128 KB Output is correct
27 Correct 2 ms 2128 KB Output is correct
28 Correct 2 ms 2256 KB Output is correct
29 Correct 2 ms 2128 KB Output is correct
30 Correct 2 ms 2000 KB Output is correct
31 Correct 3 ms 2128 KB Output is correct
32 Correct 2 ms 2128 KB Output is correct
33 Correct 2 ms 2256 KB Output is correct
34 Correct 2 ms 2128 KB Output is correct
35 Correct 1 ms 1232 KB Output is correct
36 Correct 2 ms 2000 KB Output is correct
37 Correct 2 ms 2000 KB Output is correct
38 Correct 4 ms 2128 KB Output is correct
39 Correct 2 ms 2128 KB Output is correct
40 Correct 3 ms 2128 KB Output is correct
41 Correct 2 ms 2128 KB Output is correct
42 Correct 2 ms 2256 KB Output is correct
43 Correct 2 ms 2276 KB Output is correct
44 Correct 2 ms 2128 KB Output is correct
45 Correct 2 ms 2256 KB Output is correct
46 Correct 73 ms 49476 KB Output is correct
47 Correct 116 ms 76760 KB Output is correct
48 Correct 110 ms 76380 KB Output is correct
49 Correct 156 ms 83244 KB Output is correct
50 Correct 142 ms 83228 KB Output is correct
51 Correct 137 ms 83216 KB Output is correct
52 Correct 147 ms 83580 KB Output is correct
53 Correct 62 ms 85168 KB Output is correct
54 Correct 60 ms 85184 KB Output is correct
55 Correct 62 ms 78760 KB Output is correct
56 Correct 63 ms 76420 KB Output is correct
57 Correct 113 ms 76428 KB Output is correct
58 Correct 142 ms 84204 KB Output is correct
59 Correct 141 ms 83748 KB Output is correct
60 Correct 62 ms 85172 KB Output is correct
61 Correct 68 ms 84648 KB Output is correct
62 Correct 115 ms 76524 KB Output is correct
63 Correct 146 ms 83744 KB Output is correct
64 Correct 138 ms 83252 KB Output is correct
65 Correct 63 ms 85180 KB Output is correct
66 Correct 64 ms 83004 KB Output is correct
67 Correct 111 ms 73844 KB Output is correct
68 Correct 110 ms 76216 KB Output is correct
69 Correct 125 ms 76232 KB Output is correct
70 Correct 147 ms 83712 KB Output is correct
71 Correct 137 ms 83372 KB Output is correct
72 Correct 144 ms 83912 KB Output is correct
73 Correct 151 ms 83308 KB Output is correct
74 Correct 73 ms 85168 KB Output is correct
75 Correct 62 ms 85176 KB Output is correct
76 Correct 59 ms 76060 KB Output is correct
77 Correct 64 ms 83824 KB Output is correct
78 Correct 806 ms 75708 KB Output is correct
79 Correct 949 ms 76352 KB Output is correct
80 Correct 1018 ms 76160 KB Output is correct
81 Correct 899 ms 84056 KB Output is correct
82 Correct 1046 ms 83336 KB Output is correct
83 Correct 1012 ms 84276 KB Output is correct
84 Correct 960 ms 83276 KB Output is correct
85 Correct 969 ms 85272 KB Output is correct
86 Correct 1031 ms 85192 KB Output is correct
87 Correct 1079 ms 79248 KB Output is correct
88 Correct 1117 ms 79288 KB Output is correct
89 Correct 940 ms 85056 KB Output is correct
90 Correct 1099 ms 85180 KB Output is correct
91 Correct 0 ms 592 KB Output is correct
92 Correct 1 ms 2256 KB Output is correct
93 Correct 2 ms 2328 KB Output is correct
94 Correct 116 ms 76456 KB Output is correct
95 Correct 169 ms 84152 KB Output is correct
96 Correct 143 ms 83632 KB Output is correct
97 Correct 62 ms 85140 KB Output is correct
98 Correct 68 ms 84696 KB Output is correct
99 Correct 124 ms 76488 KB Output is correct
100 Correct 145 ms 83788 KB Output is correct
101 Correct 144 ms 83260 KB Output is correct
102 Correct 66 ms 85460 KB Output is correct
103 Correct 66 ms 83032 KB Output is correct
104 Correct 2 ms 2000 KB Output is correct
105 Correct 3 ms 2128 KB Output is correct
106 Correct 2 ms 2108 KB Output is correct
107 Correct 2 ms 2256 KB Output is correct
108 Correct 2 ms 2128 KB Output is correct
109 Correct 2 ms 2000 KB Output is correct
110 Correct 3 ms 2128 KB Output is correct
111 Correct 3 ms 2128 KB Output is correct
112 Correct 2 ms 2256 KB Output is correct
113 Correct 2 ms 2128 KB Output is correct
114 Correct 294 ms 18568 KB Output is correct
115 Correct 882 ms 76796 KB Output is correct
116 Correct 763 ms 76368 KB Output is correct
117 Correct 857 ms 83996 KB Output is correct
118 Correct 1053 ms 83276 KB Output is correct
119 Correct 870 ms 83268 KB Output is correct
120 Correct 961 ms 83632 KB Output is correct
121 Correct 711 ms 85236 KB Output is correct
122 Correct 674 ms 85164 KB Output is correct
123 Correct 696 ms 75848 KB Output is correct
124 Correct 816 ms 77648 KB Output is correct
125 Correct 134 ms 76508 KB Output is correct
126 Correct 144 ms 83692 KB Output is correct
127 Correct 145 ms 83412 KB Output is correct
128 Correct 65 ms 85208 KB Output is correct
129 Correct 64 ms 83036 KB Output is correct
130 Correct 107 ms 73844 KB Output is correct
131 Correct 128 ms 76256 KB Output is correct
132 Correct 135 ms 76332 KB Output is correct
133 Correct 143 ms 83784 KB Output is correct
134 Correct 151 ms 83324 KB Output is correct
135 Correct 155 ms 84128 KB Output is correct
136 Correct 142 ms 83292 KB Output is correct
137 Correct 62 ms 85328 KB Output is correct
138 Correct 67 ms 85232 KB Output is correct
139 Correct 62 ms 76112 KB Output is correct
140 Correct 68 ms 83768 KB Output is correct
141 Correct 2 ms 2000 KB Output is correct
142 Correct 2 ms 2128 KB Output is correct
143 Correct 2 ms 2128 KB Output is correct
144 Correct 2 ms 2256 KB Output is correct
145 Correct 2 ms 2128 KB Output is correct
146 Correct 1 ms 1232 KB Output is correct
147 Correct 2 ms 2084 KB Output is correct
148 Correct 2 ms 2000 KB Output is correct
149 Correct 3 ms 2128 KB Output is correct
150 Correct 3 ms 2128 KB Output is correct
151 Correct 3 ms 2128 KB Output is correct
152 Correct 2 ms 2128 KB Output is correct
153 Correct 2 ms 2256 KB Output is correct
154 Correct 2 ms 2256 KB Output is correct
155 Correct 2 ms 2128 KB Output is correct
156 Correct 2 ms 2256 KB Output is correct
157 Correct 850 ms 67720 KB Output is correct
158 Correct 940 ms 76368 KB Output is correct
159 Correct 801 ms 76344 KB Output is correct
160 Correct 1168 ms 83944 KB Output is correct
161 Correct 1087 ms 83744 KB Output is correct
162 Correct 1031 ms 83472 KB Output is correct
163 Correct 899 ms 83784 KB Output is correct
164 Correct 969 ms 85192 KB Output is correct
165 Correct 891 ms 85188 KB Output is correct
166 Correct 918 ms 80288 KB Output is correct
167 Correct 935 ms 72672 KB Output is correct
168 Correct 1 ms 592 KB Output is correct
169 Correct 603 ms 26548 KB Output is correct
170 Correct 998 ms 76084 KB Output is correct
171 Correct 1128 ms 76676 KB Output is correct
172 Correct 1018 ms 83400 KB Output is correct
173 Correct 1198 ms 83908 KB Output is correct
174 Correct 1147 ms 83376 KB Output is correct
175 Correct 1127 ms 84160 KB Output is correct
176 Correct 949 ms 85148 KB Output is correct
177 Correct 940 ms 85248 KB Output is correct
178 Correct 1056 ms 76656 KB Output is correct
179 Correct 862 ms 84304 KB Output is correct