QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#865139#9960. Baggageucup-team1293#TL 9ms10216kbC++141.8kb2025-01-21 15:24:102025-01-21 15:24:10

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 7908kb

input:

5 7
1 2 500 2
2 3 100 1
3 5 20 2
5 4 5 1
4 2 1 0
3 4 40 2
5 4 77 1

output:

0 500 726 751 746 
-1 0 226 251 246 
-1 -1 0 40 20 
-1 -1 -1 0 -1 
-1 -1 -1 131 0 

result:

ok 25 numbers

Test #2:

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

input:

30 5000
1 15 15034 0
1 15 15034 0
24 28 14745 2
1 15 15034 0
16 25 13210 0
16 22 26942 0
24 20 5423 1
4 12 636 0
16 12 19327 0
1 15 15034 0
1 15 15034 0
3 28 18940 2
1 15 15034 0
15 9 6468 0
20 3 6233 2
19 4 10829 2
1 15 15034 0
26 6 20998 0
1 15 15034 0
1 15 15034 0
1 15 15034 0
4 14 20515 2
1 15 1...

output:

0 868 1159 2449 3001 1108 1557 3972 596 1521 3923 1332 3230 871 2010 2145 1610 783 2009 1490 2120 3440 2627 4515 228 958 2630 4394 3681 2618 
2534 0 291 3106 3753 3127 4053 4838 3130 2387 4580 464 4486 1719 2784 2818 2476 3317 2343 777 2777 3121 1759 5381 2762 1354 5164 6928 3603 3370 
2243 3111 0 2...

result:

ok 900 numbers

Test #3:

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

input:

30 5000
30 9 1929 2
14 1 270 1
3 4 709 0
13 8 14 0
23 16 423 0
18 12 14 0
11 28 658 0
19 3 6793 1
16 25 9438 0
1 15 25 0
5 26 3 1
14 18 11 2
13 19 131 1
14 1 441 0
7 14 16 1
6 3 4624 1
29 5 639 1
2 16 66 1
3 27 770 2
4 21 9 1
11 22 22681 0
15 20 3380 0
21 14 1 0
18 26 3 0
14 16 60 1
30 18 8284 1
12 ...

output:

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

result:

ok 900 numbers

Test #4:

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

input:

30 5000
25 18 30000 0
10 17 29987 1
10 17 29987 1
10 17 29987 1
10 17 29987 1
10 17 29987 0
27 23 26494 1
10 17 29987 0
10 17 29987 0
25 18 30000 0
25 18 30000 0
10 17 29987 0
25 18 30000 0
10 17 29987 0
5 19 29447 1
10 17 29987 1
10 17 29987 0
10 17 29987 1
10 17 29987 0
10 17 29987 0
5 27 29658 0
...

output:

0 36060 30000 33186 30484 21948 47316 32912 49004 33187 51932 39740 29995 33186 22914 51948 47860 32846 28861 41502 29921 29752 51698 29544 20571 3187 29894 49129 28597 50559 
46239 0 29986 29999 27920 35457 19997 29997 52925 46696 46671 36825 33191 43503 49029 16716 51056 46355 18871 29833 46145 26...

result:

ok 900 numbers

Test #5:

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

input:

30 2610
3 20 5637 2
18 29 12579 1
21 8 2321 1
29 19 5569 1
18 9 4241 0
8 30 4854 2
26 25 2044 0
24 16 2735 1
15 22 10162 2
3 22 8632 1
15 2 5624 2
13 11 10791 2
6 12 956 2
19 4 1604 1
6 23 4864 0
5 11 3258 1
13 5 209 1
1 25 15792 1
7 17 2018 1
5 12 3274 0
30 12 12854 1
1 13 11766 2
13 20 4031 1
13 1...

output:

0 596 683 173 89 374 215 336 68 321 103 247 135 170 440 1226 921 324 406 886 69 259 526 90 395 614 712 235 451 636 
781 0 763 448 330 711 456 110 413 597 448 592 159 411 616 1546 901 771 308 1161 414 283 767 331 636 739 953 450 622 877 
121 717 0 294 210 495 336 451 189 442 224 368 256 291 561 1347 ...

result:

ok 900 numbers

Test #6:

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

input:

30 5000
23 1 120577749 0
23 1 932974878 2
23 1 496789200 0
23 1 387748955 0
23 1 65652724 2
23 1 357942661 2
27 26 26637 1
23 1 322699534 1
23 1 380812839 2
23 1 953517727 2
23 1 749461966 1
10 15 28782 2
23 1 928219419 2
23 1 710721749 2
8 15 18680 1
23 1 892884272 1
23 1 286930033 1
23 1 218608754...

output:

0 27320 24887 26618 42869 21776 48355 33767 24719 42203 43789 28450 29649 45609 36687 27601 41308 29758 43974 49891 37258 23888 26839 36717 29133 43599 43773 25044 34014 19905 
44931 0 44262 27639 40476 24628 28243 27005 23206 24976 25906 29578 20816 20297 28743 25208 29929 36582 29084 30428 39611 2...

result:

ok 900 numbers

Test #7:

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

input:

30 5000
29 20 714766588 0
2 7 117691629 2
30 7 986874209 0
24 20 59391779 0
14 11 910689121 1
27 21 674552800 0
13 2 19137 1
29 27 575469961 0
20 16 997757597 1
10 14 894507242 0
22 25 371074859 1
27 4 148067345 1
16 1 75228920 2
17 4 62090300 1
2 24 4378 0
24 27 513864617 1
10 3 51701509 1
10 12 86...

output:

0 26 37 43 54 77 989 26 1179 46 79 2308 39 736 1328 1176 58 726 54 695 5052 26 1185 21 207 5 430 52 5552 51 
716 0 753 759 770 793 1705 742 1895 762 795 3024 755 1452 2044 1892 774 1442 770 1411 5768 742 1901 737 923 721 1146 768 6268 767 
755 39 0 6 36 42 952 6 1159 28 61 3063 2 984 1304 1156 40 97...

result:

ok 900 numbers

Test #8:

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

input:

30 5000
18 19 411628368 0
18 19 992076423 0
18 19 982786362 1
18 19 869144808 0
18 19 604720156 1
18 19 150564302 1
18 19 976935570 0
18 19 969698875 1
18 19 704977028 0
18 19 763570567 0
18 19 595200455 1
18 19 90807561 1
18 19 108104079 0
18 19 480474814 0
18 19 309125116 1
18 19 363086156 0
18 19...

output:

0 20024 51335 65397 86394 93878 158429 187393 224779 249597 272512 298527 363157 369316 421368 437257 473456 489365 553804 566015 629870 655713 672117 688654 750372 764687 803012 815477 879905 897017 
926822 0 31311 45373 66370 73854 138405 167369 204755 229573 252488 278503 343133 349292 401344 417...

result:

ok 900 numbers

Test #9:

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

input:

30 59
11 25 4982 0
1 16 26498 1
26 27 4960 1
27 28 29446 1
19 4 14770 0
12 26 5084 0
8 22 23140 0
9 23 16857 0
1 2 11246 1
30 15 1948 0
23 8 29970 0
27 12 13101 0
4 5 17481 1
15 29 29113 0
25 26 11246 1
6 7 4354 1
29 14 25845 0
28 13 21802 0
25 10 6407 0
3 4 29446 1
16 17 26602 1
8 9 18521 1
13 27 1...

output:

0 62004 168048 257690 310001 384929 417726 496176 580045 640010 681867 768366 819883 912971 977849 68399 171414 252577 298028 364021 421921 497038 585110 648001 700797 756690 784795 880035 957324 1003327 
-1 0 106044 195686 247997 322925 355722 434172 518041 578006 619863 706362 757879 850967 915845...

result:

ok 900 numbers

Test #10:

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

input:

30 5000
12 13 22419 1
12 13 22419 1
12 13 22419 0
12 13 22419 1
12 13 22419 1
12 13 22419 0
12 13 22419 1
12 13 22419 0
12 13 22419 0
12 13 22419 0
12 13 22419 1
12 13 22419 0
12 13 22419 0
12 13 22419 1
12 13 22419 0
12 13 22419 0
12 13 22419 0
12 13 22419 0
12 13 22419 1
12 13 22419 0
12 13 22419 ...

output:

0 29478 4846 33196 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
5128 0 9974 38324 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
29760 24632 0 28350 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
19989 ...

result:

ok 900 numbers

Test #11:

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

input:

30 5000
1 11 13580 1
13 14 21946 1
12 17 22413 0
9 22 3001 0
3 16 27849 1
2 19 19009 0
2 3 14653 1
9 16 25268 1
15 25 2993 1
17 22 22455 0
26 27 28609 0
4 12 22088 1
4 16 11645 0
16 20 24240 0
2 12 22423 1
9 28 28461 0
8 12 14823 1
25 28 14704 1
19 24 23575 0
5 18 18026 1
12 20 20538 0
9 10 23178 1
...

output:

0 -1 22477 -1 -1 48625 -1 64951 -1 -1 -1 37184 -1 29010 45845 -1 -1 -1 -1 -1 41930 24312 -1 -1 -1 27767 -1 69989 -1 47047 
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 0 -1 -1 26148 -1 42474 -1 -1 -1 14707 -1 14653 31488 -1 -1 -1 -1 -1 19453 1835 -1...

result:

ok 900 numbers

Test #12:

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

input:

1 0

output:

0 

result:

ok 1 number(s): "0"

Test #13:

score: -100
Time Limit Exceeded

input:

400 500000
336 348 802030063 2
82 373 667752535 0
214 115 112164722 0
7 174 132533750 2
153 232 17020830 2
49 156 405656680 1
82 373 667752535 0
43 264 877333994 0
147 120 677084003 1
24 393 457667285 0
32 146 951980666 0
187 101 59701810 1
180 342 615222577 0
87 159 104951976 0
143 296 231691040 1
...

output:


result: