QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#461444#3302. Just Meetinglegenc6yRE 6ms50828kbC++141.9kb2024-07-02 19:04:192024-07-02 19:04:20

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 50688kb

input:

4 2
1 2 5
2 4 3

output:

14

result:

ok single line: '14'

Test #2:

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

input:

4 4
1 2 10
1 3 20
2 4 30
3 4 40

output:

-1

result:

ok single line: '-1'

Test #3:

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

input:

130 247
21 130 9826251
113 14 6000798
73 55 6258090
52 88 9123162
58 57 1750276
41 40 1630609
104 103 1750276
5 61 8486225
47 52 9243976
65 64 746976
130 87 6380955
26 25 2351803
71 70 189606
47 49 4015464
49 48 1630609
87 63 5089117
124 58 9959337
73 20 3496765
78 34 7789869
69 68 2994591
96 95 208...

output:

-1

result:

ok single line: '-1'

Test #4:

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

input:

207 19
11 10 732134
5 4 444528
13 12 723858
17 16 64959
10 9 133983
9 8 661210
4 3 416495
15 14 740303
18 17 566802
19 18 692914
14 13 602221
16 15 144822
6 5 776502
7 6 570929
3 2 60173
20 19 486747
2 1 779525
8 7 606746
12 11 643657

output:

37712525

result:

ok single line: '37712525'

Test #5:

score: 0
Accepted
time: 6ms
memory: 50736kb

input:

186 269
142 141 5373289
66 65 4910100
110 109 7759528
94 93 2809357
50 49 1261298
2 1 5272448
146 145 602071
68 67 5272448
118 117 4022083
137 174 9510724
120 119 7808412
115 97 9942092
151 150 1261298
43 119 9650949
44 43 8315877
113 66 9166118
30 29 9014984
143 142 4621918
162 69 9459621
172 171 2...

output:

-1

result:

ok single line: '-1'

Test #6:

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

input:

291 20
4 3 2808901
10 9 573699
20 19 616858
8 7 1248928
9 8 483833
17 16 700554
6 5 455036
3 2 1779562
5 4 632027
11 10 1801411
15 14 661123
14 13 1224817
18 17 2104486
19 18 4193045
7 6 1540920
16 15 2216428
21 20 1670480
12 11 2433712
13 12 1935714
2 1 1079356

output:

140337842

result:

ok single line: '140337842'

Test #7:

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

input:

127 151
83 82 215103
52 51 128121
77 76 83069
87 40 2112995
10 9 158296
6 84 7414107
19 18 158296
126 125 180932
8 7 315382
4 3 158296
124 123 588493
61 60 154283
46 45 389333
52 27 1675967
90 89 552426
41 40 230260
41 36 8189327
48 47 257287
111 110 441447
35 34 158296
24 23 224466
37 36 6463039
16...

output:

-1

result:

ok single line: '-1'

Test #8:

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

input:

73 10
3 2 12608
11 10 82292
8 7 1581658
6 5 223002
4 3 131058
7 6 220313
10 9 1595495
5 4 722402
2 1 465004
9 8 942590

output:

13029938

result:

ok single line: '13029938'

Test #9:

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

input:

211 50
43 42 3354312
7 6 3216910
2 1 696369
25 24 1222424
51 50 2830101
35 34 1821861
33 32 1214397
39 38 4011606
28 27 1492176
46 45 1632220
5 4 1008492
17 16 2242236
18 17 2119279
21 20 1611326
47 46 1010910
23 22 4364287
19 18 364960
27 26 1487304
8 7 3361466
44 43 1691055
26 25 2407192
22 21 429...

output:

516852022

result:

ok single line: '516852022'

Test #10:

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

input:

200 265
21 61 4529486
55 54 3359530
139 138 2904011
142 141 2149180
102 101 1858872
88 87 3350392
198 197 1922055
100 99 1469856
37 36 3979928
45 44 3590367
81 80 952405
158 157 2527671
119 49 5353622
60 59 952405
185 184 3801765
11 10 1348271
72 195 4752711
40 39 4263919
187 199 9582700
18 12 89877...

output:

-1

result:

ok single line: '-1'

Test #11:

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

input:

194 192
86 85 3151812
67 66 3860526
101 100 3954555
15 14 2724016
157 156 2680597
31 30 1716299
129 128 845790
166 165 2257479
11 10 2302409
126 125 3609729
4 3 585471
96 95 611939
186 185 4710372
97 96 3562335
57 56 2024321
16 15 1388484
147 146 220786
63 62 4662185
161 160 4252836
109 108 4706726
...

output:

3181762668

result:

ok single line: '3181762668'

Test #12:

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

input:

163 111
14 13 3589778
77 76 4652253
10 9 5010585
73 72 2789197
31 30 3817748
23 22 3151559
111 110 4135513
25 24 970105
75 74 1515231
50 49 279316
79 78 2027052
76 75 4660194
38 37 4168082
52 51 8380363
36 35 874055
32 31 4723623
5 4 3714440
83 82 2971393
88 87 7920753
61 60 7459923
72 71 7390683
18...

