QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#20170#2425. The Collection GameWu_Ren#100 ✓12ms3832kbC++20839b2022-02-14 21:43:112022-05-03 09:10:24

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-03 09:10:24]
  • 评测
  • 测评结果:100
  • 用时:12ms
  • 内存:3832kb
  • [2022-02-14 21:43:11]
  • 提交

answer

#include <bits/stdc++.h>
#include "swaps.h"
using namespace std;
int p[510],m,n;
int o=0;
vector<int> res;
void qry(int x,int y){
	if(x>m||y>m) return;
	schedule(x,y);
}
bool get(int x,int y){
	if(x>m) return 0;
	if(y>m) return 1;
	return res[o++];
}
void solve(int n,int v){
	m=n;
	for(n=1;n<m;n<<=1);
	for(int i=0;i<n;i++) p[i]=i+1;
	int len=1;
	while(len<n){
		len<<=1;
		for(int i=0;i<n;i+=len){
			int r=min(i+len,n);
			if(i+len/2<r) reverse(p+i+(len/2),p+r);
		}
		for(int k=len/2;k>=1;k/=2){
			for(int i=0;i+k<n;i+=2*k){
				for(int y=min(i+2*k,n)-1,x=i+k-1;x>=i&&y>=i+k;x--,y--) qry(p[y],p[x]);
			}
			o=0;
			res=visit();
			for(int i=0;i+k<n;i+=2*k){
				for(int y=min(i+2*k,n)-1,x=i+k-1;x>=i&&y>=i+k;x--,y--) if(get(p[y],p[x])) swap(p[x],p[y]);
			}
		}
	}
	answer(vector<int>(p,p+m));
}

詳細信息

Subtask #1:

score: 0
Accepted

Test #1:

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

input:

4 50
2 0 0
2 1 0
2 0 1

output:

946149565 2 1
946149565 4 3
547293220
946149565 3 2
946149565 4 1
547293220
946149565 3 1
946149565 2 4
547293220
345685428 1 3 2 4

result:

points 1.0 points  1.0 Correct

Subtask #2:

score: 5
Accepted

Test #2:

score: 5
Accepted
time: 2ms
memory: 3712kb

input:

10 5000
5 1 1 1 1 1
4 1 0 1 0
5 1 0 0 1 0
4 1 0 0 0
4 1 0 0 1
5 1 1 0 0 0
2 1 1
4 1 0 0 0
4 0 0 1 1
5 0 0 1 0 0

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
547293220
946149565 4 1
946149565 3 2
946149565 8 5
946149565 7 6
547293220
946149565 4 2
946149565 1 3
946149565 8 6
946149565 5 7
946149565 9 10
547293220
946149565 6 1
946149565 8 3
946149565 5 2
946149565 7 4
547293220
946149...

result:

points 1.0 points  1.0 Correct

Test #3:

score: 0
Accepted
time: 5ms
memory: 3732kb

input:

100 5000
50 1 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1 1 0 0 0 0 0 1
50 1 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0
50 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 1 ...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #4:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

250 5000
125 1 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 1 0 0 1 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 0 1 1
124 1 0 1 0 1 0 1 0 1 1 0 0 1 0 1 0 1...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #5:

score: 0
Accepted
time: 11ms
memory: 3832kb

input:

500 5000
250 1 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 1 0 1...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #6:

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

input:

500 5000
250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #7:

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

input:

500 5000
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #8:

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

input:

500 5000
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #9:

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

input:

500 5000
250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #3:

score: 10
Accepted

Test #10:

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

input:

500 1000
250 1 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 1 0 1...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #11:

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

input:

500 1000
250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #12:

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

input:

500 1000
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #13:

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

input:

500 1000
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #14:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

500 1000
250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #4:

score: 3
Accepted

Test #15:

score: 3
Accepted
time: 3ms
memory: 3708kb

input:

10 5000
5 1 1 1 1 1
4 1 1 1 1
5 1 1 1 1 1
4 1 1 1 1
4 1 1 1 1
5 1 1 1 1 1
2 1 1
4 1 1 1 1
4 1 1 1 1
5 1 1 1 1 1

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
547293220
946149565 4 1
946149565 3 2
946149565 8 5
946149565 7 6
547293220
946149565 4 3
946149565 1 2
946149565 8 7
946149565 5 6
946149565 9 10
547293220
946149565 8 2
946149565 7 1
946149565 5 3
946149565 6 4
547293220
946149...

result:

points 1.0 points  1.0 Correct

Test #16:

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

input:

100 5000
50 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
50 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
50 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #5:

score: 2
Accepted

Dependency #4:

100%
Accepted

Test #17:

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

input:

10 5000
5 1 0 1 0 0
4 0 1 1 0
5 1 0 0 1 1
4 1 0 0 1
4 1 0 0 1
5 0 0 0 0 1
2 0 1
4 0 1 1 1
4 0 1 0 0
5 0 1 0 1 0

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
547293220
946149565 3 1
946149565 4 2
946149565 7 5
946149565 8 6
547293220
946149565 1 4
946149565 3 2
946149565 7 6
946149565 5 8
946149565 10 9
547293220
946149565 6 3
946149565 7 2
946149565 5 4
946149565 8 1
547293220
946149...

result:

points 1.0 points  1.0 Correct

Test #18:

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

input:

100 5000
50 0 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 0 1 0 0 0 0 1 1 0 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 1
50 0 1 0 1 1 1 1 1 1 0 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 0 1 0
50 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 1 0 1 0 1 0 1 0 0 1 1 1 ...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #6:

score: 9
Accepted

Dependency #4:

100%
Accepted

Test #19:

score: 9
Accepted
time: 2ms
memory: 3676kb

input:

250 5000
125 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
124 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #20:

score: 0
Accepted
time: 11ms
memory: 3692kb

input:

500 5000
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #7:

score: 6
Accepted

Dependency #2:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #21:

score: 6
Accepted
time: 7ms
memory: 3732kb

input:

250 5000
125 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 0 0 0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 1 1 1 0 0 0 0 1 1 0 1 1 0 1 0 1
124 0 1 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Test #22:

score: 0
Accepted
time: 5ms
memory: 3692kb

input:

500 5000
250 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 1 0 0 0 1 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 1 0 1 0 1 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 0 0 1 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 1 0 0 1...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #8:

score: 9
Accepted

Dependency #4:

100%
Accepted

Dependency #6:

100%
Accepted

Test #23:

score: 9
Accepted
time: 6ms
memory: 3832kb

input:

500 500
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #9:

score: 6
Accepted

Dependency #3:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Test #24:

score: 6
Accepted
time: 4ms
memory: 3692kb

input:

500 500
250 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 0 0 1 1 0 1 0 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 1 0 0 0 ...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #10:

score: 21
Accepted

Dependency #8:

100%
Accepted

Test #25:

score: 21
Accepted
time: 11ms
memory: 3816kb

input:

500 100
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #11:

score: 14
Accepted

Dependency #9:

100%
Accepted

Dependency #10:

100%
Accepted

Test #26:

score: 14
Accepted
time: 9ms
memory: 3744kb

input:

500 100
250 0 1 1 0 1 1 1 0 1 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 1 0 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 1 1 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 0 1 1 ...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #12:

score: 9
Accepted

Dependency #10:

100%
Accepted

Test #27:

score: 9
Accepted
time: 4ms
memory: 3692kb

input:

500 50
250 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:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct

Subtask #13:

score: 6
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Dependency #9:

100%
Accepted

Dependency #10:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Test #28:

score: 6
Accepted
time: 12ms
memory: 3780kb

input:

500 50
250 1 1 1 0 1 1 0 1 0 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1 1 1 0 1 1 1 0 1...

output:

946149565 2 1
946149565 4 3
946149565 6 5
946149565 8 7
946149565 10 9
946149565 12 11
946149565 14 13
946149565 16 15
946149565 18 17
946149565 20 19
946149565 22 21
946149565 24 23
946149565 26 25
946149565 28 27
946149565 30 29
946149565 32 31
946149565 34 33
946149565 36 35
946149565 38 37
94614...

result:

points 1.0 points  1.0 Correct