QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#50124#871. Interesting Scoring SystemsSparky327AC ✓147ms3240kbC++879b2022-09-24 16:56:562022-09-24 16:56:57

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-24 16:56:57]
  • 评测
  • 测评结果:AC
  • 用时:147ms
  • 内存:3240kb
  • [2022-09-24 16:56:56]
  • 提交

answer

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<map>
#include<cmath>
#define ll long long
using namespace std;
ll g[1000100],h[1000100]; 
ll win=0;
int main()
{
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		win=0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++){
			scanf("%lld",&g[i]);
		}
		for (int i=1;i<=n;i++){
			scanf("%lld",&h[i]);
		}
		
		if (n==1) {
			printf("YES\n");
			continue;
		}
		if (h[1]==g[1]) {
			printf("NO\n");
			continue;
		}
		else if (n==2) {
			if (h[1]>g[1]&&h[2]==g[2]) printf("YES\n");
			else printf("NO\n");
			continue;
		}//13 17
		for (int i=1;i<=n;i++){
			int u=h[i]-g[i];
			win+=u;
			g[i]=g[i]-2*u;
		}
		if (win<n-1) {
			printf("NO\n");
			continue;
		}
		sort(g+1,g+n+1);
		ll sum=0;
		for (int i=1;i<n;i++)
		sum+=g[i];
		printf("YES\n");
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 1764kb

input:

2
3
4 1 1
6 1 1
4
5 1 1 1
7 1 1 1

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #2:

score: 0
Accepted
time: 1ms
memory: 1976kb

input:

2
4
5 3 1 3
7 4 1 3
1
0
0

output:

YES
YES

result:

ok 2 token(s): yes count is 2, no count is 0

Test #3:

score: 0
Accepted
time: 73ms
memory: 1980kb

input:

10000
64
2 2 1 4 1 7 5 0 4 7 4 3 0 6 2 3 3 2 5 2 4 3 2 9 4 2 5 1 0 1 2 4 0 5 5 4 4 0 0 2 0 3 2 5 5 6 5 0 5 0 3 0 3 6 5 4 0 6 7 3 4 4 2 2
3 2 1 5 1 10 7 0 6 10 6 4 0 8 3 4 4 3 7 3 6 4 2 13 6 3 7 1 0 1 3 6 0 7 7 5 6 0 0 3 0 4 2 7 7 9 7 0 7 0 4 0 4 8 7 5 0 9 10 4 6 5 3 3
99
98 79 89 106 103 91 89 105 9...

output:

YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES...

result:

ok 10000 token(s): yes count is 8273, no count is 1727

Test #4:

score: 0
Accepted
time: 84ms
memory: 1980kb

input:

1000
794
0 0 2 2 4 0 3 3 1 2 4 1 2 0 6 0 1 2 5 2 2 1 0 2 5 4 3 0 0 5 4 2 0 2 0 0 2 5 4 0 2 5 0 0 3 2 0 3 2 2 2 2 0 3 0 2 2 2 0 4 0 3 0 0 1 0 2 0 2 3 2 2 0 2 0 0 1 4 1 3 1 2 0 0 8 3 3 0 1 3 3 0 2 4 1 2 0 5 2 0 0 4 0 0 3 2 0 2 2 4 0 2 6 2 0 0 2 2 5 2 1 1 2 10 0 0 3 1 0 7 5 0 6 1 0 4 2 1 0 5 0 2 2 2 0 ...

output:

NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES...

result:

ok 1000 token(s): yes count is 911, no count is 89

Test #5:

score: 0
Accepted
time: 14ms
memory: 1784kb

input:

10
9172
3 2 2 3 3 8 3 4 2 8 7 5 4 5 5 6 2 9 1 5 7 3 7 12 2 3 0 7 4 2 3 6 2 10 8 1 5 6 9 6 10 3 1 7 1 3 7 5 4 0 8 4 7 4 3 5 4 0 0 6 2 4 6 6 4 9 3 4 3 3 4 3 4 7 5 2 3 1 11 4 0 6 4 5 0 6 4 3 8 2 2 2 4 6 4 14 5 8 4 4 5 4 5 8 4 7 4 4 5 5 6 2 6 12 2 1 2 9 6 6 4 4 3 4 2 14 2 3 5 5 7 1 5 5 0 5 5 4 7 4 2 6 9...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

result:

ok 10 token(s): yes count is 10, no count is 0

Test #6:

score: 0
Accepted
time: 9ms
memory: 2420kb

input:

1
51976
3 4 3 1 0 3 2 5 0 1 0 4 4 2 1 4 7 6 1 2 0 3 3 3 1 2 2 3 0 3 3 4 4 0 7 1 2 6 3 5 2 1 4 5 4 12 4 4 0 0 4 1 0 4 0 5 1 0 4 2 8 2 2 0 2 5 0 2 0 0 0 7 2 2 3 3 2 3 0 6 4 0 4 3 4 0 4 5 4 1 2 1 0 0 3 4 2 2 0 4 0 2 0 4 4 7 5 3 2 2 0 2 2 2 2 4 7 4 4 2 1 2 0 3 2 0 0 1 4 3 3 1 1 1 2 3 1 6 1 0 1 6 0 5 6 6...

output:

YES

result:

ok YES

Test #7:

score: 0
Accepted
time: 7ms
memory: 2244kb

input:

1
39560
0 3 2 6 1 0 4 1 3 5 2 1 4 2 2 3 1 1 1 2 2 5 3 2 3 8 1 4 4 4 8 0 4 2 4 7 4 4 0 2 9 6 0 1 0 11 5 6 5 3 2 2 2 5 2 1 0 0 8 0 3 1 4 5 3 3 0 5 3 4 4 4 8 3 2 0 2 6 7 1 1 8 5 6 1 2 0 7 0 1 0 5 1 1 0 7 3 0 3 0 3 2 6 2 1 2 5 2 2 2 7 8 1 4 1 5 0 4 9 2 4 6 3 0 1 0 8 10 3 4 3 1 2 0 0 4 4 2 0 0 11 2 2 6 5...

output:

NO

result:

ok NO

Test #8:

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

input:

1
47636
0 4 0 1 0 0 0 0 0 0 0 0 0 0 0 2 2 1 0 0 0 2 0 0 0 0 0 0 2 6 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 2 0 0 2 0 0 0 0 0 0 1 0 0 1 0 0 2 0 2 0 0 1 0 0 2 0 0 2 0 0 2 2 0 0 0 0 4 2 0 2 0 0 2 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 2 2 0 0 0 2 0 2 0 0 0 0 0 3 2 0 0 0 0 1 2 2 1 2 0 2 0 0 0 2 ...

output:

NO

result:

ok NO

Test #9:

score: 0
Accepted
time: 8ms
memory: 2156kb

input:

1
35220
2 2 4 5 0 4 0 0 1 2 0 1 6 0 2 0 2 3 2 0 2 2 4 0 0 0 0 2 0 4 3 0 2 0 2 0 2 2 6 0 1 2 2 0 2 0 0 1 0 0 5 2 0 2 2 3 4 0 0 1 0 0 7 3 2 0 0 0 0 5 1 2 2 2 0 2 0 0 2 0 4 0 0 2 1 2 2 0 0 2 0 6 0 0 2 0 0 2 4 2 0 4 2 2 0 2 0 4 0 0 2 0 5 3 0 2 2 0 0 0 0 2 0 2 2 0 2 0 4 0 0 2 4 2 1 0 0 0 1 1 0 2 0 2 0 0 ...

output:

NO

result:

ok NO

Test #10:

score: 0
Accepted
time: 2ms
memory: 2040kb

input:

1
33050
0 6 2 1 4 3 6 3 2 4 3 5 0 5 4 0 1 4 8 2 2 3 2 6 4 4 0 4 3 3 3 4 1 5 5 0 4 1 2 3 2 1 2 1 4 8 0 0 3 8 0 8 7 2 5 7 3 5 0 8 4 3 4 0 6 5 6 2 5 5 3 0 5 6 7 6 2 0 3 4 5 1 1 3 5 9 0 5 5 2 2 0 0 3 9 5 6 2 1 4 0 0 1 1 0 1 6 7 4 1 4 6 5 2 4 4 0 0 5 6 4 2 2 5 5 0 7 2 6 5 2 1 7 5 6 5 4 7 3 7 3 10 3 0 8 9...

output:

NO

result:

ok NO

Test #11:

score: 0
Accepted
time: 4ms
memory: 1944kb

input:

