QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#175887#7178. Bishopsucup-team580#AC ✓18ms5228kbC++202.7kb2023-09-11 04:12:572023-09-11 04:12:58

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 5

output:

6
1 5
2 5
1 1
2 1
1 3
2 3

result:

ok n: 2, m: 5, bishops: 6

Test #2:

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

input:

5 5

output:

8
1 1
1 2
1 3
1 4
1 5
5 2
5 3
5 4

result:

ok n: 5, m: 5, bishops: 8

Test #3:

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

input:

100000 100000

output:

199998
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 ...

result:

ok n: 100000, m: 100000, bishops: 199998

Test #4:

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

input:

100000 99999

output:

199998
100000 1
100000 2
100000 3
100000 4
100000 5
100000 6
100000 7
100000 8
100000 9
100000 10
100000 11
100000 12
100000 13
100000 14
100000 15
100000 16
100000 17
100000 18
100000 19
100000 20
100000 21
100000 22
100000 23
100000 24
100000 25
100000 26
100000 27
100000 28
100000 29
100000 30
10...

result:

ok n: 100000, m: 99999, bishops: 199998

Test #5:

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

input:

100000 50000

output:

149998
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 ...

result:

ok n: 100000, m: 50000, bishops: 149998

Test #6:

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

input:

1 100000

output:

100000
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 ...

result:

ok n: 1, m: 100000, bishops: 100000

Test #7:

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

input:

34535 99889

output:

134423
34535 99888
34535 99889
34531 99888
34531 99889
34533 99888
34533 99889
34531 99883
34532 99883
34533 99883
34534 99883
34535 99883
34503 99883
34503 99884
34503 99885
34503 99886
34503 99887
34503 99888
34503 99889
34510 99883
34510 99884
34510 99885
34510 99886
34510 99887
34510 99888
34510...

result:

ok n: 34535, m: 99889, bishops: 134423

Test #8:

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

input:

12231 97889

output:

110119
12231 97888
12231 97889
12219 97888
12219 97889
12221 97888
12221 97889
12223 97888
12223 97889
12225 97888
12225 97889
12227 97888
12227 97889
12229 97888
12229 97889
12219 97849
12220 97849
12221 97849
12222 97849
12223 97849
12224 97849
12225 97849
12226 97849
12227 97849
12228 97849
12229...

result:

ok n: 12231, m: 97889, bishops: 110119

Test #9:

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

input:

10000 100000

output:

109998
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61...

result:

ok n: 10000, m: 100000, bishops: 109998

Test #10:

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

input:

13 99999

output:

100011
13 99997
13 99998
13 99999
1 99997
1 99998
1 99999
4 99997
4 99998
4 99999
7 99997
7 99998
7 99999
10 99997
10 99998
10 99999
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
13 14
1 27
2 27
3 27
4 27
5 27
6 27
7 27
8 27
9 ...

result:

ok n: 13, m: 99999, bishops: 100011

Test #11:

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

input:

21 99999

output:

100019
19 99982
20 99982
21 99982
19 99985
20 99985
21 99985
19 99988
20 99988
21 99988
19 99991
20 99991
21 99991
19 99994
20 99994
21 99994
20 99996
19 99998
21 99998
19 99999
21 99999
1 99982
1 99983
1 99984
1 99985
1 99986
1 99987
1 99988
1 99989
1 99990
1 99991
1 99992
1 99993
1 99994
1 99995
1...

result:

ok n: 21, m: 99999, bishops: 100019

Test #12:

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

input:

49999 100000

output:

149998
49999 99999
49999 100000
1 99999
1 100000
3 99999
3 100000
5 99999
5 100000
7 99999
7 100000
9 99999
9 100000
11 99999
11 100000
13 99999
13 100000
15 99999
15 100000
17 99999
17 100000
19 99999
19 100000
21 99999
21 100000
23 99999
23 100000
25 99999
25 100000
27 99999
27 100000
29 99999
29 ...

result:

ok n: 49999, m: 100000, bishops: 149998

Test #13:

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

input:

33333 99999

output:

133331
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61...

result:

ok n: 33333, m: 99999, bishops: 133331

Test #14:

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

input:

23342 98876

output:

122216
23315 98875
23315 98876
23317 98875
23317 98876
23319 98875
23319 98876
23321 98875
23321 98876
23323 98875
23323 98876
23325 98875
23325 98876
23327 98875
23327 98876
23329 98875
23329 98876
23331 98875
23331 98876
23333 98875
23333 98876
23335 98875
23335 98876
23337 98875
23337 98876
23339...

result:

ok n: 23342, m: 98876, bishops: 122216

Test #15:

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

input:

56713 91234

output:

147946
54249 91234
54250 91234
54251 91234
54252 91234
54253 91234
54254 91234
54255 91234
54256 91234
54257 91234
54258 91234
54259 91234
54260 91234
54261 91234
54262 91234
54263 91234
54264 91234
54265 91234
54266 91234
54267 91234
54268 91234
54269 91234
54270 91234
54271 91234
54272 91234
54273...

result:

ok n: 56713, m: 91234, bishops: 147946

Test #16:

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

input:

99995 99995

output:

199988
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 ...

result:

ok n: 99995, m: 99995, bishops: 199988

Test #17:

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

input:

12345 54321

output:

66665
12343 54307
12344 54307
12345 54307
12343 54310
12344 54310
12345 54310
12343 54313
12344 54313
12345 54313
12343 54316
12344 54316
12345 54316
12344 54318
12343 54320
12345 54320
12343 54321
12345 54321
9883 54307
9883 54308
9883 54309
9883 54310
9883 54311
9883 54312
9883 54313
9883 54314
98...

result:

ok n: 12345, m: 54321, bishops: 66665

Test #18:

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

input:

90000 92000

output:

181998
1 90001
1 90002
1 90003
1 90004
1 90005
1 90006
1 90007
1 90008
1 90009
1 90010
1 90011
1 90012
1 90013
1 90014
1 90015
1 90016
1 90017
1 90018
1 90019
1 90020
1 90021
1 90022
1 90023
1 90024
1 90025
1 90026
1 90027
1 90028
1 90029
1 90030
1 90031
1 90032
1 90033
1 90034
1 90035
1 90036
1 900...

result:

ok n: 90000, m: 92000, bishops: 181998

Test #19:

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

input:

10000 70000

output:

79998
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61 ...

result:

ok n: 10000, m: 70000, bishops: 79998

Test #20:

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

input:

10000 70001

output:

80000
1 70001
2 70001
3 70001
4 70001
5 70001
6 70001
7 70001
8 70001
9 70001
10 70001
11 70001
12 70001
13 70001
14 70001
15 70001
16 70001
17 70001
18 70001
19 70001
20 70001
21 70001
22 70001
23 70001
24 70001
25 70001
26 70001
27 70001
28 70001
29 70001
30 70001
31 70001
32 70001
33 70001
34 700...

result:

ok n: 10000, m: 70001, bishops: 80000

Test #21:

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

input:

10000 80000

output:

89998
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61 ...

result:

ok n: 10000, m: 80000, bishops: 89998

Test #22:

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

input:

10000 80001

output:

90000
1 80001
2 80001
3 80001
4 80001
5 80001
6 80001
7 80001
8 80001
9 80001
10 80001
11 80001
12 80001
13 80001
14 80001
15 80001
16 80001
17 80001
18 80001
19 80001
20 80001
21 80001
22 80001
23 80001
24 80001
25 80001
26 80001
27 80001
28 80001
29 80001
30 80001
31 80001
32 80001
33 80001
34 800...

result:

ok n: 10000, m: 80001, bishops: 90000

Test #23:

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

input:

10000 80002

output:

90000
1 80001
1 80002
3 80001
3 80002
5 80001
5 80002
7 80001
7 80002
9 80001
9 80002
11 80001
11 80002
13 80001
13 80002
15 80001
15 80002
17 80001
17 80002
19 80001
19 80002
21 80001
21 80002
23 80001
23 80002
25 80001
25 80002
27 80001
27 80002
29 80001
29 80002
31 80001
31 80002
33 80001
33 8000...

result:

ok n: 10000, m: 80002, bishops: 90000

Test #24:

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

input:

10000 79999

output:

89998
10000 70001
10000 70002
10000 70003
10000 70004
10000 70005
10000 70006
10000 70007
10000 70008
10000 70009
10000 70010
10000 70011
10000 70012
10000 70013
10000 70014
10000 70015
10000 70016
10000 70017
10000 70018
10000 70019
10000 70020
10000 70021
10000 70022
10000 70023
10000 70024
10000 ...

result:

ok n: 10000, m: 79999, bishops: 89998

Test #25:

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

input:

10000 79998

output:

89996
9999 70001
10000 70001
9999 70003
10000 70003
9999 70005
10000 70005
9999 70007
10000 70007
9999 70009
10000 70009
9999 70011
10000 70011
9999 70013
10000 70013
9999 70015
10000 70015
9999 70017
10000 70017
9999 70019
10000 70019
9999 70021
10000 70021
9999 70023
10000 70023
9999 70025
10000 7...

result:

ok n: 10000, m: 79998, bishops: 89996

Test #26:

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

input:

11111 100000

output:

111110
1 100000
2 100000
3 100000
4 100000
5 100000
6 100000
7 100000
8 100000
9 100000
10 100000
11 100000
12 100000
13 100000
14 100000
15 100000
16 100000
17 100000
18 100000
19 100000
20 100000
21 100000
22 100000
23 100000
24 100000
25 100000
26 100000
27 100000
28 100000
29 100000
30 100000
31...

result:

ok n: 11111, m: 100000, bishops: 111110

Test #27:

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

input:

1 1

output:

1
1 1

result:

ok n: 1, m: 1, bishops: 1

Extra Test:

score: 0
Extra Test Passed