QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#873014#3315. Eulerian Flight TourZhangYiDeRE 1ms3840kbC++142.1kb2025-01-26 07:13:542025-01-26 07:13:54

詳細信息

Test #1:

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

input:

11 10
1 2
2 3
3 4
4 5
6 7
7 8
8 9
9 10
10 11
6 11

output:

6
3 5
1 3
5 11
5 10
4 11
4 10

result:

ok 

Test #2:

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

input:

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

output:

45
41 43
39 41
37 39
37 40
38 40
36 38
34 36
32 34
32 35
33 35
31 33
29 31
27 29
27 30
28 30
26 28
24 26
22 24
22 25
23 25
21 23
19 21
17 19
17 20
18 20
16 18
14 16
12 14
12 15
13 15
11 13
9 11
7 9
7 10
8 10
6 8
4 6
2 4
2 5
3 5
1 3
43 87
43 86
42 87
42 86

result:

ok 

Test #3:

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

input:

11 21
1 2
1 3
2 3
2 4
3 4
3 5
4 5
1 4
2 5
6 7
6 8
7 8
7 9
8 9
8 10
9 10
9 11
10 11
6 10
6 11
7 11

output:

5
1 5
5 11
5 10
4 11
4 10

result:

ok 

Test #4:

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

input:

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

output:

42
39 43
35 39
35 42
38 42
34 38
30 34
26 30
26 33
29 33
25 29
25 32
28 32
24 28
24 31
27 31
23 27
19 23
15 19
15 22
18 22
14 18
14 21
17 21
13 17
13 20
16 20
12 16
8 12
4 8
4 11
7 11
3 7
3 10
6 10
2 6
2 9
5 9
1 5
43 87
43 86
42 87
42 86

result:

ok 

Test #5:

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

input:

11 9
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
1 10

output:

4
1 2
1 3
3 11
1 11

result:

ok 

Test #6:

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

input:

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

output:

4
1 2
1 3
3 87
1 87

result:

ok 

Test #7:

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

input:

11 19
1 3
2 3
2 4
3 4
3 5
4 5
4 6
5 6
5 7
6 7
6 8
7 8
7 9
8 9
8 10
9 10
1 9
1 10
2 10

output:

4
1 2
1 4
4 11
1 11

result:

ok 

Test #8:

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

input:

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

output:

4
1 2
1 6
6 87
1 87

result:

ok 

Test #9:

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

input:

11 20
5 9
4 5
4 9
1 9
1 4
4 8
1 8
1 6
6 8
8 10
6 10
3 6
3 10
2 10
2 3
3 11
2 11
2 5
5 11
9 11

output:

3
1 5
5 7
1 7

result:

ok 

Test #10:

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

input:

87 344
38 45
45 70
45 75
45 72
38 70
38 75
38 72
35 38
70 75
70 72
35 70
47 70
72 75
35 75
47 75
4 75
35 72
47 72
4 72
23 72
35 47
4 35
23 35
35 85
4 47
23 47
47 85
47 82
4 23
4 85
4 82
2 4
23 85
23 82
2 23
13 23
82 85
2 85
13 85
80 85
2 82
13 82
80 82
57 82
2 13
2 80
2 57
2 15
13 80
13 57
13 15
13 ...

output:

3
1 25
25 54
1 54

result:

ok 

Test #11:

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

input:

100 4850
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 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
1 62...

output:

2
23 91
23 47

result:

ok 

Test #12:

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

input:

100 4849
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 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
1 62...

output:

3
45 98
24 76
24 75

result:

ok 

Test #13:

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

input:

100 4848
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 60
1 61
1 62...

output:

4
6 35
25 68
59 69
49 59

result:

ok 

Test #14:

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

input:

100 4804
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 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 59
1 60
1 61
1 62
1 63
1 64...

output:

45
36 43
70 71
43 70
12 14
12 86
37 86
41 86
73 86
43 86
43 84
3 84
21 90
75 90
3 90
4 24
6 8
6 78
9 89
10 60
13 38
15 29
15 35
16 79
42 85
18 85
19 33
59 72
59 83
22 83
25 48
30 63
30 77
45 61
31 45
31 66
65 68
32 68
32 57
47 69
57 58
57 74
93 95
97 99
57 97
1 26

result:

ok 

Test #15:

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

input:

100 4801
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 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 58
1 59
1 60
1 61
1 62
1 63...

output:

45
2 16
5 63
22 63
50 97
63 97
3 63
19 69
68 75
19 75
19 91
28 57
29 52
48 52
48 99
3 99
3 20
34 71
62 71
7 62
7 82
12 53
23 40
23 24
64 96
14 64
36 77
15 77
17 37
72 74
17 74
33 44
21 33
66 73
25 73
25 100
30 38
43 93
43 84
32 84
55 83
47 83
65 70
59 65
78 89
1 20

result:

ok 

Test #16:

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

input:

10 36
1 2
1 3
1 5
1 6
1 7
1 8
1 9
1 10
2 3
2 5
2 6
2 7
2 8
2 9
2 10
3 5
3 6
3 7
3 8
3 9
3 10
5 6
5 7
5 8
5 9
5 10
6 7
6 8
6 9
6 10
7 8
7 9
7 10
8 9
8 10
9 10

output:

-1

result:

ok 

Test #17:

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

input:

100 4851
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...

output:

-1

result:

ok 

Test #18:

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

input:

9 28
1 2
1 3
1 4
1 6
1 7
1 8
1 9
2 3
2 4
2 6
2 7
2 8
2 9
3 4
3 6
3 7
3 8
3 9
4 6
4 7
4 8
4 9
6 7
6 8
6 9
7 8
7 9
8 9

output:

8
2 5
3 5
4 5
5 6
5 7
5 8
5 9
1 5

result:

ok 

Test #19:

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

input:

99 4753
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
...

output:

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

result:

ok 

Test #20:

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

input:

96 0

output:

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

result:

ok 

Test #21:

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

input:

97 0

output:

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

result:

ok 

Test #22:

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

input:

10 40
1 2
1 3
1 4
1 6
1 7
1 8
1 9
1 10
2 4
2 5
2 6
2 7
2 8
2 9
2 10
3 4
3 5
3 6
3 7
3 8
3 9
3 10
4 5
4 7
4 8
4 9
4 10
5 6
5 7
5 8
5 9
5 10
6 7
6 8
6 9
6 10
7 9
7 10
8 9
8 10

output:

0

result:

ok 

Test #23:

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

input:

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

output:

0

result:

ok 

Test #24:

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

input:

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

output:

0

result:

ok 

Test #25:

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

input:

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

output:

0

result:

ok 

Test #26:

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

input:

50 960
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 12
1 13
1 16
1 17
1 18
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 33
1 35
1 36
1 38
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 50
2 3
2 5
2 7
2 8
2 10
2 11
2 12
2 14
2 15
2 17
2 18
2 19
2 20
2 22
2 23
2 24
2 25
2 27
2 28
2 29
2 30
2 31
2 32
...

output:

0

result:

ok 

Test #27:

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

input:

4 2
1 2
2 3

output:

2
3 4
1 4

result:

ok 

Test #28:

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

input:

4 3
1 2
2 3
1 3

output:

-1

result:

ok 

Test #29:

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

input:

4 3
1 2
2 3
3 4

output:

1
1 4

result:

ok 

Test #30:

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

input:

4 2
2 3
3 4

output:

2
1 4
1 2

result:

ok 

Test #31:

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

input:

4 2
3 4
1 4

output:

2
2 3
1 2

result:

ok 

Test #32:

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

input:

4 2
1 4
1 2

output:

2
3 4
2 3

result:

ok 

Test #33:

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

input:

98 4753
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
...

output:

-1

result:

ok 

Test #34:

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

input:

99 4851
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
...

output:

0

result:

ok 

Test #35:

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

input:

10 31
1 2
1 4
1 5
1 6
1 7
1 8
2 4
2 5
2 6
2 8
2 10
3 4
3 5
3 6
3 7
3 9
3 10
4 6
4 8
4 9
4 10
5 6
5 8
5 10
6 7
6 9
7 8
7 9
7 10
8 9
9 10

output:

5
4 7
2 7
2 3
6 8
3 8

result:

ok 

Test #36:

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

input:

100 4801
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 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
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
1 62
1 63...

output:

73
5 14
5 33
33 91
24 91
24 74
16 74
6 16
6 15
15 50
31 50
31 60
51 60
51 56
19 56
19 28
28 67
57 67
49 57
49 71
46 71
46 54
54 72
30 72
9 30
9 40
40 96
75 96
75 80
35 80
22 35
8 36
25 36
25 52
43 52
39 43
39 61
23 61
23 65
32 65
32 68
48 68
38 48
38 41
11 41
11 99
69 99
7 69
7 73
4 73
4 13
13 85
12...

result:

ok 

Test #37:

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

input:

100 4803
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 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 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64...

output:

68
7 21
21 54
47 54
2 47
2 56
16 56
10 16
10 35
35 46
6 46
6 29
27 86
86 95
8 95
8 14
14 25
25 26
26 58
58 77
41 77
41 50
50 96
13 96
13 23
23 45
12 45
12 69
67 69
11 67
11 62
37 62
37 73
73 84
42 84
42 68
20 68
20 100
3 100
3 61
28 61
28 98
30 98
30 36
29 36
34 94
34 88
18 88
18 89
9 89
9 24
24 53
...

result:

ok 

Test #38:

score: -100
Runtime Error

input:

92 4049
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
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
1 62
...

output:


result: