QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#399550#2823. 改善生活ucup-team1383AC ✓25ms51400kbC++171.3kb2024-04-26 14:48:512024-04-26 14:48:52

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 13ms
memory: 50524kb

input:

7 8
2 2 1 1 3 3 4
100 100 40 20 100 50 40
1 3
2 3
1 4
2 4
3 5
4 6
3 7
4 7

output:

2

result:

ok single line: '2'

Test #2:

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

input:

15 36
1 1 1 1 1 1 1 3 3 4 5 5 6 4 2
1 5 4 16 1 16 9 98 84 69 4 95 53 99 64
1 8
2 8
3 8
4 8
5 8
6 8
7 8
8 9
8 11
9 8
9 10
9 11
9 12
9 14
10 8
10 11
10 12
11 8
11 9
11 10
11 12
11 14
12 13
12 14
13 8
13 9
13 10
13 12
13 14
13 15
14 10
14 13
14 15
15 9
15 11
15 13

output:

182

result:

ok single line: '182'

Test #3:

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

input:

700 200
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 688 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 126 1 1 1 1 1 1 1 1 1 1 1 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:

77

result:

ok single line: '77'

Test #4:

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

input:

700 2000
1 1 1 1 1 1 1 1 1 1 1 122 1 1 1 1 1 1 1 1 1 1 62 1 1 1 1 1 1 1 1 1 1 1 1 367 1 1 317 1 1 318 1 1 1 215 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 152 105 1 1 1 1 1 1 1 1 1 1 1 1 694 342 164 158 1 529 1 1 1 1 1 71 517 1 1 221 1 619 1 1 1 1 171 597 665 1 210 101 1 91 1 1 69 1 1 1 230 590 1 412 1 1 1 1 1 4...

output:

77

result:

ok single line: '77'

Test #5:

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

input:

700 60000
1 1 41 1 364 447 498 1 1 1 407 543 471 516 97 423 531 147 88 1 266 1 468 114 65 357 202 1 257 250 295 309 228 640 201 401 534 50 416 650 116 470 333 344 688 178 225 683 295 490 426 439 688 180 293 219 241 209 139 460 659 699 659 408 172 146 649 399 123 567 145 90 490 626 630 270 161 541 13...

output:

77

result:

ok single line: '77'

Test #6:

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

input:

700 60000
1 1 299 1 1 170 38 275 272 595 1 267 416 414 29 1 651 146 393 585 413 669 659 235 166 453 396 637 87 228 153 366 608 467 321 434 296 317 65 162 484 359 366 487 580 657 650 126 680 531 413 281 65 339 542 44 154 372 121 144 610 143 341 612 186 183 407 628 146 628 333 420 504 521 429 234 677 ...

output:

13

result:

ok single line: '13'

Test #7:

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

input:

700 60000
1 1 1 1 240 1 68 228 1 167 573 449 1 529 1 240 529 176 207 222 529 462 609 323 19 581 132 252 408 448 470 424 562 53 442 40 26 311 623 123 185 247 400 630 231 622 343 268 639 572 368 396 173 531 60 296 309 317 102 68 561 77 232 148 657 677 406 648 626 448 63 50 29 417 19 231 525 500 20 78 ...

output:

84

result:

ok single line: '84'

Test #8:

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

input:

200 350
1 1 1 1 22 1 1 1 1 1 21 1 1 1 84 1 1 1 1 49 1 1 40 48 1 17 1 39 1 39 1 1 53 127 1 47 59 9 1 23 1 73 1 5 15 18 20 14 1 45 3 65 1 9 56 2 57 1 105 1 1 1 22 1 43 6 3 34 8 56 78 1 12 47 18 75 2 50 17 12 27 37 1 13 54 15 2 11 36 13 24 52 138 10 35 17 44 15 38 22 54 29 3 55 16 24 31 11 42 86 13 12 ...

output:

116

result:

ok single line: '116'

Test #9:

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

input:

300 541
1 1 1 1 1 1 1 1 1 1 200 1 1 1 1 30 1 1 1 1 1 1 1 1 1 44 1 1 1 83 1 1 1 1 1 1 1 1 34 71 1 1 1 1 1 1 109 1 1 78 11 1 1 1 1 35 24 1 1 24 49 1 29 13 1 1 5 30 64 1 121 140 1 1 20 1 100 21 4 39 1 27 54 1 1 1 1 116 98 1 1 1 1 1 1 1 1 19 190 3 3 227 44 36 34 84 10 3 1 1 31 45 1 50 11 1 1 178 52 1 67...

output:

190

result:

ok single line: '190'

Test #10:

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

input:

400 1140
1 1 1 1 1 1 240 1 1 1 101 1 1 1 1 1 2 29 1 155 1 1 51 1 1 1 1 1 1 1 1 128 1 89 1 18 42 1 1 1 28 15 88 1 1 73 1 1 1 56 1 1 50 1 1 1 84 148 1 1 141 11 1 20 1 1 1 1 1 1 46 112 135 1 105 27 134 3 163 35 74 1 16 1 14 135 1 1 98 1 6 204 305 136 211 134 106 29 11 44 10 46 1 1 96 220 149 1 1 105 91...

output:

229

result:

ok single line: '229'

Test #11:

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

input:

500 1214
1 1 1 1 1 1 1 1 1 1 1 36 1 1 1 1 1 1 56 91 1 56 1 1 1 118 1 1 29 1 127 1 1 1 1 1 1 1 11 178 1 1 1 1 276 23 1 46 66 1 63 310 1 278 70 1 1 1 18 1 1 1 54 7 1 1 177 87 196 1 41 1 19 1 92 68 35 38 39 224 14 1 2 139 1 1 1 1 62 240 17 1 11 278 92 96 269 135 1 63 106 311 20 106 1 1 116 110 16 195 2...

output:

191

result:

ok single line: '191'

Test #12:

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

input:

2 1
2 1
1 1
1 2

output:

0

result:

ok single line: '0'

Test #13:

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

input:

600 1639
1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 28 26 1 1 1 1 1 1 1 1 1 1 1 1 149 196 1 1 1 1 1 1 1 37 1 1 1 1 1 233 189 1 1 1 1 1 161 1 14 12 1 1 1 1 1 1 68 1 325 1 1 30 1 1 1 1 1 291 1 1 1 4 178 52 1 1 1 1 72 1 1 1 234 213 174 50 1 127 1 34 1 1 1 22 1 1 93 1 1 21 105 489 1 172 178 159 10 355 159 1 1 175 ...

output:

404

result:

ok single line: '404'

Test #14:

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

input:

500 700
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 272 1 1 1 1 1 1 1 1 1 1 1 125 1 72 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 77 1 15 6 29 1 259 1 1 1 1 1 189 1 1 52 19 1 1 24 1 1 49 1 1 149 1 13 1 1 107 1 67 24 1 1 106 51 1 1 1 89 1 83 1 1 81 1 1 1 179 1 1 1 108 10...

output:

151

result:

ok single line: '151'

Test #15:

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

input:

700 1817
1 1 1 1 1 1 1 1 1 21 1 1 1 1 1 139 1 1 1 1 1 1 1 1 1 1 1 440 1 1 1 1 18 1 1 1 1 198 1 1 1 1 116 1 147 1 2 1 1 70 1 136 1 133 11 164 57 180 1 270 1 106 1 1 1 78 132 1 1 67 207 35 1 1 1 1 1 60 96 9 121 1 275 1 59 117 5 89 75 1 1 22 1 1 1 1 1 134 1 1 114 37 108 15 1 88 150 1 121 30 1 158 55 1 ...

output:

261

result:

ok single line: '261'

Test #16:

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

input:

700 2010
1 1 1 1 51 1 1 1 1 1 1 1 1 184 1 1 1 223 1 1 1 75 1 102 44 1 1 1 1 117 1 1 1 1 1 1 1 1 1 1 1 1 1 52 1 1 165 1 1 84 1 1 248 1 1 1 1 1 24 1 1 1 1 1 1 1 55 1 40 184 1 1 9 341 267 1 1 1 338 1 1 1 104 1 1 1 70 151 168 136 287 1 1 1 1 1 368 68 111 198 320 45 1 318 133 300 1 248 1 1 3 1 407 1 1 11...

output:

338

result:

ok single line: '338'

Test #17:

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

input:

700 2912
1 1 1 1 1 175 25 1 1 1 1 1 1 1 1 321 1 1 1 30 1 1 1 215 1 1 1 29 1 274 1 32 1 130 1 371 1 1 1 1 1 91 260 1 1 138 28 1 1 215 1 289 1 99 208 135 46 1 1 144 1 78 1 1 1 1 95 120 361 35 417 141 94 59 1 24 98 1 447 290 1 247 148 1 1 1 61 143 263 33 39 30 1 1 8 1 140 1 99 38 267 113 174 408 77 87 ...

output:

407

result:

ok single line: '407'

Test #18:

score: 0
Accepted
time: 16ms
memory: 50900kb

input:

700 10289
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 156 1 1 71 1 176 1 1 23 450 1 299 36 228 70 1 1 267 1 185 54 171 17 284 435 92 2 1 357 245 138 99 85 41 287 144 511 1 154 1 29 1 199 1 53 148 2 201 22 162 214 113 55 80 274 271 181 374 143 1 51 53 33 144 125 253 156 282 154 370 1 66 41 70 171 103 50 54...

output:

725

result:

ok single line: '725'

Test #19:

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

input:

700 1057
1 1 1 1 1 79 170 1 1 42 79 1 128 109 45 1 326 67 30 1 1 17 217 79 436 112 65 21 85 32 48 47 17 7 437 90 120 125 8 36 38 239 25 127 238 164 396 86 432 105 39 136 39 472 45 28 49 265 104 102 98 279 180 114 111 2 11 161 243 492 67 288 16 18 25 40 195 131 140 463 165 60 20 153 53 155 87 235 222...

output:

49

result:

ok single line: '49'

Test #20:

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

input:

700 8878
1 1 1 1 1 48 1 1 1 71 1 1 1 1 197 1 48 66 16 360 157 36 97 1 228 1 29 116 21 1 25 1 207 169 1 145 1 64 203 253 1 259 142 1 67 1 12 1 183 355 77 85 21 91 165 31 326 61 50 130 168 1 21 41 61 258 45 64 75 1 116 1 44 98 63 82 43 132 153 2 220 82 61 372 108 67 46 177 172 115 109 313 80 129 78 28...

output:

92

result:

ok single line: '92'

Test #21:

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

input:

700 15370
1 1 75 187 235 322 294 171 1 279 14 1 18 52 197 187 1 87 120 90 52 25 11 304 41 7 81 120 130 51 234 11 366 432 241 95 72 177 56 314 123 96 77 51 78 35 310 18 84 146 178 174 322 143 331 227 87 95 32 220 187 109 141 349 4 455 45 33 194 166 32 304 217 395 162 323 402 180 282 147 37 6 104 197 ...

output:

91

result:

ok single line: '91'

Test #22:

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

input:

700 5386
1 1 1 1 35 1 1 1 1 1 1 1 1 1 107 207 1 1 188 1 90 76 335 191 1 1 31 1 40 57 259 1 391 1 37 61 64 151 230 57 9 99 127 17 233 417 107 386 21 2 312 114 172 485 293 24 46 131 89 79 70 16 101 111 56 18 201 82 26 105 89 27 15 93 57 132 25 69 158 41 61 119 90 28 90 174 296 59 337 475 213 206 1 160...

output:

471

result:

ok single line: '471'

Test #23:

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

input:

2 1
2 1
1 1
2 1

output:

1

result:

ok single line: '1'

Test #24:

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

input:

700 12079
1 1 1 1 1 28 1 3 1 1 1 1 1 232 1 1 1 1 38 1 1 136 134 24 49 46 1 1 197 94 1 1 108 3 373 1 1 52 1 113 1 1 1 23 373 58 86 1 1 409 60 8 95 59 16 1 148 395 207 287 422 194 169 99 130 157 19 36 107 107 162 160 130 130 40 262 34 1 54 151 15 167 382 197 46 155 5 318 24 115 25 55 81 133 54 200 127...

output:

660

result:

ok single line: '660'

Test #25:

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

input:

700 16863
1 70 63 388 248 73 35 73 129 1 322 44 262 157 4 31 174 244 341 78 32 148 293 245 161 23 82 73 32 6 139 330 26 84 235 109 74 106 137 167 113 112 254 252 437 158 33 276 280 129 127 91 16 127 246 309 2 92 141 3 39 218 134 82 248 39 84 249 60 54 176 268 14 34 51 181 15 339 368 275 63 287 216 1...

output:

29

result:

ok single line: '29'

Test #26:

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

input:

700 16710
1 1 326 295 1 133 1 1 45 53 83 1 60 120 101 64 288 151 146 143 17 528 103 30 36 45 179 78 58 43 44 47 52 13 42 141 88 68 132 97 413 59 8 86 107 12 134 358 39 282 2 149 296 84 154 478 201 129 240 240 2 93 117 16 12 200 289 59 272 209 45 60 229 88 175 207 175 4 62 152 79 515 137 72 96 310 12...

output:

80

result:

ok single line: '80'

Test #27:

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

input:

700 26816
1 241 1 2 1 569 97 39 171 64 228 93 241 176 178 4 67 13 76 29 203 122 148 148 53 300 241 313 118 47 214 28 116 16 10 135 35 104 10 214 2 170 44 73 290 29 13 227 292 189 86 45 68 75 180 14 17 91 2 114 144 107 224 39 11 274 233 365 28 87 40 242 115 26 13 61 300 160 156 266 8 65 5 99 351 253 ...

output:

105

result:

ok single line: '105'

Test #28:

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

input:

700 35471
1 1 1 219 23 42 105 51 137 24 117 94 162 136 70 151 86 76 227 45 254 41 109 27 284 178 137 139 264 17 24 158 272 264 202 296 45 355 460 63 181 45 78 218 7 5 367 69 11 25 62 133 198 233 21 154 49 98 164 244 281 70 53 3 19 80 44 44 333 48 70 249 539 83 267 130 84 82 102 56 157 214 47 110 265...

output:

60

result:

ok single line: '60'

Test #29:

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

input:

700 45375
347 128 102 127 24 115 218 252 157 201 89 89 132 27 48 95 49 24 116 10 182 183 26 152 121 35 117 350 408 45 5 241 202 109 220 202 68 18 27 26 102 139 99 140 171 183 30 73 16 48 41 18 128 274 43 50 61 37 256 11 9 149 180 82 40 11 15 52 141 58 286 24 157 376 14 187 131 124 58 118 338 99 346 ...

output:

730

result:

ok single line: '730'

Test #30:

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

input:

700 60000
1 1 24 1 1 1 1 121 84 1 217 1 192 67 53 23 33 102 101 70 75 84 188 260 57 204 23 127 244 55 4 37 97 9 37 225 220 234 242 366 221 314 42 376 18 117 71 149 84 2 38 132 111 103 62 53 78 64 231 35 111 149 303 399 176 34 39 50 195 339 77 174 302 155 15 113 110 61 227 412 58 43 130 124 127 58 19...

output:

659

result:

ok single line: '659'

Test #31:

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

input:

700 717
1 227 27 54 56 143 64 45 261 152 51 65 194 138 255 256 140 94 138 57 195 81 64 59 64 297 257 17 7 142 186 393 37 264 194 204 55 128 59 132 222 65 166 72 70 59 36 16 272 195 44 129 162 132 58 27 240 52 132 262 203 16 147 115 240 266 47 4 179 89 267 49 89 137 24 169 162 11 4 240 72 146 221 219...

output:

0

result:

ok single line: '0'

Test #32:

score: 0
Accepted
time: 13ms
memory: 50764kb

input:

700 702
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

311

result:

ok single line: '311'

Test #33:

score: 0
Accepted
time: 25ms
memory: 51204kb

input:

700 60000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

298

result:

ok single line: '298'

Test #34:

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

input:

5 7
1 1 2 5 5
16 56 95 25 34
1 4
2 3
2 4
2 5
3 4
3 5
4 5

output:

3

result:

ok single line: '3'

Test #35:

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

input:

700 699
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

69900

result:

ok single line: '69900'

Test #36:

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

input:

5 8
1 2 1 5 5
65 23 26 79 95
1 2
1 4
1 5
2 4
2 5
3 4
3 5
4 5

output:

6

result:

ok single line: '6'

Test #37:

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

input:

10 6
1 1 1 1 1 9 2 2 1 3
66 52 29 16 42 26 30 9 25 47
3 7
5 6
5 8
6 7
8 10
9 10

output:

1

result:

ok single line: '1'

Test #38:

score: 0
Accepted
time: 19ms
memory: 50456kb

input:

10 15
1 1 9 7 1 4 3 8 6 7
33 94 82 27 46 63 13 93 33 64
1 3
1 4
2 6
2 7
2 8
2 10
4 10
5 6
5 8
6 10
7 8
7 9
7 10
8 9
9 10

output:

2

result:

ok single line: '2'

Test #39:

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

input:

10 40
1 8 10 9 9 6 9 3 9 9
48 68 24 56 44 10 62 56 34 2
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
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 6
4 7
4 8
4 9
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
9 10

output:

4

result:

ok single line: '4'

Test #40:

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

input:

15 25
1 2 1 1 6 8 3 2 5 5 5 8 4 7 4
13 97 5 2 94 96 75 85 71 61 87 47 47 74 61
1 2
1 5
1 6
1 7
1 9
2 6
2 7
2 9
4 13
5 6
6 7
6 8
7 9
8 9
10 14
10 15
11 1
11 3
12 1
12 3
13 6
13 9
13 14
14 4
15 10

output:

48

result:

ok single line: '48'