QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#337726#1994. Help Yourselfqiuzx100 ✓489ms72628kbC++173.0kb2024-02-25 13:25:552024-02-25 13:25:55

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 6.25
Accepted
time: 2ms
memory: 12188kb

input:

3 2
1 6
2 3
4 5

output:

10

result:

ok single line: '10'

Test #2:

score: 6.25
Accepted
time: 0ms
memory: 12200kb

input:

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

output:

918764253

result:

ok single line: '918764253'

Test #3:

score: 6.25
Accepted
time: 0ms
memory: 12168kb

input:

1000 2
257 1057
425 426
820 1932
38 39
149 150
466 965
1974 1975
777 1227
631 632
647 1363
1621 1626
250 255
786 1698
453 801
522 1090
263 1040
1850 1851
920 1953
93 467
1034 1035
1062 1458
854 1711
472 473
500 501
679 776
477 653
1278 1279
1140 1141
921 1824
244 912
434 787
603 604
1763 1764
1326 1...

output:

214864274

result:

ok single line: '214864274'

Test #4:

score: 6.25
Accepted
time: 4ms
memory: 12228kb

input:

1000 2
50 937
4 1229
470 1986
1979 1980
1422 1425
245 246
1797 1798
996 1777
585 1880
1762 1763
713 1465
402 1637
1572 1697
604 1878
1193 1194
897 900
1420 1421
1081 1756
708 749
319 320
1268 1746
278 1170
1223 1975
1993 1994
12 13
947 950
766 767
773 1233
1339 1693
241 1935
333 334
568 569
55 56
42...

output:

666474917

result:

ok single line: '666474917'

Test #5:

score: 6.25
Accepted
time: 5ms
memory: 12144kb

input:

1000 2
1176 1179
1085 1412
1364 1365
688 1974
76 77
1194 1195
429 430
1958 1959
1021 1022
723 1180
27 1954
7 1735
366 373
1756 1757
1711 1714
1473 1474
1233 1234
227 237
500 1137
46 434
482 483
625 1124
1348 1349
570 862
1272 1273
1300 1560
854 855
913 914
1326 1327
1655 1656
177 178
1957 1960
369 3...

output:

155156550

result:

ok single line: '155156550'

Test #6:

score: 6.25
Accepted
time: 0ms
memory: 14192kb

input:

1000 4
1626 1627
1096 1097
318 1513
14 17
261 262
724 896
1259 1260
1754 1757
443 1105
1715 1732
1112 1113
641 1527
1134 1135
698 699
1278 1279
1482 1483
437 1001
1870 1871
1288 1512
1306 1307
324 1933
822 1354
1369 1370
1911 1912
509 510
75 1132
1172 1834
1609 1610
1350 1351
163 164
742 1690
875 14...

output:

679485507

result:

ok single line: '679485507'

Test #7:

score: 6.25
Accepted
time: 0ms
memory: 12216kb

input:

1000 7
327 895
1624 1625
405 1088
302 898
1482 1483
1972 1973
890 1071
870 871
1239 1240
1266 1267
507 508
661 1399
100 1976
388 1825
947 1027
270 354
679 1984
1313 1314
733 1318
742 1567
766 767
1941 1942
793 1893
150 823
1785 1981
1145 1146
1393 1394
235 236
99 228
221 222
1079 1080
522 523
1498 1...

output:

335111598

result:

ok single line: '335111598'

Test #8:

score: 6.25
Accepted
time: 4ms
memory: 12228kb

input:

1000 10
802 1951
1340 1891
1168 1169
241 1072
83 551
1353 1354
1208 1209
235 1266
542 543
852 1644
1979 1980
400 401
1487 1895
259 260
632 1701
1575 1576
145 166
1059 1060
454 1789
570 571
1226 1227
1785 1786
690 1303
607 711
771 1591
930 931
616 617
783 1512
533 534
17 1019
356 1963
1011 1012
224 6...

output:

547118185

result:

ok single line: '547118185'

Test #9:

score: 6.25
Accepted
time: 479ms
memory: 71096kb

input:

100000 3
5897 129730
49170 49173
41237 195778
83686 83687
70752 169816
17614 155410
71945 71946
86519 86520
90441 188046
21675 86380
59295 175039
51025 51032
178949 178952
37108 167629
785 92071
65649 65650
123391 154617
21550 85959
12167 83461
43696 43697
176913 176914
29066 172054
118261 123679
14...

output:

958989358

result:

ok single line: '958989358'

Test #10:

score: 6.25
Accepted
time: 467ms
memory: 70928kb

input:

100000 4
123504 184162
20162 89295
68630 178121
66955 66956
70359 97517
61324 61325
8946 24830
26607 26618
11625 84350
22486 177973
20921 95731
99675 101231
87061 87062
13510 165260
184835 184836
83349 118398
150270 150271
171421 171422
102061 102062
166865 169287
83147 158219
6883 123997
8129 19366...

output:

245418916

result:

ok single line: '245418916'

Test #11:

score: 6.25
Accepted
time: 472ms
memory: 71632kb

input:

100000 5
103555 103556
197996 197997
7531 7534
16803 16804
43303 192313
98700 98703
3828 44087
34944 121506
88926 161497
10230 187676
92128 92129
50714 154647
18309 47556
189146 189149
110028 110029
34142 34143
15635 78638
70191 70192
168616 174129
85083 85084
24028 198335
87670 87671
85241 183910
1...

output:

129141228

result:

ok single line: '129141228'

Test #12:

score: 6.25
Accepted
time: 489ms
memory: 71116kb

input:

100000 6
39844 39845
132423 132424
156679 168289
138276 190905
77382 77385
146359 146360
29459 78378
132558 132563
136176 139868
112048 132732
565 146568
192272 192273
123835 123836
197052 197053
32916 179043
113290 113291
75390 75391
94543 94544
13614 13615
155796 155797
24149 24150
193714 193715
1...

output:

160130487

result:

ok single line: '160130487'

Test #13:

score: 6.25
Accepted
time: 482ms
memory: 72184kb

input:

100000 7
87512 165950
84143 123927
165636 179507
36811 36812
18329 18330
114502 148151
139071 185081
91730 91731
49313 49314
183018 191733
171425 188707
94550 94557
36327 36328
43223 70541
23550 133579
20097 159492
155228 183836
49824 49827
65432 65433
132062 160411
884 1265
68662 165949
3 40610
317...

output:

866782575

result:

ok single line: '866782575'

Test #14:

score: 6.25
Accepted
time: 481ms
memory: 72628kb

input:

100000 8
139479 139484
99908 99909
135422 135423
67569 69636
802 151050
59603 88814
42977 42980
48428 181292
9580 9581
61911 134518
139946 194227
129660 129661
107449 107450
19003 93339
8687 143543
173212 173213
159562 159563
86083 86084
21380 90431
41773 139333
134520 183413
32986 164876
16973 1697...

output:

960702520

result:

ok single line: '960702520'

Test #15:

score: 6.25
Accepted
time: 471ms
memory: 71160kb

input:

100000 9
164083 164084
86222 86223
103475 103476
117198 117982
57195 196206
8879 150459
7019 7020
50629 74897
179088 194710
79291 79292
24223 113740
64371 64372
178499 178500
61016 123565
12463 181442
151509 151514
17374 92041
88281 123328
8433 63088
84772 84773
179332 179333
15778 15779
29225 15850...

output:

811086835

result:

ok single line: '811086835'

Test #16:

score: 6.25
Accepted
time: 484ms
memory: 72256kb

input:

100000 10
4554 53630
20155 75946
27190 27191
42002 42003
14806 144285
82294 182737
153131 161387
143573 143574
109935 174947
105934 105935
3173 168965
117399 117400
174029 174030
187839 187840
11893 38358
119473 138362
75229 75230
8795 194263
50063 159286
81580 81581
12311 120375
195657 195658
97402...

output:

407528900

result:

ok single line: '407528900'