QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21062#1293. Date PickupqwqAC ✓1371ms27204kbC++203.7kb2022-02-27 01:14:272022-05-08 01:55:58

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3632kb

input:

60 142
3 9
1 1 173
1 2 124
1 3 97
2 1 70
2 2 19
2 3 46
3 1 176
3 2 199
3 3 88

output:

82

result:

ok single line: '82'

Test #2:

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

input:

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

output:

3

result:

ok single line: '3'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3776kb

input:

28 40
10 13
2 5 4
5 8 7
4 10 10
8 6 7
5 8 10
10 7 7
9 1 4
2 4 5
1 8 2
3 2 6
4 5 1
6 3 4
7 1 5

output:

12

result:

ok single line: '12'

Test #4:

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

input:

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

output:

27

result:

ok single line: '27'

Test #5:

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

input:

15 114
5 6
2 5 5
3 2 10
5 4 2
4 2 10
1 1 9
1 3 7

output:

17

result:

ok single line: '17'

Test #6:

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

input:

0 81
10 18
8 3 3
5 6 5
10 1 1
4 7 6
2 8 2
9 6 7
3 5 3
8 4 10
7 3 8
6 10 2
6 10 10
3 5 9
3 4 8
10 2 3
7 5 8
9 6 10
10 4 10
1 2 5

output:

20

result:

ok single line: '20'

Test #7:

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

input:

1 76
6 19
4 2 3
1 2 6
5 3 6
3 1 7
4 6 9
5 4 4
3 1 3
3 6 7
2 6 1
2 4 4
6 3 10
1 1 6
2 5 7
1 2 6
1 5 8
5 2 7
1 3 5
5 4 2
2 6 4

output:

7

result:

ok single line: '7'

Test #8:

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

input:

31 41
9 17
9 3 5
7 2 3
4 2 7
3 9 4
5 8 5
8 6 4
8 6 1
4 1 10
6 3 10
7 4 6
4 8 2
2 5 3
3 9 5
8 3 5
6 9 3
1 5 4
7 9 6

output:

7

result:

ok single line: '7'

Test #9:

score: 0
Accepted
time: 1ms
memory: 3664kb

input:

8 87
7 7
3 7 4
4 3 8
5 1 10
1 6 2
7 1 10
6 4 9
2 2 2

output:

23

result:

ok single line: '23'

Test #10:

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

input:

619 699
3 41
3 2 99
2 2 60
3 1 38
3 2 1
1 1 94
1 3 88
1 3 46
3 1 62
3 3 8
3 1 42
3 2 39
1 3 50
3 1 92
1 1 3
3 2 39
1 1 33
2 1 2
2 1 69
2 1 51
3 1 89
3 3 51
2 2 84
2 3 86
1 1 96
1 3 98
2 2 99
1 2 65
1 2 50
2 3 67
1 3 23
2 3 21
2 2 18
1 1 22
3 3 96
3 2 6
1 1 100
3 3 100
1 3 61
1 2 11
3 1 15
3 1 45

output:

8

result:

ok single line: '8'

Test #11:

score: 0
Accepted
time: 612ms
memory: 23052kb

input:

58063 58591
99037 100000
59958 27944 539620
37947 12102 164721
55981 6435 880627
95540 75821 652633
43073 60517 762375
23615 34195 208766
68574 55340 805160
42529 26704 904676
70091 72413 127744
18147 60331 827140
91724 86545 194875
2555 7887 273141
52128 44612 733403
35091 94339 812420
98518 61486 ...

output:

606636448

result:

ok single line: '606636448'

Test #12:

score: 0
Accepted
time: 868ms
memory: 22552kb

input:

9855265 9857782
96129 100000
22544 79442 249876
70885 19903 311034
19768 34147 407710
10489 61409 132724
40582 36933 393942
1287 53069 862493
67592 6405 314147
79281 18139 668586
23809 79327 484636
93148 81287 710436
14626 7049 288183
64009 25987 181694
43804 73360 763405
62244 25854 193961
36187 92...

output:

151466180

result:

ok single line: '151466180'

Test #13:

score: 0
Accepted
time: 346ms
memory: 21812kb

input:

53317846767 75491697027
99655 100000
83667 64109 120526
49414 86400 46128
11179 46126 160775
78890 75185 148077
76240 67603 19029
67973 19463 65445
35924 34967 95354
46539 91434 49330
35549 45495 31613
39467 74662 155298
75251 20264 7205
26607 87926 11473
55994 69740 34287
45866 34574 62591
37786 83...

output:

153079625

result:

ok single line: '153079625'

Test #14:

score: 0
Accepted
time: 55ms
memory: 7444kb

input:

277148195 972930757
10000 100000
1 2 93342
2 3 22661
2 4 15063
1 5 75575
3 6 69392
4 7 58593
7 8 8679
2 9 39809
4 10 59498
4 11 96233
2 12 34014
11 13 48973
1 14 79723
13 15 93741
15 16 96176
14 17 37329
17 18 54822
11 19 88825
19 20 11686
12 21 74566
8 22 34914
20 23 97364
17 24 11020
8 25 60637
6 ...

output:

72648

result:

ok single line: '72648'

Test #15:

score: 0
Accepted
time: 209ms
memory: 12548kb

input:

11810 16066062
40000 100000
24754 24756 24496
20099 20100 74343
30101 30102 8854
21917 18701 69745
36192 1168 2154
14907 37207 19473
1705 32080 89127
35921 35923 83311
33870 33871 45223
10603 14480 78622
26645 6374 9607
19505 19506 58269
15839 17839 53851
39837 39838 74411
4030 4031 7691
4015 4017 7...

output:

557007

result:

ok single line: '557007'

Test #16:

score: 0
Accepted
time: 249ms
memory: 15252kb

input:

200000 250000
50000 100000
48218 20161 29019
46590 16517 1
19000 48218 8835
20478 42078 1
14941 48218 26035
27912 19381 1
38461 48218 47977
48218 7387 14371
2239 725 1
48218 43795 20135
20878 43454 1
8894 39942 1
27575 31525 1
48218 47307 34071
49940 48218 10945
48218 29290 9043
48218 20144 16563
26...

output:

35001

result:

ok single line: '35001'

Test #17:

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

input:

34005 77733
100 1000
7 38 81086
60 42 95530
56 58 27207
44 67 60621
98 59 23548
30 64 19730
49 41 54765
64 46 68094
58 66 6349
92 94 57551
62 79 51364
29 87 67993
54 27 80369
78 49 68601
71 91 32401
4 78 13147
27 13 10915
46 47 22608
16 24 62151
38 33 77478
23 68 64912
27 16 13205
34 46 80540
72 41 ...

output:

35340

result:

ok single line: '35340'

Test #18:

score: 0
Accepted
time: 120ms
memory: 11860kb

input:

148554517114 692396776252
45137 100000
34934 28332 449758
25409 17148 673706
17486 17488 980130
14846 14847 143295
42633 16078 867369
18655 35509 633478
17796 17798 925442
27434 771 277028
21351 34508 736032
988 22873 744030
9939 25271 271747
22259 13161 139065
11962 11963 246633
6027 42401 111350
2...

output:

3452252

result:

ok single line: '3452252'

Test #19:

score: 0
Accepted
time: 108ms
memory: 16032kb

input:

0 1000000000000
100000 100000
76652 75748 1000000
54503 410 1000000
95854 23750 1000000
11445 88885 1000000
70248 67403 1000000
89819 33228 1000000
53327 47691 1000000
35900 69280 1000000
61703 60594 1000000
98235 54103 1000000
30501 87112 1000000
46504 69420 1000000
79259 261 1000000
91015 75131 10...

output:

99999000000

result:

ok single line: '99999000000'

Test #20:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

4711 4711
2 2
1 2 4711
2 1 1

output:

0

result:

ok single line: '0'

Test #21:

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

input:

4711 4711
2 2
1 2 474747
2 1 1

output:

470036

result:

ok single line: '470036'

Test #22:

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

input:

4711 4711
2 2
1 2 1
2 1 1

output:

0

result:

ok single line: '0'

Test #23:

score: 0
Accepted
time: 1371ms
memory: 27204kb

input:

466203357 77603765794
99999 100000
12626 30624 133991
54084 76981 120718
31302 47164 349580
64616 92251 75700
79712 64330 221208
17883 50134 166522
3924 86759 261333
22163 31579 312046
68137 89283 110677
3736 97637 194056
97974 22787 274442
69957 74832 46946
67090 39875 356033
18335 18009 279078
566...

output:

17369156291

result:

ok single line: '17369156291'

Test #24:

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

input:

255973 739353
4 16
1 1 89391
2 3 260316
3 4 957401
2 2 836594
3 2 333745
3 1 412788
4 1 966126
2 1 141950
1 2 881337
4 4 289202
4 3 682024
3 3 482613
1 3 632804
1 4 876461
2 4 653881
4 2 281927

output:

620488

result:

ok single line: '620488'

Test #25:

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

input:

36 298
5 25
3 2 1687
3 4 1141
1 1 661
1 4 530
5 5 1591
2 3 343
4 4 1077
3 3 1623
2 5 1402
5 2 626
1 2 736
4 5 941
3 5 237
5 4 667
2 2 1736
3 1 667
1 5 236
2 4 1536
4 3 1370
4 1 1659
4 2 1181
1 3 240
5 3 1088
2 1 514
5 1 1239

output:

236

result:

ok single line: '236'

Test #26:

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

input:

447 1812
6 36
6 4 1365
6 3 1753
1 1 663
5 4 1163
5 5 1877
6 5 726
2 5 411
1 3 620
6 6 48
3 4 51
3 2 109
5 1 1704
4 1 299
4 6 1898
1 4 1225
6 1 406
2 6 809
5 6 268
2 4 518
1 5 860
2 3 843
2 2 1648
4 3 413
6 2 1896
5 2 351
1 6 1950
3 5 1714
2 1 1519
5 3 162
3 3 1010
3 1 262
4 2 812
4 4 1331
1 2 166
3 ...

output:

398

result:

ok single line: '398'

Test #27:

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

input:

596 1945
7 49
1 3 1116
7 7 629
2 2 1060
3 3 1880
2 7 151
1 5 393
1 2 524
2 1 728
3 7 942
4 1 1947
7 4 1287
5 3 629
6 4 1733
6 2 257
6 6 85
4 5 512
2 3 824
1 7 1671
3 2 335
4 6 739
5 7 314
3 5 1910
4 4 447
7 1 474
7 3 1821
4 2 481
7 6 729
6 3 1945
1 1 610
2 5 1152
6 5 1324
7 2 1078
5 4 180
7 5 610
6 ...

output:

629

result:

ok single line: '629'

Test #28:

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

input:

408 1029
8 64
1 3 1408
6 3 641
2 2 130
7 3 484
6 6 465
7 6 1149
3 1 1885
8 3 830
7 7 667
5 1 230
7 1 795
3 4 818
1 2 1981
8 2 1237
5 2 1257
5 8 1548
2 1 1452
5 5 1290
3 7 1093
2 6 665
4 7 328
2 4 1414
6 7 460
4 6 464
8 8 811
5 4 1334
8 4 1009
3 2 587
2 5 425
4 8 1636
4 3 35
4 2 802
2 3 1144
3 5 449
...

output:

466

result:

ok single line: '466'

Test #29:

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

input:

502 1628
10 100
8 3 1721
8 10 1964
6 1 1674
5 6 1071
5 10 1737
1 9 919
4 6 140
4 3 1513
3 10 1652
9 7 1837
6 6 1793
3 2 1380
8 1 692
2 8 1441
6 3 1536
3 1 1353
3 3 995
10 2 182
1 8 1334
5 1 1531
1 3 1143
2 5 484
10 7 1219
4 9 1918
4 5 852
1 2 1236
8 4 418
10 9 404
10 1 1533
5 9 903
9 10 1502
6 5 137...

output:

572

result:

ok single line: '572'

Test #30:

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

input:

608 743
15 225
6 2 679
3 14 1043
14 11 338
10 9 549
2 5 808
3 12 679
2 6 1751
1 10 959
2 9 1020
8 15 1497
3 15 982
7 14 188
2 13 5
15 9 1390
15 7 1684
12 9 1111
1 7 660
13 1 300
14 4 338
12 7 714
9 10 1230
13 12 680
3 5 850
2 1 1151
4 11 1942
5 4 1806
11 11 1660
10 8 1128
12 4 23
5 9 28
9 1 1935
7 1...

output:

135

result:

ok single line: '135'

Test #31:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

811793 968475
20 400
1 2 798505
10 3 3184
6 7 307073
1 3 374424
18 20 168264
5 11 375896
10 10 179161
19 8 468549
1 7 516920
2 8 55478
17 11 130792
13 18 539784
4 19 41030
10 15 52841
2 5 723641
4 20 352913
17 9 733553
4 1 267410
17 18 613351
16 13 37183
6 16 729745
16 5 739915
11 9 532824
11 13 425...

output:

156682

result:

ok single line: '156682'

Test #32:

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

input:

331151 459509
25 625
25 22 709870
5 6 201585
19 22 750907
6 4 670110
22 11 36573
3 4 441835
22 13 280759
10 18 349830
4 8 189334
4 3 206738
18 12 592765
21 21 572424
11 1 660410
16 5 753689
3 9 587276
16 23 931029
4 4 455470
22 2 526681
20 10 205205
16 11 798601
9 4 303383
18 20 158468
6 1 48262
15 ...

output:

111537

result:

ok single line: '111537'

Test #33:

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

input:

544664 719807
41 1681
37 19 611018
35 18 190175
18 22 608788
19 36 379644
32 19 196657
5 2 916765
24 17 296962
4 38 372021
32 13 957122
8 23 715895
41 33 355628
13 12 252537
35 38 727218
27 12 978489
1 7 441918
12 40 749055
33 34 500258
28 13 469570
16 21 432838
24 32 85132
17 12 386585
13 13 150259...

output:

81907

result:

ok single line: '81907'

Test #34:

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

input:

624550 644637
53 2809
34 14 10924
17 41 363801
35 7 483850
50 26 142667
53 5 236761
47 47 525439
30 32 779911
45 32 422375
37 33 904663
53 1 910318
4 34 395520
43 51 352995
5 22 743145
25 48 420229
37 18 601715
22 23 238660
45 11 178119
34 20 623557
26 49 697308
31 4 661238
4 3 823844
1 30 45566
30 ...

output:

19636

result:

ok single line: '19636'

Test #35:

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

input:

242958 492638
62 3844
9 10 492389
55 16 913892
34 41 799665
34 36 663196
54 3 81069
10 26 456318
33 26 675116
17 61 427604
30 61 414244
41 51 979720
42 60 370566
46 47 141764
34 61 146381
26 8 379902
44 23 554640
48 7 485728
24 27 786244
7 16 471092
2 57 417841
62 21 568938
15 55 730900
9 32 435862
...

output:

61964

result:

ok single line: '61964'

Test #36:

score: 0
Accepted
time: 1ms
memory: 3888kb

input:

218998 418028
85 7225
62 74 989517
72 79 22530
60 20 68213
32 57 13308
48 71 641303
3 83 947883
83 51 120732
78 15 97359
83 31 645903
45 82 219896
56 42 647671
4 82 313178
74 5 773197
37 53 259917
79 56 333079
40 54 652808
70 71 944790
37 1 433865
79 50 563384
62 16 88834
85 64 825648
28 34 525876
1...

output:

47231

result:

ok single line: '47231'

Test #37:

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

input:

39500 358754
101 10201
26 61 754449
47 55 855640
10 100 43057
2 16 405291
86 33 319015
63 8 386736
101 30 887407
29 62 851355
15 30 455506
53 69 173462
9 79 317595
55 41 177874
45 66 806945
23 57 232559
100 99 338760
4 20 526519
79 20 151459
27 99 126806
49 12 306875
5 58 971424
91 35 980324
21 12 7...

output:

22566

result:

ok single line: '22566'

Test #38:

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

input:

104183 540196
200 40000
156 175 911730
117 115 495423
98 171 282993
126 158 490843
134 31 35414
27 31 553730
32 136 753798
32 20 308052
6 19 403396
122 111 355684
119 33 994895
118 21 948900
165 138 502973
99 171 848412
141 2 197231
114 136 649949
157 17 190222
97 166 749680
25 21 29972
148 147 5667...

output:

2051

result:

ok single line: '2051'

Test #39:

score: 0
Accepted
time: 14ms
memory: 4844kb

input:

463310 902247
513 40000
271 395 640778
261 149 798478
121 371 453500
455 396 711054
289 279 527055
448 151 524568
494 115 24954
35 409 943707
463 193 843753
338 294 618701
315 161 557293
438 405 932171
380 427 669976
157 457 492086
432 358 411854
105 193 881527
331 115 50728
396 387 664905
140 98 80...

output:

49306

result:

ok single line: '49306'

Test #40:

score: 0
Accepted
time: 40ms
memory: 6152kb

input:

255528 443253
1001 100000
316 539 848031
365 857 928639
553 146 975498
899 587 624999
905 14 803872
72 407 627523
825 315 149130
208 945 751776
329 933 439121
908 911 126593
573 709 860303
17 106 362768
746 557 607596
175 732 780692
854 426 116727
796 244 465286
32 839 88289
838 414 55886
871 422 95...

output:

54427

result:

ok single line: '54427'

Test #41:

score: 0
Accepted
time: 39ms
memory: 6400kb

input:

75353 697836
2222 100000
1834 826 674398
1955 1092 587152
400 1309 456098
1807 1042 697945
1993 989 480675
723 1508 531847
1526 1527 70028
20 1948 416022
1954 1425 881632
30 1129 883402
1006 814 346047
1358 2165 588796
1576 2111 209477
1609 234 610616
1674 881 360714
689 318 309648
414 297 217123
48...

output:

177310

result:

ok single line: '177310'

Test #42:

score: 0
Accepted
time: 39ms
memory: 6760kb

input:

691772 873527
4213 100000
445 2386 863292
1160 4049 624352
2970 484 911775
3836 970 963932
3034 83 209529
2711 3538 775118
3338 1655 806121
3179 2368 166305
881 517 183725
3166 1600 573983
386 2786 720696
772 1160 643642
2808 3512 233968
290 3761 246611
1254 2132 8265
3016 1184 521938
977 71 919915
...

output:

181755

result:

ok single line: '181755'

Test #43:

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

input:

409593 466026
10202 100000
4869 9183 90065
823 1251 312011
1719 5942 380673
8494 7939 251391
9011 9795 154121
9238 1870 128675
9322 8007 629367
6057 3162 640648
8732 2197 822548
861 366 311491
8289 8270 541154
7435 7479 321109
3834 5702 479220
2778 2683 149854
9124 4726 552286
993 4279 426760
2676 9...

output:

448693

result:

ok single line: '448693'