output:

3338550669

result:

ok single line: '3338550669'

Test #13:

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

input:

179 247
61 10 6435117
27 26 4239625
84 83 3647344
68 67 2543825
60 59 1966036
39 38 4236287
5 4 2360004
105 104 1801120
16 15 5411043
135 134 4791690
57 56 445378
110 109 3114742
143 81 7141724
32 31 766026
55 54 5113099
132 131 1371746
32 105 6580855
107 106 6017616
136 130 9398144
54 104 8968672
1...

output:

-1

result:

ok single line: '-1'

Test #14:

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

input:

54 30
13 12 4451759
27 26 4442161
12 11 2398964
9 8 4222140
16 15 2851764
14 13 1091330
23 22 4925509
15 14 4995104
19 18 4155182
2 1 397633
25 24 5352138
10 9 1815947
11 10 1671289
21 20 140242
3 2 2736736
4 3 5656461
22 21 5107000
31 30 4404262
5 4 4634846
7 6 952910
28 27 2313494
17 16 5633144
24...

output:

459486801

result:

ok single line: '459486801'

Test #15:

score: 0
Accepted
time: 6ms
memory: 48704kb

input:

255 227
227 226 4920207
27 26 5037533
116 115 5343557
170 169 1256435
108 107 871150
47 46 3123564
132 131 1484411
74 73 3818355
38 37 5063371
104 103 4719554
65 64 5249186
32 31 4095684
86 85 55312
43 42 1482335
113 112 2654992
212 211 630537
163 162 5385315
53 52 3520896
171 170 3905741
61 60 4107...

output:

3433971899

result:

ok single line: '3433971899'

Test #16:

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

input:

130 284
59 58 5026899
29 53 9798603
21 20 5026899
81 110 9388568
19 18 5026899
103 28 7491797
126 39 8479438
48 33 7654948
11 80 9444096
14 103 9529861
5 78 9197396
59 29 9031977
79 78 6982901
37 36 5026899
105 104 5026899
50 49 5026899
107 106 6982901
48 9 8233156
102 128 8941370
34 69 8983296
56 6...

output:

-1

result:

ok single line: '-1'

Test #17:

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

input:

85 118
38 37 1209805
8 32 7722935
2 1 2288425
30 29 2433690
80 18 6869924
61 60 764819
71 70 1347315
53 52 401541
78 36 2656698
26 67 3714951
78 77 2296467
82 81 1999286
73 72 965011
68 67 401541
52 51 401541
59 58 1305475
24 23 672477
63 62 1209805
47 46 1887669
70 69 1945153
60 59 672477
7 6 83521...

output:

-1

result:

ok single line: '-1'

Test #18:

score: 0
Accepted
time: 6ms
memory: 50824kb

input:

57 93
32 49 7850550
4 10 8264827
46 44 9617973
55 50 8450736
39 38 4401567
47 46 2582579
45 44 7085748
24 23 2582579
31 42 8610501
35 4 7090329
46 15 9473646
40 39 4808728
52 51 1800643
26 25 4401567
5 4 6129129
44 43 2199256
15 45 9679645
43 42 1800643
4 3 3658022
46 45 5133878
21 27 9079232
30 54 ...

output:

-1

result:

ok single line: '-1'

Test #19:

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

input:

176 175
50 49 6513742
144 143 6684921
167 166 7484424
60 59 6719840
89 88 4294989
111 110 3246132
108 107 477840
107 106 4068020
37 36 6921678
124 123 6250225
122 121 7341465
140 139 4612622
115 114 2519935
7 6 426614
59 58 2754419
116 115 855318
27 26 7490466
138 137 3571427
45 44 4257340
130 129 4...

output:

4589580169

result:

ok single line: '4589580169'

Test #20:

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

input:

105 176
16 15 4418819
2 42 9243328
42 13 7188238
94 21 7640939
6 90 8922062
26 25 2066736
20 19 4889528
33 32 3105227
72 18 8068211
103 40 8203087
103 44 7362663
76 73 6708024
5 4 617845
65 64 2063666
49 48 3107775
97 96 4723373
96 95 360424
40 39 4215407
36 71 6450278
31 2 6580901
21 20 3513161
19 ...

output:

-1

result:

ok single line: '-1'

Test #21:

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

input:

215 291
209 92 7288216
41 7 7598611
69 54 8843697
44 43 1985267
203 202 1902691
130 129 3202004
4 3 2232443
85 135 4087266
93 107 7656574
197 52 6366254
206 26 8742958
202 17 4625111
146 145 1259292
176 175 1157932
40 39 558337
178 177 1605391
213 125 9053510
191 190 3380859
153 210 4384068
213 166 ...

output:

-1

result:

ok single line: '-1'

Test #22:

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

input:

262 126
3 2 3098795
103 102 8564219
83 82 6036829
115 114 6536092
79 78 8106175
24 23 165638
77 76 3620360
124 123 1049822
30 29 7061028
68 67 7410671
78 77 6214815
31 30 5535880
113 112 431145
5 4 37979
125 124 798280
38 37 3593923
28 27 1139498
102 101 2951859
45 44 5217969
23 22 5262433
74 73 170...

output:

3786295028

result:

ok single line: '3786295028'

Test #23:

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

input:

81 126
43 42 4154398
54 10 9252918
75 6 8019509
2 73 8141826
60 66 8956596
53 52 1715638
68 67 4586396
6 5 2057336
39 27 8261441
52 81 8374317
58 32 8070467
7 6 7306819
39 38 1715638
70 69 1715638
77 76 1715638
69 68 4559684
22 21 3052432
48 47 3869704
49 48 6519881
13 12 6783759
72 71 3052432
75 74...

output:

-1

result:

ok single line: '-1'

Test #24:

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

input:

110 263
67 16 9480464
5 106 9511889
108 10 9842482
14 13 6490170
52 51 5342373
75 106 8056903
75 74 6893255
89 19 8479985
39 96 9546633
14 27 9239970
51 12 9814502
85 62 8741653
55 54 3439003
41 40 3439003
58 46 7596137
13 12 5342373
72 12 9887214
109 29 8179889
26 22 8605520
75 104 8776782
24 85 79...

output:

-1

result:

ok single line: '-1'

Test #25:

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

input:

136 134
135 134 2766651
110 109 5856753
95 94 4429621
67 66 4689372
97 96 5491403
113 112 466996
122 121 2977090
9 8 1203322
114 113 4874015
98 97 5012384
36 35 4509561
15 14 4117114
120 119 691244
80 79 408170
79 78 1116052
106 105 2968691
3 2 1530925
24 23 2620341
59 58 3793740
77 76 3875449
35 34...

output:

3301143919

result:

ok single line: '3301143919'

Test #26:

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

input:

266 48
29 28 586556
20 19 552538
13 12 85788
27 26 201902
26 25 449501
35 34 310529
41 40 147033
38 37 608042
25 24 244512
8 7 282783
34 33 122795
18 17 339531
40 39 333255
2 1 269756
44 43 134084
37 36 710342
31 30 48165
3 2 213422
6 5 593630
36 35 285921
4 3 380396
42 41 692517
16 15 36741
12 11 4...

output:

79688769

result:

ok single line: '79688769'

Test #27:

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

input:

138 135
31 30 6462399
53 52 6521505
36 35 7560087
27 26 6523700
128 127 4135279
26 25 2267516
48 47 5633730
131 130 3649191
118 117 6590437
41 40 5992010
71 70 7325138
122 121 4403757
105 104 812024
94 93 4203569
64 63 1072970
120 119 3220712
86 85 7579735
60 59 2870886
84 83 4076556
135 134 4430326...

output:

3644785203

result:

ok single line: '3644785203'

Test #28:

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

input:

189 6
6 5 1674399
3 2 1099952
4 3 3296551
5 4 3000448
7 6 3977167
2 1 21314

output:

28966397

result:

ok single line: '28966397'

Test #29:

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

input:

105 168
22 21 1381889
25 72 8746469
32 2 4821499
38 1 5696587
33 70 8089763
28 27 801183
50 49 1548994
24 23 1013932
90 70 6159074
103 57 6345002
58 86 5488325
52 90 3194225
41 40 275771
26 25 801183
85 84 984628
93 92 1530617
53 52 1108971
104 103 1381889
56 1 3124366
58 49 3067932
102 101 1108971
...

output:

-1

result:

ok single line: '-1'

Test #30:

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

input:

31 206
3 7 8365285
1 6 9544049
1 25 8773283
13 31 8930943
31 30 8365285
11 27 8365285
26 31 8365285
20 16 8365285
30 26 8930943
10 4 9185480
26 4 8773283
11 24 8393277
30 4 8365285
28 21 8365285
27 10 8365285
30 10 8365285
21 30 8365285
18 28 8365285
29 19 8365285
11 16 8365285
22 25 8365285
8 15 83...

output:

-1

result:

ok single line: '-1'

Test #31:

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

input:

247 26
27 26 4727371
19 18 4488047
13 12 1748900
20 19 4283943
23 22 3014087
18 17 6572785
17 16 6089318
5 4 6207150
7 6 3635058
6 5 1481383
2 1 6646421
8 7 1404625
3 2 1138670
25 24 256171
10 9 2970148
15 14 7262305
9 8 6619556
26 25 4332493
16 15 5598491
4 3 3562409
12 11 1543514
21 20 7066703
24 ...

output:

629032100

result:

ok single line: '629032100'

Test #32:

score: -100
Runtime Error

input:

300000 300000
282382 282381 3148641
94384 94383 3148641
162159 162158 3148641
276002 276001 3148641
34111 34110 3148641
95098 95097 3148641
229144 229143 3148641
4779 4778 3148641
239092 239091 3148641
107595 107594 3148641
293286 293285 3148641
88743 88742 3148641
216793 216792 3148641
75237 75236 ...

output:


result: