QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#460835#8353. T1houzhiyuan20 672ms3780kbC++141.4kb2024-07-02 11:11:402024-07-02 11:11:41

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 20
Accepted

Test #1:

score: 20
Accepted
time: 0ms
memory: 3596kb

input:

10 10
10 9 8 7 6 5 4 3 2 1
16 19 18 17 20 15 14 13 60 11
30 52 28 27 26 25 24 23 22 21
40 39 38 37 36 35 34 33 32 31
50 49 48 47 46 45 44 43 42 41
12 59 58 57 56 55 70 53 29 51
54 69 68 67 66 65 64 63 62 61
80 79 78 77 76 75 74 92 72 71
90 89 88 87 86 85 84 83 82 81
100 99 98 97 96 95 94 93 73 91

output:

161565

result:

ok single line: '161565'

Test #2:

score: 20
Accepted
time: 1ms
memory: 3724kb

input:

10 10
77 62 56 97 96 29 48 93 92 91
90 89 63 87 86 85 39 22 5 81
80 79 78 100 76 75 27 73 72 1
70 69 68 31 66 65 64 52 99 61
60 59 58 57 98 55 54 36 53 2
50 49 94 47 46 45 44 43 8 41
40 84 38 37 28 35 34 33 14 67
30 95 82 74 26 25 24 23 83 21
20 19 18 17 16 15 32 13 12 11
10 9 42 7 6 88 4 3 51 71

output:

15613

result:

ok single line: '15613'

Test #3:

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

input:

10 10
58 96 17 38 12 60 26 7 100 88
14 23 11 67 49 15 87 59 46 81
95 33 24 27 64 78 50 29 43 5
56 34 91 42 66 31 3 35 6 4
16 9 48 22 73 47 72 8 93 80
10 77 79 39 20 28 19 40 57 69
83 76 30 85 71 45 82 13 61 55
92 94 25 54 52 21 44 68 99 1
74 97 51 37 41 65 18 36 75 84
63 53 70 32 86 90 89 2 98 62

output:

5879

result:

ok single line: '5879'

Test #4:

score: 20
Accepted
time: 1ms
memory: 3496kb

input:

10 10
100 2 50 49 48 47 76 9 8 7
67 66 65 64 63 62 61 60 59 58
57 79 78 77 46 45 44 43 42 41
40 39 38 5 6 68 69 70 71 72
73 86 85 84 83 82 81 80 56 55
54 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34
35 36 37 4 3 51 52 53 15 14
13 12 96 95 94 93 92 91 90 89
88 87 74 75 10 11 97 98 99 1

output:

19034

result:

ok single line: '19034'

Test #5:

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

input:

10 10
14 15 62 63 64 65 51 50 49 48
47 46 71 60 61 16 55 54 53 52
66 67 68 72 45 44 43 42 41 40
39 38 37 36 35 34 33 32 31 30
29 28 27 26 25 24 23 22 21 20
19 18 17 56 57 58 59 70 69 73
82 81 80 79 78 98 99 100 13 96
95 94 93 92 91 90 89 88 87 86
85 84 83 74 75 76 77 97 12 11
10 9 8 7 6 5 4 3 2 1

output:

24015

result:

ok single line: '24015'

Test #6:

score: 20
Accepted
time: 1ms
memory: 3472kb

input:

9 10
9 58 56 40 8 75 3 59 87 35
51 54 23 72 68 70 13 83 84 2
63 62 52 28 50 39 42 90 43 5
41 17 78 64 47 7 32 65 69 89
45 27 71 57 79 33 74 46 48 6
80 16 36 10 29 21 14 67 18 26
60 86 4 22 61 82 38 88 11 37
1 49 19 77 20 31 44 66 55 53
73 30 24 34 81 76 12 85 15 25

output:

4520

result:

ok single line: '4520'

Test #7:

score: 20
Accepted
time: 0ms
memory: 3592kb

input:

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

output:

325

result:

ok single line: '325'

Subtask #2:

score: 0
Runtime Error

Test #8:

score: 25
Accepted
time: 25ms
memory: 3780kb

input:

15 15
146 31 130 80 142 124 140 105 54 5 197 144 202 170 107
108 6 69 168 34 59 73 151 132 3 104 172 115 147 199
63 85 217 42 156 30 157 171 200 145 19 143 162 4 210
191 133 222 39 40 166 213 220 211 13 180 8 192 22 89
174 62 10 121 196 74 186 1 38 149 218 46 12 87 126
25 165 188 75 184 123 78 148 1...

output:

35335

result:

ok single line: '35335'

Test #9:

score: 25
Accepted
time: 17ms
memory: 3544kb

input:

15 15
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
111 112 113 114 115 116 117 110 109 108 74 75 76 77 195
132 131 130 129 128 127 126 125 124 123 122 121 120 119 118
147 146 145 144 143 142 141 140 139 138 137 136 135 134 13...

output:

4004997

result:

ok single line: '4004997'

Test #10:

score: 25
Accepted
time: 13ms
memory: 3588kb

input:

15 15
225 224 223 222 221 220 219 218 217 216 215 214 213 212 211
210 209 208 207 206 40 39 29 28 27 26 25 24 23 22
21 20 19 18 17 16 15 14 13 12 11 10 9 8 7
6 5 4 3 71 72 73 74 75 76 77 78 79 80 81
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111...

output:

2149077

result:

ok single line: '2149077'

Test #11:

score: 0
Runtime Error

input:

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

output:


result:


Subtask #3:

score: 0
Runtime Error

Test #15:

score: 25
Accepted
time: 672ms
memory: 3484kb

input:

18 18
324 323 322 321 320 319 318 152 316 315 314 313 312 311 310 309 308 307
306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289
288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271
270 269 268 267 266 265 264 263 262 261 138 259 258 58 256 255 254 253
252 251...

output:

4612987094

result:

ok single line: '4612987094'

Test #16:

score: 25
Accepted
time: 472ms
memory: 3480kb

input:

18 18
1 2 85 4 5 6 7 8 9 31 11 12 13 14 15 16 17 18
19 49 21 22 23 24 25 26 27 28 29 30 283 32 33 243 35 36
37 38 39 40 90 42 43 44 45 46 47 48 20 50 51 52 53 54
55 137 57 58 59 60 61 105 191 64 125 320 67 68 69 196 71 72
73 74 75 76 77 78 79 80 178 315 83 84 3 86 87 88 89 41
91 92 140 94 66 96 97 9...

output:

81717007

result:

ok single line: '81717007'

Test #17:

score: 25
Accepted
time: 278ms
memory: 3556kb

input:

18 18
324 321 42 106 146 83 8 104 261 223 49 47 320 204 238 201 19 43
183 284 167 307 314 244 27 4 139 323 265 319 124 263 172 322 154 210
195 13 23 249 90 301 266 107 306 159 12 100 217 78 20 60 278 80
56 245 308 202 253 163 171 133 5 97 170 280 156 52 230 155 16 68
158 302 77 115 234 276 231 281 7...

output:

88491

result:

ok single line: '88491'

Test #18:

score: 25
Accepted
time: 149ms
memory: 3776kb

input:

18 18
1 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142
141 140 139 138 137 136 135 134 133 132 131 130 129 43 44 45 46 47
48 49 50 51 52 53 54 55 56 57 58 59 23 22 21 20 19 18
17 16 15 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
309 310 311 312 313 202 203 204 20...

output:

8064835

result:

ok single line: '8064835'

Test #19:

score: 25
Accepted
time: 159ms
memory: 3692kb

input:

18 18
1 2 3 4 5 6 7 8 9 69 68 67 66 65 64 63 62 61
60 59 58 178 304 256 255 254 253 252 251 250 249 248 247 246 245 244
243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226
225 224 223 222 221 220 117 118 119 120 121 122 123 124 125 126 153 152
151 150 149 148 147 209 208 207 206 ...

output:

18417513

result:

ok single line: '18417513'

Test #20:

score: 0
Runtime Error

input:

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

output:


result:


Subtask #4:

score: 0
Time Limit Exceeded

Test #22:

score: 0
Time Limit Exceeded

input:

20 20
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
361 362 363 364 365 366 367 222 369 370 371 372 373 374 375 376 377 378 379 380
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
321 322 323 324 325 326 327 328 329 330 331 332 333 33...

output:


result: