QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21028#61. Cut Cut Cut!yukorniTL 550ms14308kbC++141.7kb2022-02-24 23:49:392022-05-03 12:19:41

详细

Test #1:

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

input:

3 3
1 2
1 3
2 3

output:

1
2

result:

ok 2 number(s): "1 2"

Test #2:

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

input:

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

output:

1
1
1
2
1
0
0

result:

ok 7 numbers

Test #3:

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

input:

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

output:

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

result:

ok 19 numbers

Test #4:

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

input:

100 1000
26 51
88 93
96 97
55 92
49 60
89 92
81 84
87 95
80 96
33 81
48 73
12 91
71 86
89 90
33 78
13 100
60 89
45 48
98 100
10 43
40 50
13 29
96 99
83 92
84 85
20 39
97 100
41 76
51 71
28 61
2 80
57 89
58 83
10 30
21 85
1 21
86 95
1 65
66 78
57 91
30 41
46 72
59 64
59 79
17 33
68 79
45 78
8 91
12 7...

output:

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

result:

ok 99 numbers

Test #5:

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

input:

2000 50000
74 1663
975 1279
632 1796
1137 1386
121 1557
627 678
482 1961
1554 1654
1 388
1940 1971
512 1665
675 1279
946 1834
1473 1645
732 1620
169 552
1996 1997
1549 1982
1678 1788
1282 1831
1084 1455
1166 1566
380 854
1087 1263
763 1569
234 864
1166 1475
47 1680
194 350
1939 1949
8 1028
357 1234
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1999 numbers

Test #6:

score: 0
Accepted
time: 69ms
memory: 8376kb

input:

2000 50000
1078 1288
298 1803
1715 1954
547 1412
1060 1730
1077 1855
1685 1947
1416 1804
1469 1737
1637 1888
1048 1462
162 237
1655 1885
492 963
1 811
1598 1948
261 1353
441 1531
1829 1838
170 1189
1848 1996
705 1909
931 1724
493 574
1146 1412
1062 1730
102 206
49 615
1777 1931
106 1808
1545 1789
11...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1999 numbers

Test #7:

score: 0
Accepted
time: 72ms
memory: 8004kb

input:

2000 50000
347 505
1265 1885
1170 1773
1126 1942
375 1060
1463 1622
1661 1972
321 1956
69 1968
518 1896
1348 1654
166 1060
1 907
1520 1733
3 1085
1886 1954
1532 1603
821 1248
654 1899
1477 1595
792 1504
410 496
1421 1955
77 1201
1410 1442
1974 1981
1081 1470
718 904
687 1275
1693 1977
2 526
398 585
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1999 numbers

Test #8:

score: 0
Accepted
time: 111ms
memory: 8348kb

input:

2000 50000
1097 1906
350 533
1144 1809
49 1971
1498 1655
261 808
716 834
40 60
692 1664
292 602
1383 1728
1127 1395
1441 1602
761 1213
1671 1875
978 1683
505 646
798 1663
1359 1542
1960 1961
1258 1800
121 554
1 742
1403 1566
769 1397
475 1576
625 806
1468 1611
1943 1972
181 769
1816 1913
1 1846
290 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1999 numbers

Test #9:

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

input:

2000 50000
1436 1821
1 477
1001 1047
20 1306
1907 1933
1 840
202 1708
608 870
39 440
630 1036
226 1745
1137 1516
1455 1878
1052 1570
1377 1440
170 469
1295 1759
950 1993
429 1457
1309 1523
42 1183
442 1017
796 1646
558 757
1590 1699
439 1108
1545 1731
1 1506
1841 1998
1933 1948
1145 1189
206 1349
18...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
0
0
1
0
1
...

result:

ok 1999 numbers

Test #10:

score: 0
Accepted
time: 112ms
memory: 8524kb

input:

2000 50000
982 1542
1981 1992
59 249
717 720
745 790
123 1846
1874 1961
1715 1855
769 808
578 1072
1922 1923
1700 1703
1526 1859
796 814
1904 1997
1616 1860
486 519
361 383
673 688
655 1519
825 1058
544 950
1185 1654
340 1848
1467 1783
1385 1745
313 888
86 411
1103 1696
1292 1997
45 523
438 467
1795...

output:

0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1999 numbers

Test #11:

score: 0
Accepted
time: 550ms
memory: 11488kb

input:

3000 200000
101 567
1 1265
1373 1916
2737 2814
2439 2443
409 1808
511 2197
245 616
2197 2259
1266 1764
1261 2882
1341 1938
1684 1962
276 1197
1942 2295
657 1710
2100 2781
753 2815
1814 2335
1462 2125
785 2612
2370 2907
1809 2853
1 469
2523 2779
1433 2259
1429 2480
1796 2221
2379 2605
1685 2444
106 2...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
...

result:

ok 2999 numbers

Test #12:

score: 0
Accepted
time: 458ms
memory: 9256kb

input:

3000 200000
2458 2538
1024 1532
1603 2068
654 1645
2951 2965
2609 2754
906 1992
1252 1332
1132 1139
97 2591
956 1758
771 2097
943 1849
2802 2814
2016 2401
154 767
1896 2916
79 1621
1484 1523
2568 2678
113 1189
1854 1926
787 2523
151 1369
2376 2533
2741 2911
2797 2975
2408 2416
2932 2987
1158 2750
19...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 2999 numbers

Test #13:

score: 0
Accepted
time: 499ms
memory: 14308kb

input:

5000 200000
3093 4382
2320 4405
3622 4951
1653 4654
1815 3486
4470 4626
3784 4082
3537 4022
423 1775
2334 2565
1960 2331
4543 4749
3458 3818
586 2057
1141 2668
3039 3957
3250 4066
2234 3682
2568 4454
3771 4711
4843 4858
3462 4421
4625 4799
431 4641
1966 4228
3157 3581
4778 4872
2585 4865
98 705
91 1...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 4999 numbers

Test #14:

score: -100
Time Limit Exceeded

input:

6000 220000
5077 5182
5788 5902
5294 5909
240 5622
2987 3163
984 4309
308 4642
1712 5711
5292 5797
399 2009
2247 4111
4923 4951
3576 5922
626 4085
28 5234
5778 5867
1 3481
2329 4516
4729 4911
4310 5588
4831 5795
3512 5810
1439 3911
5780 5917
4552 4864
1275 1793
628 4166
2799 2944
5004 5874
2085 3411...

output:


result: