QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#484716#2495. Knight's Moveucup-team1005TL 1087ms5048kbC++203.6kb2024-07-19 21:48:182024-07-19 21:48:19

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4

output:

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

result:

ok good job

Test #2:

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

input:

6

output:

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

result:

ok good job

Test #3:

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

input:

8

output:

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

result:

ok good job

Test #4:

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

input:

10

output:

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

result:

ok good job

Test #5:

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

input:

12

output:

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

result:

ok good job

Test #6:

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

input:

14

output:

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

result:

ok good job

Test #7:

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

input:

16

output:

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

result:

ok good job

Test #8:

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

input:

18

output:

15 13 1
14 15 1
15 17 1
15 17 0
17 16 0
17 16 1
16 14 1
18 15 1
18 15 0
17 13 0
17 13 1
15 12 1
17 11 1
16 13 1
15 15 1
14 17 1
12 18 1
12 18 0
14 17 0
16 18 0
16 18 1
15 16 1
14 14 1
14 14 0
16 15 0
14 16 0
13 18 0
12 16 0
10 17 0
8 18 0
7 16 0
6 18 0
6 18 1
4 17 1
3 15 1
5 14 1
5 14 0
3 15 0
1 16 ...

result:

ok good job

Test #9:

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

input:

20

output:

7 19 0
8 17 0
7 15 0
6 17 0
4 18 0
2 19 0
1 17 0
3 16 0
1 15 0
2 17 0
3 15 0
3 15 1
4 17 1
2 16 1
3 18 1
4 20 1
2 19 1
1 17 1
2 15 1
2 15 0
4 16 0
4 16 1
5 14 1
4 12 1
2 13 1
1 15 1
2 17 1
3 19 1
1 18 1
2 20 1
4 19 1
3 17 1
3 17 0
1 16 0
2 18 0
3 20 0
1 19 0
1 19 1
3 20 1
4 18 1
5 20 1
5 20 0
3 19 0...

result:

ok good job

Test #10:

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

input:

22

output:

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

result:

ok good job

Test #11:

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

input:

24

output:

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

result:

ok good job

Test #12:

score: 0
Accepted
time: 28ms
memory: 3916kb

input:

26

output:

23 26 1
25 25 1
25 25 0
23 26 0
24 24 0
26 23 0
26 23 1
24 24 1
22 25 1
20 26 1
19 24 1
18 22 1
18 22 0
17 20 0
17 20 1
19 21 1
21 20 1
19 19 1
21 18 1
23 19 1
25 18 1
24 20 1
26 19 1
25 21 1
24 23 1
26 22 1
25 20 1
24 18 1
24 18 0
25 16 0
26 14 0
26 14 1
24 13 1
25 15 1
25 15 0
26 17 0
26 17 1
25 1...

result:

ok good job

Test #13:

score: 0
Accepted
time: 23ms
memory: 3868kb

input:

28

output:

4 19 1
5 17 1
5 17 0
7 18 0
6 16 0
5 18 0
7 19 0
5 20 0
6 22 0
7 24 0
7 24 1
6 22 1
5 20 1
4 22 1
5 24 1
6 26 1
8 27 1
10 28 1
10 28 0
8 27 0
6 28 0
6 28 1
5 26 1
3 27 1
2 25 1
4 24 1
2 23 1
1 25 1
3 24 1
1 23 1
1 23 0
3 24 0
5 25 0
4 23 0
6 24 0
5 26 0
3 27 0
2 25 0
3 23 0
1 24 0
3 25 0
5 24 0
7 23...

result:

ok good job

Test #14:

score: 0
Accepted
time: 67ms
memory: 3900kb

input:

30

output:

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

result:

ok good job

Test #15:

score: 0
Accepted
time: 54ms
memory: 4064kb

input:

32

output:

19 24 0
17 25 0
16 23 0
18 22 0
17 20 0
17 20 1
16 18 1
16 18 0
14 17 0
16 16 0
15 18 0
17 17 0
19 16 0
18 18 0
18 18 1
19 20 1
17 19 1
15 20 1
17 21 1
18 23 1
16 24 1
15 22 1
13 23 1
12 21 1
14 22 1
15 24 1
16 22 1
16 22 0
18 21 0
19 19 0
20 21 0
21 23 0
20 25 0
18 24 0
18 24 1
17 26 1
18 28 1
16 2...

result:

ok good job

Test #16:

score: 0
Accepted
time: 71ms
memory: 4348kb

input:

34

output:

22 17 0
24 16 0
22 15 0
24 14 0
26 15 0
25 17 0
24 19 0
23 17 0
21 16 0
21 16 1
22 18 1
22 18 0
20 17 0
19 15 0
18 17 0
20 18 0
19 20 0
17 19 0
19 18 0
17 17 0
18 19 0
16 18 0
15 20 0
14 22 0
13 20 0
13 20 1
15 19 1
14 17 1
12 16 1
13 18 1
15 17 1
17 16 1
19 17 1
21 18 1
23 17 1
22 15 1
21 17 1
22 1...

result:

ok good job

Test #17:

score: 0
Accepted
time: 88ms
memory: 4376kb

input:

36

output:

10 26 1
12 25 1
13 27 1
11 28 1
10 30 1
8 29 1
8 29 0
9 27 0
7 26 0
6 28 0
5 30 0
4 28 0
6 27 0
5 29 0
4 27 0
2 26 0
1 28 0
2 30 0
4 29 0
6 30 0
6 30 1
8 31 1
7 29 1
6 31 1
7 33 1
6 35 1
6 35 0
7 33 0
5 32 0
4 30 0
6 29 0
7 31 0
8 33 0
10 32 0
11 30 0
12 32 0
13 34 0
12 36 0
12 36 1
11 34 1
13 35 1
...

result:

ok good job

Test #18:

score: 0
Accepted
time: 79ms
memory: 4148kb

input:

38

output:

5 32 1
6 34 1
7 36 1
6 38 1
4 37 1
3 35 1
5 36 1
5 36 0
6 34 0
5 32 0
3 31 0
3 31 1
1 32 1
3 33 1
4 35 1
4 35 0
2 36 0
4 37 0
6 38 0
8 37 0
10 38 0
10 38 1
8 37 1
10 36 1
12 37 1
14 38 1
15 36 1
16 38 1
16 38 0
15 36 0
17 35 0
19 36 0
21 35 0
20 33 0
22 32 0
23 34 0
24 32 0
26 31 0
24 30 0
24 30 1
2...

result:

ok good job

Test #19:

score: 0
Accepted
time: 104ms
memory: 4164kb

input:

40

output:

6 19 0
6 19 1
4 18 1
3 20 1
1 21 1
2 19 1
1 17 1
1 17 0
2 19 0
4 20 0
3 18 0
1 19 0
2 17 0
4 18 0
5 20 0
5 20 1
7 21 1
8 23 1
10 24 1
11 26 1
10 28 1
8 27 1
9 29 1
11 30 1
12 32 1
10 31 1
9 33 1
7 34 1
5 35 1
3 34 1
3 34 0
1 33 0
1 33 1
2 35 1
1 37 1
2 39 1
4 38 1
5 40 1
7 39 1
8 37 1
10 36 1
12 37 ...

result:

ok good job

Test #20:

score: 0
Accepted
time: 279ms
memory: 4264kb

input:

42

output:

3 31 1
1 30 1
1 30 0
3 29 0
5 28 0
6 26 0
7 28 0
7 28 1
9 29 1
11 30 1
10 28 1
10 28 0
12 27 0
10 26 0
12 25 0
12 25 1
10 26 1
9 24 1
8 26 1
6 27 1
5 29 1
5 29 0
3 30 0
5 31 0
4 33 0
4 33 1
2 32 1
2 32 0
1 34 0
2 36 0
3 38 0
5 37 0
7 36 0
6 38 0
6 38 1
4 37 1
2 38 1
4 39 1
4 39 0
3 41 0
1 42 0
1 42 ...

result:

ok good job

Test #21:

score: 0
Accepted
time: 332ms
memory: 4536kb

input:

44

output:

6 40 0
5 42 0
3 43 0
3 43 1
1 44 1
1 44 0
2 42 0
1 40 0
1 40 1
3 39 1
3 39 0
1 38 0
2 36 0
3 38 0
1 37 0
1 37 1
2 39 1
2 39 0
1 41 0
1 41 1
3 42 1
1 43 1
3 44 1
3 44 0
4 42 0
2 43 0
3 41 0
1 42 0
1 42 1
2 44 1
2 44 0
4 43 0
6 44 0
8 43 0
9 41 0
11 42 0
10 44 0
10 44 1
8 43 1
9 41 1
11 40 1
12 42 1
1...

result:

ok good job

Test #22:

score: 0
Accepted
time: 405ms
memory: 4168kb

input:

46

output:

20 29 1
19 27 1
17 28 1
18 30 1
16 31 1
14 30 1
15 32 1
15 32 0
17 31 0
15 30 0
15 30 1
17 31 1
18 29 1
17 27 1
15 26 1
14 28 1
16 29 1
15 31 1
17 30 1
15 29 1
16 27 1
17 29 1
19 30 1
18 28 1
18 28 0
17 26 0
16 24 0
18 25 0
17 23 0
16 25 0
15 23 0
14 25 0
13 27 0
15 26 0
16 28 0
16 28 1
17 26 1
15 2...

result:

ok good job

Test #23:

score: 0
Accepted
time: 260ms
memory: 4220kb

input:

48

output:

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

result:

ok good job

Test #24:

score: 0
Accepted
time: 276ms
memory: 4508kb

input:

50

output:

23 45 0
24 47 0
25 49 0
27 50 0
29 49 0
27 48 0
28 46 0
26 45 0
24 44 0
22 43 0
24 42 0
23 40 0
22 42 0
24 43 0
23 41 0
24 39 0
25 37 0
27 38 0
28 36 0
26 37 0
25 39 0
24 41 0
24 41 1
25 43 1
27 44 1
29 45 1
30 43 1
28 42 1
26 43 1
27 45 1
25 46 1
24 48 1
24 48 0
25 46 0
26 48 0
26 48 1
27 50 1
28 4...

result:

ok good job

Test #25:

score: 0
Accepted
time: 325ms
memory: 4644kb

input:

52

output:

31 1 0
29 2 0
27 1 0
27 1 1
29 2 1
30 4 1
32 5 1
31 3 1
30 1 1
30 1 0
28 2 0
26 3 0
25 1 0
23 2 0
21 1 0
19 2 0
17 1 0
15 2 0
13 3 0
11 4 0
11 4 1
12 6 1
13 4 1
13 4 0
14 2 0
16 1 0
18 2 0
16 3 0
15 1 0
14 3 0
12 2 0
10 1 0
10 1 1
12 2 1
10 3 1
10 3 0
12 4 0
14 5 0
15 7 0
16 5 0
14 4 0
14 4 1
15 2 1...

result:

ok good job

Test #26:

score: 0
Accepted
time: 215ms
memory: 4696kb

input:

54

output:

30 16 0
31 18 0
32 20 0
34 19 0
35 17 0
36 15 0
34 16 0
32 15 0
31 13 0
30 11 0
32 12 0
33 14 0
31 15 0
29 14 0
28 16 0
26 17 0
25 19 0
25 19 1
24 21 1
24 21 0
22 20 0
21 18 0
20 20 0
21 22 0
23 23 0
23 23 1
25 22 1
27 23 1
26 25 1
28 24 1
30 23 1
31 25 1
32 23 1
33 25 1
31 24 1
29 25 1
30 27 1
28 2...

result:

ok good job

Test #27:

score: 0
Accepted
time: 746ms
memory: 4512kb

input:

56

output:

36 53 0
34 54 0
32 53 0
30 52 0
32 51 0
34 52 0
35 50 0
33 49 0
34 51 0
36 52 0
35 54 0
37 53 0
36 51 0
37 49 0
36 47 0
35 45 0
36 43 0
38 42 0
40 43 0
39 45 0
39 45 1
40 43 1
42 44 1
42 44 0
40 45 0
42 46 0
42 46 1
43 44 1
45 45 1
46 47 1
48 48 1
49 50 1
48 52 1
47 54 1
46 56 1
48 55 1
49 53 1
48 5...

result:

ok good job

Test #28:

score: 0
Accepted
time: 1087ms
memory: 4776kb

input:

58

output:

44 58 0
42 57 0
40 58 0
40 58 1
42 57 1
41 55 1
43 54 1
42 56 1
43 58 1
44 56 1
42 55 1
43 57 1
45 58 1
47 57 1
46 55 1
45 57 1
47 58 1
48 56 1
50 57 1
50 57 0
48 56 0
49 58 0
49 58 1
50 56 1
52 57 1
53 55 1
51 56 1
52 58 1
52 58 0
51 56 0
49 55 0
49 55 1
48 53 1
50 52 1
51 50 1
53 49 1
53 49 0
55 5...

result:

ok good job

Test #29:

score: 0
Accepted
time: 786ms
memory: 4576kb

input:

60

output:

16 59 0
18 58 0
19 60 0
21 59 0
23 60 0
25 59 0
26 57 0
28 58 0
27 60 0
27 60 1
29 59 1
28 57 1
27 55 1
29 56 1
28 54 1
29 52 1
29 52 0
28 54 0
27 56 0
29 57 0
29 57 1
27 56 1
28 58 1
29 60 1
31 59 1
33 60 1
33 60 0
34 58 0
34 58 1
35 60 1
35 60 0
36 58 0
36 58 1
37 60 1
37 60 0
38 58 0
36 59 0
38 6...

result:

ok good job

Test #30:

score: 0
Accepted
time: 1015ms
memory: 4936kb

input:

62

output:

36 12 0
37 14 0
37 14 1
36 12 1
35 10 1
34 8 1
32 7 1
32 7 0
34 8 0
33 6 0
35 5 0
37 6 0
35 7 0
34 9 0
33 11 0
35 12 0
36 10 0
36 10 1
35 8 1
34 6 1
36 5 1
34 4 1
36 3 1
35 1 1
33 2 1
31 1 1
32 3 1
34 2 1
35 4 1
35 4 0
34 2 0
36 3 0
37 1 0
37 1 1
38 3 1
36 2 1
38 1 1
39 3 1
38 5 1
37 3 1
36 1 1
36 1...

result:

ok good job

Test #31:

score: 0
Accepted
time: 1017ms
memory: 4836kb

input:

64

output:

37 30 1
39 31 1
40 29 1
42 30 1
41 32 1
40 30 1
38 29 1
40 28 1
42 29 1
44 30 1
43 32 1
42 34 1
42 34 0
43 32 0
45 33 0
44 35 0
43 33 0
44 31 0
44 31 1
45 29 1
43 30 1
41 29 1
41 29 0
42 27 0
43 25 0
41 24 0
42 22 0
40 23 0
39 21 0
39 21 1
37 22 1
38 24 1
39 22 1
41 21 1
42 19 1
40 18 1
38 17 1
39 1...

result:

ok good job

Test #32:

score: 0
Accepted
time: 610ms
memory: 5048kb

input:

66

output:

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

result:

ok good job

Test #33:

score: -100
Time Limit Exceeded

input:

68

output:


result: