QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#883919#10052. Just Long Neckties 2dxbt6 192ms23312kbC++141.3kb2025-02-05 19:52:472025-02-05 19:52:47

Judging History

This is the latest submission verdict.

  • [2025-02-05 19:52:47]
  • Judged
  • Verdict: 6
  • Time: 192ms
  • Memory: 23312kb
  • [2025-02-05 19:52:47]
  • Submitted

answer

#include<bits/stdc++.h>
#define F(i,l,r) for(int i=(l),i##end=(r);i<=i##end;++i)
#define G(i,l,r) for(int i=(l),i##end=(r);i>=i##end;--i)
#define x first
#define y second
#define pii pair<int,int>
#define mp(x,y) make_pair(x,y)
#define ep emplace_back
using namespace std;
typedef long long ll;
int a[5000009];
void read(int &x)
{
	x=0;
	char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^'0'),ch=getchar();
}
mt19937 rnd(time(0));
int p[100];
int main()
{
	int n;
	read(n);
	F(i,1,n)read(a[i]);
	int T=1;
	int score=22;
	while(T--)
	{
		int x=0;bool flag=true;
		F(i,1,n)
		{
			int mn=100,mx=0;
			F(j,1,x)
			{
				
				mn=min(mn,p[j]);
				if(p[j]<=a[i]&&p[j]>=p[mx])mx=j;
			}
			if(p[mx]==a[i])
			{
				flag=true;
				continue;
			}
			if(!flag)
			{
				if(mx!=0)p[mx]=a[i];
				else p[++x]=a[i];
				flag=true;
				continue;
			}
			if(mx==0&&a[i]<mn&&a[i]>a[i+1])
			{
				flag=false;
				continue;
			}
			if(mx==0&&a[i]>a[i+1])
			{
				flag=false;
				continue;
			}
			if(a[i]>a[i+1]&&a[i+1]>=mn)
			{
				flag=false;
				continue;
			}

			if(mx!=0)p[mx]=a[i];
			else if(flag&&mx==0&&a[i+1]>=mn)
			{
				flag=false;
				continue;
			}
			else p[++x]=a[i];
			flag=true;
		}
		score=min(score,x);
	}
	cout<<score<<'\n';
	return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 1ms
memory: 3584kb

input:

15
2 19 3 6 1 18 20 9 17 19 18 4 15 7 16

output:

3

result:

ok single line: '3'

Test #2:

score: 10
Accepted
time: 0ms
memory: 3712kb

input:

15
13 6 13 10 3 6 18 8 20 14 11 15 12 12 15

output:

2

result:

ok single line: '2'

Test #3:

score: 10
Accepted
time: 1ms
memory: 3584kb

input:

15
3 6 7 9 10 6 12 13 5 13 14 16 17 6 18

output:

1

result:

ok single line: '1'

Test #4:

score: 10
Accepted
time: 0ms
memory: 3584kb

input:

13
14 2 12 4 16 5 7 7 19 8 5 8 20

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

15
6 14 13 5 17 16 15 6 20 17 9 21 10 4 20

output:

3

result:

wrong answer 1st lines differ - expected: '2', found: '3'

Subtask #2:

score: 6
Accepted

Test #19:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

500
1 1 2 2 2 2 2 1 2 2 1 1 1 1 2 1 1 2 1 2 1 2 1 1 2 2 2 2 1 1 1 2 2 1 1 1 2 1 1 1 1 1 2 1 2 2 1 2 1 2 2 1 2 1 1 2 2 1 2 1 2 1 1 1 1 2 2 1 2 1 1 2 1 2 2 1 1 1 2 1 2 1 1 2 2 2 1 2 2 2 2 1 1 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 2 2 2 2 2 1 1 1 2 1 1 2 1 2 2 2 1 1 1 1 2 2 2 2 1 1 2 2 1 2 2 1 2 2 2 1 2 2 1 1 ...

output:

2

result:

ok single line: '2'

Test #20:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

500
1 2 1 1 2 2 1 2 1 1 2 1 2 1 1 1 1 2 2 1 1 2 2 2 1 1 1 1 2 2 1 2 1 2 2 2 1 1 2 2 2 1 1 1 1 2 1 1 2 1 1 2 2 1 2 2 1 1 1 1 2 2 2 2 1 1 2 1 2 2 2 2 2 1 2 2 1 1 2 1 2 2 1 1 1 2 1 2 1 2 1 2 1 1 1 2 2 1 1 1 1 2 2 2 2 1 1 1 1 1 2 1 2 2 2 2 1 2 1 2 2 1 1 1 2 2 1 1 1 2 2 1 2 2 2 1 1 1 2 2 1 1 2 2 2 2 1 1 ...

output:

2

result:

ok single line: '2'

Test #21:

score: 6
Accepted
time: 0ms
memory: 3712kb

input:

500
2 1 2 2 2 2 2 2 2 1 2 2 1 2 1 2 1 2 1 2 2 1 2 1 2 2 2 1 2 2 1 2 2 2 2 1 2 2 1 2 1 2 2 2 2 2 1 2 1 2 1 2 1 2 2 2 1 2 1 2 1 2 2 1 2 1 2 2 1 2 2 1 2 2 1 2 1 2 1 2 1 2 2 1 2 1 2 2 2 1 2 1 2 2 1 2 2 1 2 2 2 2 2 1 2 1 2 2 1 2 2 2 1 2 2 1 2 1 2 1 2 1 2 2 1 2 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 1 2 2 2 2 1 2 ...

output:

1

result:

ok single line: '1'

Test #22:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

500
2 1 2 1 2 1 1 2 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 1 2 1 1 1 2 1 1 2 1 1 2 1 2 1 1 2 1 2 1 1 1 1 1 2 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 1 1 2 1 1 1 2 1 1 2 1 2 1 2 1 1 1 2 1 1 2 1 2 1 2 1 1 2 1 2 1 2 1 1 2 1 1 1 1 1 2 1 2 1 2 1 2 1 1 2 1 1 1 1 2 1 1 1 1 2 ...

output:

1

result:

ok single line: '1'

Test #23:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

500
2 1 1 2 1 1 2 1 2 1 1 1 2 1 2 1 2 1 1 1 2 1 2 1 1 2 1 2 1 1 2 1 2 1 2 1 1 1 2 1 2 1 2 1 2 1 1 1 2 1 2 1 2 1 2 1 1 2 1 1 1 2 1 1 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 1 1 2 1 1 2 1 1 2 1 1 2 1 2 1 1 2 1 1 1 2 1 2 1 2 1 1 1 2 1 2 1 2 1 2 1 2 1 1 2 1 1 2 ...

output:

1

result:

ok single line: '1'

Test #24:

score: 6
Accepted
time: 0ms
memory: 3712kb

input:

500
2 1 2 1 2 1 2 1 1 1 2 1 2 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 2 1 2 1 2 1 1 2 1 1 1 1 1 1 2 1 2 1 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 1 1 1 2 1 2 1 1 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 1 1 1 2 1 2 1 2 1 2 1 1 2 1 1 1 1 2 1 1 1 ...

output:

1

result:

ok single line: '1'

Test #25:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

500
1 2 1 1 2 1 1 2 1 1 2 1 2 1 2 1 1 2 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 2 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 1 2 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 1 2 1 2 1 1 1 1 1 1 2 1 2 1 1 2 1 1 1 2 1 1 2 1 2 1 1 1 1 1 2 1 1 1 2 1 2 1 2 1 2 1 2 1 2 ...

output:

1

result:

ok single line: '1'

Test #26:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

2
1 2

output:

1

result:

ok single line: '1'

Test #27:

score: 6
Accepted
time: 0ms
memory: 3712kb

input:

2
2 1

output:

1

result:

ok single line: '1'

Test #28:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

4
1 1 2 2

output:

1

result:

ok single line: '1'

Test #29:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

4
2 2 1 1

output:

2

result:

ok single line: '2'

Test #30:

score: 6
Accepted
time: 0ms
memory: 3712kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1

result:

ok single line: '1'

Test #31:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

500
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

2

result:

ok single line: '2'

Test #32:

score: 6
Accepted
time: 0ms
memory: 3712kb

input:

2
2 2

output:

1

result:

ok single line: '1'

Test #33:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

500
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

1

result:

ok single line: '1'

Subtask #3:

score: 0
Wrong Answer

Test #34:

score: 12
Accepted
time: 0ms
memory: 3712kb

input:

500
2 5 4 4 4 1 1 4 5 1 1 2 2 1 4 3 3 1 4 5 4 3 1 1 3 4 4 2 2 3 1 1 1 1 3 3 5 2 1 2 1 1 4 1 4 4 1 2 2 5 3 4 2 3 2 3 5 3 3 1 5 3 4 5 1 2 5 5 2 1 5 1 4 2 2 2 1 2 1 2 2 1 4 2 3 5 1 2 5 2 1 2 5 3 3 5 3 1 3 4 3 3 1 3 4 4 5 1 2 2 2 3 2 5 3 5 3 1 4 5 1 1 5 3 3 5 4 3 1 5 1 5 5 1 5 5 2 4 3 2 5 3 3 2 4 3 1 3 ...

output:

5

result:

ok single line: '5'

Test #35:

score: 12
Accepted
time: 0ms
memory: 3712kb

input:

500
4 5 3 3 2 5 3 2 4 3 5 4 1 5 2 2 2 4 2 1 5 5 5 1 1 2 3 1 4 4 2 3 3 3 1 4 4 1 2 1 1 1 4 2 3 1 4 1 3 3 5 4 5 2 3 5 1 5 1 2 2 5 2 2 5 1 4 2 4 2 2 1 4 5 3 2 2 2 2 2 3 1 1 5 2 4 2 4 2 2 3 2 5 3 2 1 2 5 5 2 3 1 4 5 1 4 4 4 1 3 4 1 1 3 2 5 1 4 4 2 3 1 5 5 4 2 4 1 4 3 2 1 3 4 4 3 1 3 2 5 3 3 5 5 4 4 4 5 ...

output:

5

result:

ok single line: '5'

Test #36:

score: 12
Accepted
time: 0ms
memory: 3584kb

input:

500
1 1 4 1 1 3 1 1 3 1 5 1 1 1 5 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 3 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 3 1 1 1 1 4 1 1 2 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 4 1 3 1 1 1 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 2 2 1 2 2 2 2 2 2 5 2 2 1 2 3 2 2 1 2 2 2 2 2 5 2 2 1 ...

output:

1

result:

ok single line: '1'

Test #37:

score: 12
Accepted
time: 0ms
memory: 3584kb

input:

499
4 1 1 1 2 1 3 1 2 1 2 1 1 1 4 1 2 1 5 1 3 1 1 1 4 1 5 1 5 1 5 1 1 1 3 1 4 1 5 1 2 1 3 1 1 1 1 1 2 1 3 1 3 1 1 1 2 1 2 1 5 1 3 1 4 1 1 1 3 1 2 1 4 1 1 1 3 1 5 1 1 1 5 1 4 1 2 1 5 1 4 1 4 1 3 1 4 1 3 1 5 1 2 1 1 2 5 2 4 2 4 2 1 2 1 2 3 2 1 2 4 2 2 2 4 2 3 2 5 2 3 2 5 2 1 2 5 2 4 2 2 2 5 2 5 2 2 2 ...

output:

1

result:

ok single line: '1'

Test #38:

score: 0
Wrong Answer
time: 1ms
memory: 3712kb

input:

500
1 1 2 1 1 1 3 1 1 1 4 1 3 1 1 1 1 1 1 3 1 2 1 1 4 1 1 5 1 1 1 2 1 1 1 5 1 4 1 5 1 1 1 1 1 1 1 1 2 1 4 1 1 1 1 1 1 4 1 5 1 3 1 4 1 1 1 1 1 1 1 5 1 1 5 2 3 1 4 1 1 1 1 1 1 2 1 2 2 1 2 3 2 4 2 2 2 4 2 2 2 1 3 2 2 1 5 1 5 2 2 2 2 5 2 4 2 4 1 5 1 1 1 2 4 2 4 2 5 1 1 2 2 1 2 5 2 3 2 4 2 2 5 2 2 2 3 2 ...

output:

4

result:

wrong answer 1st lines differ - expected: '3', found: '4'

Subtask #4:

score: 0
Wrong Answer

Test #53:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

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

output:

15

result:

wrong answer 1st lines differ - expected: '10', found: '15'

Subtask #5:

score: 0
Wrong Answer

Test #73:

score: 26
Accepted
time: 17ms
memory: 6572kb

input:

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

output:

15

result:

ok single line: '15'

Test #74:

score: 26
Accepted
time: 17ms
memory: 6160kb

input:

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

output:

15

result:

ok single line: '15'

Test #75:

score: 26
Accepted
time: 4ms
memory: 6272kb

input:

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

output:

1

result:

ok single line: '1'

Test #76:

score: 26
Accepted
time: 6ms
memory: 7616kb

input:

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

output:

1

result:

ok single line: '1'

Test #77:

score: 26
Accepted
time: 6ms
memory: 7452kb

input:

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

output:

2

result:

ok single line: '2'

Test #78:

score: 0
Wrong Answer
time: 13ms
memory: 6104kb

input:

500000
1 1 1 1 1 1 9 1 1 6 1 1 1 1 1 1 1 1 1 1 1 13 1 1 1 1 1 1 1 1 1 1 1 1 15 1 1 1 1 10 1 1 1 12 1 1 1 1 6 1 1 1 1 1 1 1 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 9 1 1 1 1 11 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 1 1 1 1 10 1 1 2 1 1 1 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 10 1 1 1 1 6 1 1 1 1 1 1 1 1 1 1 1 ...

output:

13

result:

wrong answer 1st lines differ - expected: '10', found: '13'

Subtask #6:

score: 0
Wrong Answer

Test #93:

score: 10
Accepted
time: 18ms
memory: 7360kb

input:

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

output:

21

result:

ok single line: '21'

Test #94:

score: 10
Accepted
time: 19ms
memory: 5504kb

input:

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

output:

21

result:

ok single line: '21'

Test #95:

score: 10
Accepted
time: 8ms
memory: 7304kb

input:

500000
1 1 1 14 1 1 14 1 1 1 1 1 1 1 1 1 1 12 1 1 1 1 13 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 12 1 1 1 1 1 1 1 1 1 5 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 6 1 1 1 1 1 1 1 1 17 1 3 1 1 1 1 13 1 1 1 1 1 17 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 19 1 5 1 1 11 1 1 1 1 1 15 1 16 1 1 1 8 1 1 17 1 1 1 20 1 1 1 1 1 1...

output:

1

result:

ok single line: '1'

Test #96:

score: 10
Accepted
time: 6ms
memory: 6492kb

input:

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

output:

1

result:

ok single line: '1'

Test #97:

score: 0
Wrong Answer
time: 10ms
memory: 7468kb

input:

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

output:

4

result:

wrong answer 1st lines differ - expected: '2', found: '4'

Subtask #7:

score: 0
Wrong Answer

Test #122:

score: 18
Accepted
time: 191ms
memory: 23296kb

input:

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

output:

21

result:

ok single line: '21'

Test #123:

score: 18
Accepted
time: 192ms
memory: 23132kb

input:

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

output:

21

result:

ok single line: '21'

Test #124:

score: 18
Accepted
time: 61ms
memory: 23164kb

input:

5000000
1 1 1 1 1 1 9 1 1 7 1 8 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 11 1 1 1 1 1 1 1 17 1 14 1 1 1 4 1 1 1 11 1 1 20 1 14 1 1 1 1 1 1 1 6 1 1 1 1 1 21 1 1 1 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 8 1 1 1 1 1 1 19 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 15 1 1 11 1 1 1 7 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1

result:

ok single line: '1'

Test #125:

score: 18
Accepted
time: 65ms
memory: 23092kb

input:

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

output:

1

result:

ok single line: '1'

Test #126:

score: 18
Accepted
time: 78ms
memory: 23164kb

input:

5000000
18 1 8 1 1 1 20 1 10 1 1 1 1 21 1 17 1 1 15 1 14 1 1 1 1 9 1 2 1 8 1 10 1 4 1 14 1 1 1 14 1 9 1 11 1 4 1 5 1 1 1 1 11 1 13 1 1 14 1 1 1 2 1 7 1 1 1 1 1 1 1 2 1 1 4 1 15 1 1 1 19 1 12 1 19 1 1 2 1 18 1 11 1 1 14 1 15 1 4 1 9 1 13 1 8 1 21 1 2 1 14 1 1 4 1 10 1 1 1 1 5 1 14 1 20 1 3 1 5 1 21 1...

output:

2

result:

ok single line: '2'

Test #127:

score: 0
Wrong Answer
time: 163ms
memory: 23312kb

input:

5000000
1 1 1 1 1 1 11 1 1 1 1 9 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 3 1 1 1 1 13 2 1 1 1 1 1 1 14 1 1 1 7 1 3 2 1 1 2 1 1 7 1 1 2 1 1 1 1 1 2 1 2 1 1 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 16 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 ...

output:

21

result:

wrong answer 1st lines differ - expected: '17', found: '21'