QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#219671#6381. LaLa and Harvestingucup-team017#WA 1ms4708kbC++144.3kb2023-10-19 17:20:202023-10-19 17:20:20

詳細信息

Test #1:

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

input:

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

output:

2 2
1 3

result:

ok n=6, m=7, k=1, w=2

Test #2:

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

input:

2 1
2 5
0 1
1
0 1

output:

5 1
1

result:

ok n=2, m=1, k=1, w=5

Test #3:

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

input:

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

output:

2 1
2

result:

ok n=3, m=3, k=1, w=2

Test #4:

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

input:

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

output:

5 2
1 2

result:

ok n=4, m=4, k=1, w=5

Test #5:

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

input:

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

output:

7 2
2 3

result:

ok n=5, m=5, k=1, w=7

Test #6:

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

input:

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

output:

8 2
0 4

result:

ok n=6, m=6, k=1, w=8

Test #7:

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

input:

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

output:

8 2
0 6

result:

ok n=7, m=9, k=1, w=8

Test #8:

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

input:

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

output:

12 3
2 3 4

result:

ok n=8, m=10, k=1, w=12

Test #9:

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

input:

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

output:

13 3
0 4 6

result:

ok n=9, m=10, k=1, w=13

Test #10:

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

input:

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

output:

19 4
1 3 7 8

result:

ok n=10, m=11, k=1, w=19

Test #11:

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

input:

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

output:

17 5
0 2 3 8 9

result:

ok n=11, m=12, k=1, w=17

Test #12:

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

input:

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

output:

16 4
1 5 6 7

result:

ok n=12, m=13, k=1, w=16

Test #13:

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

input:

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

output:

21 5
1 4 5 7 9

result:

ok n=13, m=16, k=1, w=21

Test #14:

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

input:

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

output:

21 6
0 1 4 5 6 11

result:

ok n=14, m=17, k=1, w=21

Test #15:

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

input:

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

output:

31 7
0 1 5 8 9 11 12

result:

ok n=15, m=18, k=1, w=31

Test #16:

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

input:

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

output:

24 7
0 4 5 7 8 9 15

result:

ok n=16, m=20, k=1, w=24

Test #17:

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

input:

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

output:

23 5
0 5 11 15 16

result:

ok n=17, m=21, k=1, w=23

Test #18:

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

input:

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

output:

29 8
0 1 3 6 7 10 11 12

result:

ok n=18, m=21, k=1, w=29

Test #19:

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

input:

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

output:

29 7
1 5 6 10 15 16 18

result:

ok n=19, m=23, k=1, w=29

Test #20:

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

input:

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

output:

28 8
3 4 6 11 12 14 15 17

result:

ok n=20, m=24, k=1, w=28

Test #21:

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

input:

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

output:

31 5
1 2 5 6 8

result:

ok n=14, m=17, k=13, w=31

Test #22:

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

input:

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

output:

38 7
0 1 4 6 8 9 10

result:

ok n=15, m=17, k=14, w=38

Test #23:

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

input:

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

output:

41 6
2 3 5 7 9 14

result:

ok n=16, m=19, k=15, w=41

Test #24:

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

input:

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

output:

50 8
0 2 6 7 8 11 12 15

result:

ok n=17, m=19, k=16, w=50

Test #25:

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

input:

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

output:

47 7
4 7 9 11 14 15 17

result:

ok n=18, m=21, k=17, w=47

Test #26:

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

input:

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

output:

59 8
5 11 12 13 15 16 17 18

result:

ok n=19, m=22, k=18, w=59

Test #27:

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

input:

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

output:

56 10
0 2 3 6 7 10 11 13 14 17

result:

ok n=20, m=23, k=19, w=56

Test #28:

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

input:

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

output:

46 7
2 3 4 6 7 9 20

result:

ok n=21, m=25, k=20, w=46

Test #29:

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

input:

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

output:

58 9
1 6 7 11 12 13 16 17 20

result:

ok n=22, m=25, k=21, w=58

Test #30:

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

input:

23 25
9 1 1 8 7 1 8 7 5 7 8 2 6 1 1 10 4 7 4 9 4 9 8
0 2
2 3
4 6
11 12
7 12
7 19
1 14
5 16
8 17
5 18
5 15
2 20
2 10
8 10
1 8
1 9
9 13
13 19
6 19
6 15
15 21
15 22
0 22
15 18
12 19
22
4 8
8 9
8 14
8 20
8 18
8 22
7 8
8 11
8 12
1 8
8 17
2 8
8 15
8 19
3 8
8 21
8 13
8 16
8 10
0 8
5 8
6 8

output:

61 9
0 6 7 9 10 11 16 17 21

result:

ok n=23, m=25, k=22, w=61

Test #31:

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

input:

24 31
5 2 9 5 3 8 5 9 1 4 5 3 3 5 7 4 5 3 6 10 5 10 8 2
3 10
19 20
8 22
13 15
4 18
17 20
12 14
3 9
10 16
14 18
6 20
10 22
9 21
1 10
5 10
1 2
10 14
0 22
13 14
10 23
11 22
17 23
7 8
0 11
6 17
10 17
15 22
4 14
2 10
9 10
7 22
23
15 21
9 15
3 15
15 19
15 23
14 15
10 15
2 15
15 16
15 22
12 15
0 15
13 15
6...

output:

59 9
2 3 12 13 17 18 19 21 22

result:

ok n=24, m=31, k=23, w=59

Test #32:

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

input:

25 31
5 5 3 9 4 4 3 3 7 3 10 6 6 5 4 9 4 3 6 2 3 9 6 8 7
5 16
5 18
0 8
5 14
14 19
11 23
7 12
3 13
0 5
2 15
1 13
6 8
1 10
13 22
9 17
8 9
5 7
0 24
5 15
4 8
23 24
3 20
13 24
4 21
0 10
13 20
11 24
0 2
5 19
0 4
8 17
24
8 21
15 21
6 21
12 21
2 21
16 21
0 21
21 24
9 21
14 21
7 21
21 23
21 22
10 21
18 21
5 ...

output:

62 10
3 4 6 9 10 12 14 15 18 23

result:

ok n=25, m=31, k=24, w=62

Test #33:

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

input:

26 34
4 3 1 8 5 7 8 7 10 1 4 7 3 8 9 1 1 6 4 7 1 8 7 3 7 9
7 16
9 13
5 7
2 12
17 20
21 22
6 12
2 7
3 9
4 22
1 7
7 19
2 21
6 8
0 19
19 24
1 15
10 17
3 19
2 14
1 17
8 18
7 11
24 25
16 23
3 13
0 3
19 25
11 19
7 10
4 21
7 21
2 18
7 23
25
11 12
12 19
12 18
12 15
9 12
12 24
3 12
12 25
5 12
12 21
1 12
4 12...

output:

63 9
3 5 8 11 14 16 17 21 24

result:

ok n=26, m=34, k=25, w=63

Test #34:

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

input:

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

output:

84 11
1 2 7 8 9 15 17 20 22 25 26

result:

ok n=27, m=31, k=26, w=84

Test #35:

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

input:

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

output:

65 10
0 2 5 6 7 11 12 14 15 23

result:

ok n=28, m=33, k=27, w=65

Test #36:

score: -100
Wrong Answer
time: 1ms
memory: 4708kb

input:

480 590
52461 193617 43183 44047 2417 66830 101148 194061 145702 67165 25530 172608 39570 3430 5764 159601 54767 12589 129342 11637 51924 36436 11777 183578 95339 38711 145638 98067 38118 27252 158327 133122 83099 175672 69853 40285 121707 56481 50535 183972 70271 163679 107532 45349 17660 180580 12...

output:

23707995 201
1 2 6 7 8 10 11 22 23 26 28 29 32 34 35 36 41 45 47 49 56 57 58 60 62 63 64 65 66 67 70 72 73 74 75 76 77 78 79 80 83 84 86 87 91 92 93 94 96 98 99 101 103 105 107 110 113 116 123 124 126 127 128 134 135 139 141 142 143 145 151 155 157 158 159 161 163 165 169 170 176 178 184 186 187 190...

result:

wrong answer The set contains adjacent nodes