QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#523224#8904. Рекорды и антирекордыacwing_gza43 256ms76220kbC++142.2kb2024-08-17 23:03:512024-08-17 23:03:52

Judging History

This is the latest submission verdict.

  • [2024-08-17 23:03:52]
  • Judged
  • Verdict: 43
  • Time: 256ms
  • Memory: 76220kb
  • [2024-08-17 23:03:51]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
namespace gza{
	#define int long long
	#define pb push_back
	#define MT int TTT=R;while(TTT--)
	#define pc putchar
	#define R read()
	#define fo(i,a,b) for(int i=a;i<=b;i++)
	#define rep(i,a,b) for(int i=a;i>=b;i--)
	#define m1(a,b) memset(a,b,sizeof a)
	namespace IO
	{
		inline int read()
		{
		    int x=0;
		    char ch=getchar();
		    bool f=0;
		    while(!isdigit(ch)){if(ch=='-') f=1;ch=getchar();}
		    while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
		    if(f) x=-x;
		    return x;    
		}
		template<typename T> inline void write(T x)
		{
		    if(x<0) pc('-'),x=-x;
		    if(x>9) write(x/10);
		    pc(x%10+'0');
		}
	};
	namespace math
	{
		inline int gcd(int a,int b)
		{
			int az=__builtin_ctz(a),bz=__builtin_ctz(b),z=(az>bz)?bz:az,t;
		    b>>=bz;
		    while(a) a>>=az,t=a-b,b=a,az=__builtin_ctz(t<0?-t:t),a=t<0?-t:t;
		    return b<<z;
		}
		inline int qmi(int a,int b,int p)
		{
			int res=1;
			while(b)
			{
				if(b&1) res=res*a%p;
				a=a*a%p;
				b>>=1;
			}
			return res;
		}
		const int MAXN=2e6+10;
		int my_fac[MAXN],my_inv[MAXN];
		void init_binom(int mod)
		{
			my_fac[0]=1;fo(i,1,min(MAXN,mod)-1) my_fac[i]=my_fac[i-1]*i%mod;
			my_inv[min(MAXN,mod)-1]=qmi(my_fac[min(MAXN,mod)-1],mod-2,mod);rep(i,min(MAXN,mod)-2,0) my_inv[i]=my_inv[i+1]*(i+1)%mod;
		}
		int binom(int a,int b,int mod)
		{
			return my_fac[a]*my_inv[b]%mod*my_inv[a-b]%mod;
		}
	};
	using namespace IO;
	using namespace math;
	
	const int N=210;
	int n;
	int a[N];
	int f[N][N][N];
	void chkmax(int& x,int y){if(y>x) x=y;}
	void solve()
	{
		n=R;
		fo(i,1,n) a[i]=R;
		fo(i,0,n) fo(j,0,n) fo(k,1,n+1) f[i][j][k]=-2e9;
		f[0][0][n+1]=0;
		fo(i,0,n-1) fo(j,0,n) fo(k,1,n+1)
		{
			if(a[i+1]<=j||a[i+1]>=k) chkmax(f[i+1][j][k],f[i][j][k]);
			if(a[i+1]>j) chkmax(f[i+1][a[i+1]][k],f[i][j][k]+1);
			if(a[i+1]<k) chkmax(f[i+1][j][a[i+1]],f[i][j][k]+1);
		}
		// if(n==3) cout<<"look: "<<f[1][1][n+1]<<endl;
		int ans=-2e9;
		fo(i,0,n) fo(j,1,n+1) ans=max(ans,f[n][i][j]);
		write(ans),puts("");
	}
	void main(){
		MT solve();
	}
}
signed main(){
	
	gza::main();
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 21
Accepted

Test #1:

score: 21
Accepted
time: 1ms
memory: 7708kb

input:

120
5
3 1 4 2 5
5
3 4 2 5 1
5
5 4 2 1 3
5
1 2 5 4 3
5
2 4 3 1 5
5
3 1 5 2 4
5
1 4 2 3 5
5
5 1 4 3 2
5
1 5 3 2 4
5
3 1 2 5 4
5
3 1 5 4 2
5
1 2 3 4 5
5
1 5 2 4 3
5
3 5 2 1 4
5
2 1 5 4 3
5
1 5 3 4 2
5
3 1 4 5 2
5
2 1 4 5 3
5
1 3 5 4 2
5
5 3 4 2 1
5
2 1 3 5 4
5
2 3 1 5 4
5
2 4 3 5 1
5
4 3 2 5 1
5
4 5 2 ...

output:

5
5
5
5
5
4
5
5
5
4
4
5
5
5
4
5
5
4
5
5
4
4
5
5
4
5
4
5
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
4
5
5
4
5
5
5
4
5
5
5
5
4
5
5
5
5
5
5
4
5
5
5
5
5
5
4
5
4
5
5
5
5
4
5
5
4
5
4
5
4
5
5
4
4
4
4
5
5
4
4
5
5
5
4
5
4
5
5
5
4
5
4
5
5
4
4
5
5
5
4
5
5
5
5

result:

ok 120 numbers

Test #2:

score: 21
Accepted
time: 0ms
memory: 11876kb

input:

120
16
11 8 4 12 3 6 10 9 7 15 14 2 16 5 1 13
16
9 1 13 14 3 7 5 15 4 11 2 12 8 6 16 10
16
3 12 11 10 5 13 4 8 9 2 7 16 6 14 15 1
16
9 4 7 2 3 8 1 13 5 12 16 14 11 10 6 15
16
14 5 11 10 6 12 7 9 1 16 15 3 4 8 13 2
16
3 13 16 10 5 11 8 4 15 2 9 7 14 1 6 12
16
4 16 7 11 15 5 9 14 8 13 6 3 1 2 12 10
16...

output:

10
10
12
9
11
10
11
12
10
11
9
10
10
9
12
11
12
10
9
10
10
8
11
10
10
11
11
11
9
11
9
10
11
11
11
12
11
10
13
11
11
11
11
10
10
12
10
10
11
9
10
11
10
11
11
12
12
10
11
11
11
10
9
10
12
10
12
11
11
10
11
11
9
11
11
9
11
11
11
11
10
10
11
11
10
10
12
10
8
12
13
10
9
12
11
10
11
11
11
13
11
10
9
10
11...

result:

ok 120 numbers

Test #3:

score: 21
Accepted
time: 3ms
memory: 11960kb

input:

120
16
10 7 5 9 12 6 3 1 13 15 2 8 11 16 14 4
13
11 1 10 8 7 9 5 4 6 2 13 3 12
14
2 5 10 12 13 14 6 7 1 3 9 4 8 11
9
7 9 8 6 2 5 4 3 1
11
9 8 1 6 7 4 3 2 11 5 10
12
12 1 3 7 11 5 9 8 6 2 4 10
12
10 8 2 6 4 1 3 5 12 11 7 9
14
9 3 12 10 13 4 5 14 11 7 6 8 1 2
16
1 15 10 3 6 5 4 14 2 9 8 7 11 13 16 12
...

output:

11
10
9
8
9
10
10
9
12
7
11
10
9
9
8
8
6
7
5
7
7
6
5
8
5
9
9
6
8
9
7
9
11
7
8
9
7
10
6
8
7
8
9
8
9
10
7
6
7
8
7
7
7
9
9
12
7
8
8
10
9
9
6
12
7
8
6
12
8
8
6
6
6
8
8
6
6
7
6
11
11
10
7
9
12
10
8
7
5
7
8
10
11
5
10
8
8
7
8
7
5
5
11
6
12
5
6
10
5
7
10
6
10
7
9
9
8
10
8
9

result:

ok 120 numbers

Test #4:

score: 21
Accepted
time: 3ms
memory: 9976kb

input:

120
14
4 12 10 13 8 1 6 14 11 9 7 5 2 3
11
9 11 5 4 3 1 2 8 7 10 6
12
10 6 4 2 12 11 9 3 7 8 1 5
13
10 2 6 12 11 5 9 7 13 3 8 1 4
12
6 2 8 11 1 7 4 3 9 5 12 10
11
6 10 2 11 4 9 1 8 3 5 7
15
11 5 6 1 2 13 12 4 15 7 10 8 9 3 14
12
3 9 1 5 10 2 4 12 8 6 11 7
11
10 2 8 7 9 4 3 11 6 1 5
13
4 2 9 12 7 3 1...

output:

10
8
8
9
8
7
10
7
9
9
8
9
9
8
9
11
7
8
11
8
9
10
11
10
9
9
10
6
13
10
10
6
6
8
10
8
9
8
7
8
7
11
8
9
8
9
12
10
9
7
12
8
10
7
11
10
7
10
9
12
8
10
8
10
8
7
10
8
10
9
9
9
8
10
7
9
10
8
12
7
8
8
7
8
11
9
9
8
10
10
11
9
9
8
10
9
7
9
9
11
12
8
9
11
10
11
8
9
9
8
11
9
8
12
9
10
8
10
8
8

result:

ok 120 numbers

Test #5:

score: 21
Accepted
time: 1ms
memory: 7848kb

input:

32
4
1 4 3 2
4
4 1 3 2
4
4 3 2 1
4
1 3 2 4
4
1 2 3 4
4
3 4 2 1
3
1 2 3
4
1 3 4 2
4
3 1 4 2
2
2 1
4
2 4 1 3
4
2 1 4 3
3
2 3 1
4
3 2 4 1
4
2 3 1 4
4
4 1 2 3
4
1 4 2 3
4
4 2 1 3
4
2 1 3 4
4
3 1 2 4
4
2 4 3 1
2
1 2
4
3 2 1 4
4
4 2 3 1
3
3 1 2
3
3 2 1
4
4 3 1 2
4
2 3 4 1
4
3 4 1 2
4
1 2 4 3
3
1 3 2
3
2 1 3

output:

4
4
4
4
4
4
3
4
4
2
4
3
3
4
4
4
4
4
4
4
4
2
4
4
3
3
4
4
3
4
3
3

result:

ok 32 numbers

Test #6:

score: 21
Accepted
time: 2ms
memory: 9856kb

input:

120
16
16 1 14 12 7 2 6 8 9 10 11 13 15 5 4 3
16
3 5 16 7 12 15 9 4 6 8 10 2 11 13 14 1
15
1 15 2 5 14 3 13 12 11 10 9 8 7 6 4
11
11 9 3 6 2 4 8 7 10 5 1
15
15 2 3 11 12 10 7 5 6 4 8 13 1 9 14
14
3 4 13 6 14 5 10 12 9 11 8 7 2 1
13
1 3 10 13 9 12 11 8 7 6 4 5 2
13
3 13 12 10 8 4 9 7 5 6 11 2 1
13
2 ...

output:

16
14
14
9
13
12
11
12
11
10
15
11
11
16
15
11
10
12
14
13
10
12
11
8
10
14
10
13
14
13
12
10
9
11
12
10
10
11
15
14
13
13
9
10
10
16
15
10
12
11
12
15
8
13
13
11
12
13
9
16
11
11
15
11
12
9
15
16
14
10
14
10
16
15
15
13
12
11
15
10
16
11
10
11
14
9
13
13
16
14
12
11
11
16
11
15
14
14
14
12
16
14
15...

result:

ok 120 numbers

Test #7:

score: 21
Accepted
time: 0ms
memory: 11888kb

input:

120
10
9 5 8 10 7 6 4 3 2 1
15
2 14 11 3 7 8 6 9 10 12 5 13 15 4 1
12
4 5 12 11 8 7 6 9 3 2 1 10
10
10 5 8 9 7 6 4 3 2 1
12
10 2 9 6 4 3 5 7 8 12 11 1
15
2 15 12 13 3 11 7 14 10 9 8 6 5 4 1
14
13 12 11 10 8 7 6 5 4 14 9 3 1 2
10
4 6 1 5 7 8 3 9 10 2
16
15 13 1 8 2 5 3 4 6 7 9 10 11 12 14 16
14
14 1 ...

output:

10
15
12
10
11
14
12
9
16
13
12
15
9
12
11
12
16
13
10
16
15
10
12
13
11
11
16
10
16
10
13
13
12
12
14
13
12
12
13
14
15
10
10
9
11
12
12
12
10
15
8
16
12
10
16
12
10
12
15
11
14
12
13
15
15
16
13
16
14
11
11
14
12
12
10
11
11
13
9
11
12
10
16
14
9
14
12
11
11
16
14
10
11
11
16
11
10
15
10
11
10
15
...

result:

ok 120 numbers

Test #8:

score: 21
Accepted
time: 3ms
memory: 11888kb

input:

120
16
4 8 13 14 16 15 12 11 10 9 7 5 6 3 2 1
16
1 3 5 15 10 14 12 6 9 8 7 11 4 13 2 16
16
4 15 10 8 14 11 12 16 9 13 7 6 5 3 2 1
16
15 12 1 10 8 2 9 3 7 6 13 11 14 16 5 4
16
4 16 1 5 11 12 10 13 9 8 14 15 7 6 3 2
16
5 6 7 15 14 12 11 13 10 16 9 8 4 3 2 1
16
2 5 7 8 12 10 13 11 14 15 16 9 6 4 1 3
16...

output:

15
15
14
14
15
16
15
15
16
16
16
16
16
16
16
15
15
16
14
16
16
15
16
15
14
15
16
16
15
15
15
15
15
16
16
16
15
15
15
16
16
16
15
16
16
14
15
15
16
14
16
14
12
14
16
15
16
15
16
14
16
16
16
16
16
14
15
16
14
16
16
15
15
16
14
14
14
15
15
14
15
16
16
16
15
16
15
16
16
16
15
14
16
15
16
16
15
16
15
14
...

result:

ok 120 numbers

Test #9:

score: 21
Accepted
time: 0ms
memory: 11928kb

input:

120
6
6 5 4 3 2 1
4
4 3 2 1
14
14 13 12 11 10 9 8 7 6 5 4 3 2 1
15
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
8
1 2 3 4 5 6 7 8
8
1 2 3 4 5 6 7 8
7
1 2 3 4 5 6 7
5
1 2 3 4 5
12
12 11 10 9 8 7 6 5 4 3 2 1
10
10 9 8 7 6 5 4 3 2 1
16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
13
1 2 3 4 5 6 7 8 9 10 11 12 13
8
8 ...

output:

6
4
14
15
8
8
7
5
12
10
16
13
8
7
8
13
15
4
10
8
11
7
12
14
16
8
8
8
5
15
7
15
9
5
2
16
3
6
9
2
6
12
4
4
9
13
3
10
10
4
14
9
4
7
14
4
7
10
15
7
8
12
9
4
7
7
16
12
10
6
7
15
2
5
12
13
6
14
5
10
16
8
3
16
8
3
11
5
12
16
6
3
2
4
16
6
7
4
13
15
8
10
2
7
12
4
14
11
11
12
11
5
16
12
8
9
9
4
9
11

result:

ok 120 numbers

Test #10:

score: 21
Accepted
time: 3ms
memory: 11868kb

input:

120
16
2 14 8 7 16 11 9 15 1 5 10 4 6 12 13 3
16
14 16 5 13 9 10 15 7 4 8 1 12 2 6 11 3
16
15 14 11 12 13 9 10 7 8 3 4 16 5 6 2 1
16
3 16 14 5 15 12 10 2 4 11 6 7 9 1 8 13
16
1 13 2 14 6 15 3 7 16 11 9 5 8 12 10 4
16
16 2 12 14 11 13 9 10 5 6 8 7 1 3 15 4
16
8 2 6 16 15 5 1 13 10 7 12 4 14 3 11 9
16...

output:

11
9
11
12
11
11
10
14
11
10
13
10
11
11
10
11
10
11
11
11
11
9
13
11
11
10
11
10
12
10
11
10
10
11
11
11
10
10
12
10
11
11
11
12
9
12
12
11
12
12
12
12
11
10
10
12
12
10
10
11
12
14
10
12
13
11
12
11
12
10
11
11
11
12
10
11
12
12
12
9
9
12
11
12
11
13
12
11
12
12
11
11
12
10
14
10
11
13
10
12
12
12...

result:

ok 120 numbers

Subtask #2:

score: 22
Accepted

Dependency #1:

100%
Accepted

Test #11:

score: 22
Accepted
time: 165ms
memory: 75048kb

input:

10
200
143 118 102 41 39 3 167 56 189 32 139 175 16 135 145 160 147 68 14 33 161 96 9 11 137 158 25 19 120 184 34 128 28 187 164 75 106 47 151 194 49 141 59 179 72 20 36 154 134 123 73 193 80 17 133 186 53 2 185 196 107 48 74 63 55 79 61 168 104 31 183 42 117 87 144 171 172 76 77 30 112 180 84 8 119...

output:

42
39
43
39
41
39
39
42
39
43

result:

ok 10 numbers

Test #12:

score: 22
Accepted
time: 170ms
memory: 74808kb

input:

10
199
187 117 118 194 126 44 35 40 111 162 85 155 106 12 109 191 170 60 138 159 128 82 174 80 176 57 88 11 16 141 185 46 59 181 102 87 52 148 157 151 121 56 99 67 115 193 101 133 39 81 145 140 34 183 107 38 139 152 76 165 136 71 2 127 25 61 14 172 137 73 83 153 19 166 77 15 129 130 160 4 42 36 122 ...

output:

39
40
37
44
39
43
36
40
44
40

result:

ok 10 numbers

Test #13:

score: 22
Accepted
time: 30ms
memory: 74076kb

input:

10
196
50 3 166 63 113 192 68 26 154 60 187 147 30 101 61 69 33 13 45 81 153 94 72 108 137 84 67 46 56 62 188 171 75 141 139 110 150 77 146 38 14 29 143 18 10 156 57 195 112 35 111 27 24 40 167 90 121 6 22 159 131 107 78 172 180 103 82 97 48 182 100 132 54 138 114 190 120 152 181 115 32 136 92 74 19...

output:

42
11
26
23
16
28
23
33
14
13

result:

ok 10 numbers

Test #14:

score: 22
Accepted
time: 159ms
memory: 75928kb

input:

10
200
3 4 199 197 5 6 196 194 9 190 191 188 11 187 185 184 182 12 15 179 16 177 178 175 20 176 174 172 170 169 165 164 163 160 21 23 158 151 24 27 30 32 33 155 146 144 143 34 142 35 138 136 36 39 37 134 130 121 127 40 120 42 117 43 44 118 114 51 116 46 113 111 48 52 55 68 110 109 106 105 104 65 72 ...

output:

177
177
183
178
184
178
186
183
182
180

result:

ok 10 numbers

Test #15:

score: 22
Accepted
time: 150ms
memory: 75012kb

input:

10
198
198 1 197 196 2 190 194 188 184 3 4 183 181 180 178 8 174 173 9 10 12 13 172 170 166 14 15 16 23 165 24 163 162 25 159 160 27 157 155 30 32 34 154 35 150 37 38 46 48 153 149 148 49 50 145 141 51 137 135 52 54 134 55 131 58 60 130 129 63 127 65 123 122 66 67 68 119 118 69 116 112 71 110 72 73 ...

output:

189
185
183
184
191
176
189
184
181
183

result:

ok 10 numbers

Test #16:

score: 22
Accepted
time: 149ms
memory: 75432kb

input:

10
198
197 196 2 194 193 3 191 189 188 6 8 9 185 183 13 16 181 19 20 180 21 24 22 179 176 30 175 174 172 168 167 33 34 166 165 164 35 38 163 39 161 40 159 158 154 153 41 42 43 44 49 51 152 52 53 149 55 144 143 141 58 138 60 136 134 133 132 61 62 63 65 66 76 131 75 130 79 129 128 82 83 127 123 122 85...

output:

195
195
187
178
197
195
197
190
186
193

result:

ok 10 numbers

Test #17:

score: 22
Accepted
time: 138ms
memory: 76208kb

input:

10
191
191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 1...

output:

191
196
199
200
191
192
190
197
191
197

result:

ok 10 numbers

Test #18:

score: 22
Accepted
time: 142ms
memory: 76220kb

input:

10
198
5 3 6 10 8 17 20 22 27 28 196 195 190 187 186 181 185 180 176 175 174 173 172 166 169 164 162 161 159 155 157 153 154 151 152 150 149 145 144 143 142 140 139 134 131 130 129 126 125 124 123 122 121 119 113 115 112 110 108 107 105 104 102 100 98 93 89 95 88 84 81 79 78 76 74 72 71 70 68 66 64 ...

output:

182
179
178
177
170
174
169
177
177
175

result:

ok 10 numbers

Test #19:

score: 22
Accepted
time: 163ms
memory: 75892kb

input:

10
200
199 200 196 197 18 198 191 192 193 194 195 190 188 187 185 186 183 184 182 178 180 181 175 176 177 174 171 172 173 169 170 164 165 166 167 163 162 25 161 160 158 159 155 156 157 75 153 154 152 146 147 149 150 151 145 144 143 140 141 142 138 139 137 134 135 132 133 130 131 123 124 125 126 127 ...

output:

106
106
106
104
48
104
106
103
103
106

result:

ok 10 numbers

Subtask #3:

score: 0
Runtime Error

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #20:

score: 0
Runtime Error

input:

1
2000
1168 10 583 1288 787 1181 996 1193 73 1105 553 42 176 1540 207 1483 848 280 1013 94 59 1626 735 419 474 1167 599 1805 452 964 105 1930 56 579 1749 1123 1502 945 476 1161 125 828 925 847 1810 577 870 87 1188 781 519 622 1514 484 897 471 1209 1945 496 969 1389 613 1526 44 1182 593 568 1091 1566...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%

Subtask #5:

score: 0
Runtime Error

Test #49:

score: 13
Accepted
time: 57ms
memory: 11864kb

input:

9000
8
4 1 2 3 5 6 7 8
12
1 2 12 3 4 5 6 7 8 9 10 11
15
4 1 13 2 15 3 5 6 7 8 9 10 11 12 14
15
4 5 10 14 1 2 3 6 7 8 9 11 12 13 15
9
4 1 2 3 5 6 7 8 9
13
1 4 9 12 2 3 5 6 7 8 10 11 13
14
1 10 2 3 4 5 6 7 8 9 11 12 13 14
15
1 6 7 2 3 4 5 8 9 10 11 12 13 14 15
12
1 4 6 10 12 2 3 5 7 8 9 11
8
7 8 1 2 3...

output:

8
12
13
12
9
11
14
14
9
7
12
15
6
13
8
9
8
11
10
5
7
9
11
12
8
6
14
6
6
10
6
9
8
13
6
14
13
5
6
5
9
13
6
12
14
8
4
13
12
8
9
9
11
9
13
6
6
5
11
11
11
6
5
14
13
14
12
6
14
8
8
9
7
9
15
10
7
14
8
11
5
6
8
12
9
8
12
8
9
10
8
6
10
11
10
15
12
11
12
7
8
7
9
7
13
6
12
5
7
9
10
8
13
6
7
8
13
12
10
5
9
10
7...

result:

ok 9000 numbers

Test #50:

score: 13
Accepted
time: 256ms
memory: 11948kb

input:

10000
20
1 9 12 13 17 2 18 19 3 4 5 6 7 8 10 11 14 15 16 20
20
1 2 5 9 17 18 3 4 6 7 8 10 11 12 13 14 15 16 19 20
20
8 9 10 13 1 2 3 4 5 6 7 11 12 14 15 16 17 18 19 20
20
9 10 13 1 2 3 4 5 6 7 8 11 12 14 15 16 17 18 19 20
20
8 1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20
20
1 9 13 2 16 3 4 5 6 7...

output:

15
17
17
18
20
18
14
15
17
13
18
17
15
20
19
15
17
18
20
19
18
18
16
16
16
16
19
15
16
18
17
15
18
20
17
20
18
19
19
16
18
14
16
20
18
20
16
19
18
18
17
20
20
16
17
16
17
16
16
19
20
18
19
16
15
19
17
17
18
17
18
20
15
16
16
20
17
18
15
19
17
17
14
17
18
18
17
19
19
18
18
17
19
13
18
18
16
14
16
19
...

result:

ok 10000 numbers

Test #51:

score: 13
Accepted
time: 14ms
memory: 75112kb

input:

1
200
3 4 1 15 85 2 95 162 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 86 87 88 89 90 91 92 93 94 96 97 98 99 10...

output:

196

result:

ok 1 number(s): "196"

Test #52:

score: 0
Runtime Error

input:

10
20000
115 194 264 325 497 569 825 835 955 1036 1174 1292 1382 1436 1440 1580 1642 1845 1968 2013 2092 2214 2274 2400 2573 2763 2791 2809 2838 2891 3127 3239 3240 3296 3447 3602 3765 3903 4009 4095 4133 4200 4237 4368 4573 4590 4692 4714 4825 5028 5073 5380 5457 5479 5497 5730 5884 5896 6001 6316 ...

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%