1
20634
4 2 0 0 2 0 0 4 0 3 5 2 4 1 3 4 0 0 2 4 2 7 2 0 0 2 4 2 1 0 0 2 4 4 4 8 0 2 0 0 0 0 2 1 3 0 0 2 2 2 1 0 0 0 0 1 4 3 6 6 2 0 0 1 2 0 0 0 2 2 2 4 0 3 3 5 1 1 4 0 0 2 0 4 4 0 2 0 2 4 1 4 1 0 5 3 2 0 5 0 3 4 2 0 0 2 2 2 2 2 2 2 4 0 0 1 4 0 3 0 0 4 0 2 8 0 2 6 6 3 2 2 1 2 2 2 3 3 2 0 0 2 3 4 1 0 ...

output:

NO

result:

ok NO

Test #12:

score: 0
Accepted
time: 1ms
memory: 2052kb

input:

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

output:

YES

result:

ok YES

Test #13:

score: 0
Accepted
time: 3ms
memory: 1872kb

input:

1
16294
2 0 4 3 1 2 1 2 2 3 5 0 0 3 7 5 4 2 2 1 4 3 6 3 1 0 0 2 4 4 1 2 3 6 2 0 5 3 0 3 4 3 5 2 0 0 3 2 2 2 6 6 0 3 5 4 1 3 6 0 1 4 0 1 0 1 4 2 8 1 2 2 2 0 4 2 4 0 0 5 5 6 0 2 0 4 4 2 2 3 2 2 0 0 0 0 1 2 3 0 2 0 1 2 2 5 9 0 3 3 0 2 1 1 1 1 0 0 4 4 3 2 1 2 4 2 3 0 7 1 4 0 1 2 0 3 2 0 4 0 4 4 0 2 1 0 ...

output:

NO

result:

ok NO

Test #14:

score: 0
Accepted
time: 1ms
memory: 1788kb

input:

1
3878
3 0 1 0 1 2 0 2 4 0 0 0 0 3 0 0 0 1 1 0 1 0 1 0 0 0 0 2 0 2 4 2 0 2 0 0 0 3 3 0 0 0 6 4 0 1 0 4 2 0 0 0 2 1 0 1 0 0 2 4 1 1 4 0 3 1 0 0 0 1 2 0 0 0 1 3 0 3 0 0 0 0 2 0 0 2 0 0 2 0 0 2 0 0 1 2 0 0 7 2 3 2 0 2 1 0 1 2 1 0 0 4 0 0 0 2 1 0 0 0 0 0 0 2 0 2 0 2 0 0 1 0 0 0 0 2 0 2 0 0 0 2 0 0 0 0 0...

output:

NO

result:

ok NO

Test #15:

score: 0
Accepted
time: 15ms
memory: 2928kb

input:

1
90032
2 4 0 8 6 1 3 4 9 7 3 8 12 7 4 4 3 13 4 10 9 9 0 8 6 5 9 1 4 2 3 6 6 7 8 3 1 5 12 2 1 6 6 3 3 8 2 8 3 7 4 0 2 4 12 13 8 2 3 4 10 1 8 7 11 8 6 6 1 5 7 10 6 4 6 11 7 4 7 5 16 9 8 12 10 2 17 6 5 4 5 7 5 9 7 10 5 4 3 1 4 2 5 8 3 8 6 2 2 3 12 0 2 5 9 8 5 6 4 7 18 8 11 6 5 9 4 3 3 4 1 4 9 8 8 5 7 ...

output:

YES

result:

ok YES

Test #16:

score: 0
Accepted
time: 129ms
memory: 2028kb

input:

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

output:

YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 10000 token(s): yes count is 8989, no count is 1011

Test #17:

score: 0
Accepted
time: 147ms
memory: 1816kb

input:

1000
1000
2 0 3 2 0 0 1 2 6 3 0 5 4 0 0 2 2 2 0 2 4 2 0 2 1 4 1 0 2 0 2 3 5 1 3 6 4 2 1 0 0 4 2 0 0 0 0 0 0 0 3 0 2 0 2 1 4 2 4 0 4 0 4 0 4 1 2 0 0 0 0 0 0 0 0 0 0 2 3 0 3 0 2 2 0 0 4 7 1 4 0 2 0 0 0 2 4 3 4 0 2 0 4 6 0 2 0 2 1 0 2 4 2 2 6 0 2 0 0 0 1 1 1 3 0 1 0 2 0 0 1 2 2 0 2 3 0 0 0 0 0 0 2 4 4 ...

output:

NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
Y...

result:

ok 1000 token(s): yes count is 912, no count is 88

Test #18:

score: 0
Accepted
time: 22ms
memory: 1812kb

input:

10
10000
5 5 3 2 6 7 2 2 4 6 4 2 2 2 7 6 5 1 1 4 0 0 5 2 2 1 3 2 1 6 4 2 8 2 4 5 2 0 0 1 0 4 8 1 2 2 5 3 2 6 0 15 8 2 2 8 6 1 4 0 2 1 0 6 2 3 2 2 0 2 5 1 2 0 0 0 2 0 3 1 7 3 3 2 1 5 8 5 6 4 5 1 6 2 0 0 9 3 0 2 3 0 1 2 3 2 0 5 2 4 0 7 4 6 2 9 0 4 0 0 3 3 0 2 3 2 0 2 0 1 4 4 1 7 3 0 9 0 2 0 0 3 0 4 2 ...

output:

YES
YES
YES
YES
YES
NO
YES
YES
YES
YES

result:

ok 10 token(s): yes count is 9, no count is 1

Test #19:

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

input:

1
100000
4 2 2 8 8 8 4 1 6 5 3 8 6 0 5 4 4 4 2 1 4 2 5 3 4 7 0 3 9 2 6 1 5 9 2 0 3 3 7 1 0 3 1 4 3 4 12 0 6 5 5 3 5 1 3 7 6 7 2 7 0 2 3 6 2 3 5 0 6 5 3 6 4 6 2 5 1 0 2 4 4 0 7 0 1 2 2 5 6 2 4 7 4 7 4 3 5 7 3 2 3 4 0 8 0 0 3 2 1 1 2 3 5 7 6 9 5 3 7 4 3 1 3 2 8 2 1 4 2 1 2 2 8 5 2 8 2 2 0 2 4 3 3 0 7 ...

output:

YES

result:

ok YES

Test #20:

score: 0
Accepted
time: 16ms
memory: 3188kb

input:

1
100000
0 1 2 0 2 0 0 3 2 2 0 0 0 4 1 4 0 2 0 4 0 0 0 0 0 0 0 2 0 2 0 0 0 3 0 0 0 0 2 2 2 2 0 0 3 0 0 4 0 4 0 1 0 4 0 1 0 0 0 0 2 4 2 3 1 1 2 0 1 1 0 2 0 0 4 4 0 2 6 3 0 2 0 0 2 0 0 2 2 0 2 0 1 1 1 0 2 2 0 2 0 0 0 0 2 2 0 0 0 1 2 1 0 0 0 3 4 2 2 0 0 0 3 0 2 0 0 1 0 2 2 2 0 0 1 0 0 3 0 0 1 0 0 3 0 0...

output:

NO

result:

ok NO

Test #21:

score: 0
Accepted
time: 19ms
memory: 3180kb

input:

1
100000
8 2 5 4 8 8 2 5 3 2 2 10 6 2 5 4 7 4 8 7 0 2 6 4 4 6 2 2 1 2 0 4 1 4 0 1 10 3 10 1 4 2 0 3 4 6 4 2 0 2 2 2 4 0 7 4 1 2 1 2 3 4 2 0 3 4 7 4 6 7 4 4 2 7 3 6 6 4 5 8 3 6 2 2 5 10 6 8 0 5 0 0 10 2 5 0 6 4 4 1 4 5 8 3 0 5 7 6 1 3 6 4 8 0 3 9 10 6 10 5 8 9 10 7 6 4 2 2 0 4 1 4 15 1 0 2 4 4 9 5 11...

output:

YES

result:

ok YES

Test #22:

score: 0
Accepted
time: 16ms
memory: 3152kb

input:

1
100000
3 0 0 0 0 0 0 0 1 0 4 0 4 0 0 0 2 0 1 0 1 0 2 2 0 2 0 1 0 2 0 0 3 4 0 0 4 0 0 0 6 2 2 2 0 2 0 3 0 1 0 2 2 0 0 4 0 2 1 0 1 3 1 0 1 4 0 0 2 3 2 2 3 2 0 2 0 2 2 0 2 1 0 1 3 0 0 2 0 2 4 1 0 0 0 0 2 2 4 0 1 0 2 4 0 0 0 0 2 0 2 3 0 2 0 0 4 4 2 2 2 1 1 0 0 1 0 2 0 0 0 2 2 0 0 2 1 0 2 2 4 2 1 0 0 2...

output:

NO

result:

ok NO

Test #23:

score: 0
Accepted
time: 17ms
memory: 3180kb

input:

1
100000
12 14 7 9 2 3 4 5 5 8 6 14 8 14 2 3 7 4 7 3 9 7 4 6 8 4 6 7 8 14 5 7 3 2 8 10 6 10 7 5 2 8 2 12 4 9 6 4 4 12 4 4 4 5 9 5 2 6 5 2 10 6 14 3 7 12 8 12 6 4 1 3 9 5 8 1 6 8 9 4 10 8 5 5 11 1 8 7 8 10 2 3 3 5 7 12 6 3 11 5 4 5 3 6 7 2 6 11 4 7 3 4 7 5 7 2 4 1 7 10 3 5 8 5 4 9 5 8 4 5 5 6 7 9 5 3...

output:

YES

result:

ok YES

Test #24:

score: 0
Accepted
time: 7ms
memory: 3164kb

input:

1
100000
2 3 2 3 6 2 3 2 4 5 1 4 2 2 10 1 2 4 2 2 3 5 5 1 0 6 3 4 2 6 7 6 4 1 4 0 12 5 6 7 4 2 2 6 3 2 2 6 5 5 1 2 1 5 0 1 4 1 3 1 2 2 4 3 4 4 5 4 2 5 4 7 4 2 4 8 3 7 4 5 8 4 2 1 4 7 5 3 4 2 5 6 2 2 2 4 2 5 2 4 9 4 0 0 1 1 1 3 6 2 5 6 5 0 4 0 6 2 11 2 3 2 2 2 5 3 5 4 3 1 4 0 3 4 0 0 1 10 3 4 4 4 2 0...

output:

YES

result:

ok YES

Test #25:

score: 0
Accepted
time: 17ms
memory: 3184kb

input:

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

output:

YES

result:

ok YES

Test #26:

score: 0
Accepted
time: 15ms
memory: 3236kb

input:

1
100000
11 1 1 6 1 3 5 6 4 2 1 1 2 3 1 3 3 1 0 0 0 2 0 2 4 2 6 0 2 12 2 5 4 3 7 6 1 1 1 2 3 0 3 0 1 1 0 4 0 0 1 3 2 2 2 4 2 4 4 6 2 3 4 5 2 6 1 5 6 3 2 0 3 2 4 3 2 3 0 4 5 5 5 4 1 0 4 4 2 4 2 5 2 1 0 3 6 2 6 5 0 3 1 0 1 4 2 7 4 2 5 0 1 7 2 3 5 2 2 0 0 6 0 5 4 0 0 4 0 1 11 0 0 2 4 3 2 0 6 3 0 2 4 2 ...

output:

YES

result:

ok YES

Test #27:

score: 0
Accepted
time: 13ms
memory: 3164kb

input:

1
100000
0 0 1 1 0 0 0 0 2 0 0 2 2 1 0 4 0 0 0 0 0 0 0 0 0 0 0 0 2 1 2 1 0 2 3 0 1 0 0 0 0 2 0 0 0 0 1 2 2 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 0 2 0 0 0 0 0 0 1 0 0 0 0 2 0 0 0 1 0 0 1 0 0 0 0 2 0 0 0 0 0 0 0 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 4 0 2 0 2 0...

output:

NO

result:

ok NO

Test #28:

score: 0
Accepted
time: 18ms
memory: 3240kb

input:

1
100000
4 0 5 8 5 4 2 10 2 1 1 1 1 1 3 8 4 3 1 4 0 7 6 7 4 8 5 4 2 0 2 4 2 4 3 5 0 1 4 3 9 0 4 3 0 3 5 2 1 0 3 3 12 0 4 2 3 0 0 3 1 1 4 0 1 5 2 5 0 7 7 6 6 8 3 4 1 4 3 6 2 1 5 8 2 2 2 10 0 2 1 4 3 0 1 5 0 5 0 0 4 2 2 1 2 4 4 4 0 3 2 1 5 4 4 5 2 2 4 6 4 2 6 2 9 3 3 4 4 0 2 3 4 3 3 4 1 3 6 1 0 6 7 4 ...

output:

YES

result:

ok YES

Test #29:

score: 0
Accepted
time: 1ms
memory: 1844kb

input:

4
1
0
0
2
2 0
3 0
2
0 0
0 0
2
4 2
6 3

output:

YES
YES
NO
NO

result:

ok 4 token(s): yes count is 2, no count is 2