QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#690789#1825. The King's Guardsucup-team425#AC ✓15ms4948kbC++205.0kb2024-10-31 03:47:472024-10-31 03:47:49

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

8

result:

ok answer is '8'

Test #2:

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

input:

10 19 6
1 5 761
6 8 606
3 9 648
2 4 115
5 8 814
1 2 712
4 10 13
5 10 797
3 4 956
1 7 73
5 7 192
2 7 110
5 9 302
3 6 120
6 9 494
1 3 668
3 7 966
6 10 974
3 8 41
2 10 5
3 6 4 3
2 1 7
2 10 8
3 10 7 8
2 2 1

output:

429

result:

ok answer is '429'

Test #3:

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

input:

10 43 3
1 3 656
2 6 856
4 10 99
5 6 900
2 7 766
4 7 582
2 8 135
5 7 831
3 5 12
3 10 789
1 8 66
4 9 390
1 7 238
6 7 960
1 4 624
3 9 602
7 10 366
5 8 526
2 9 561
6 10 722
2 5 904
3 4 35
1 9 768
5 9 457
6 8 61
4 6 192
4 5 96
5 10 747
8 9 611
7 8 953
3 8 449
2 4 228
1 6 197
9 10 160
3 6 869
1 2 785
4 8 ...

output:

526

result:

ok answer is '526'

Test #4:

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

input:

277 9038 1
226 260 740
44 226 376
151 263 611
67 269 241
120 181 677
259 271 782
37 52 310
48 152 452
168 266 823
85 234 100
46 201 738
129 153 301
69 147 434
13 72 764
13 234 316
171 222 398
214 255 21
112 158 430
20 118 407
45 152 971
205 214 272
221 275 362
198 268 472
117 176 207
31 75 652
139 1...

output:

5375

result:

ok answer is '5375'

Test #5:

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

input:

297 27966 132
15 197 980
226 259 950
161 168 142
118 176 834
157 221 806
24 210 432
212 242 838
110 166 177
78 170 801
52 166 3
89 213 448
45 170 626
250 251 268
93 222 679
7 128 839
5 7 320
132 191 1
192 295 717
36 231 542
162 175 508
173 178 458
211 272 926
46 168 145
19 150 805
165 262 198
50 179...

output:

775

result:

ok answer is '775'

Test #6:

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

input:

7 7 4
1 3 7
1 4 6
2 3 5
2 4 6
4 5 10
4 6 10
4 7 10
5 4 3 2 7 5
6 5 2 6 7 4 1
2 2 3
6 7 2 5 3 1 6

output:

17

result:

ok answer is '17'

Test #7:

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

input:

300 44850 299
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
1 9 1
1 10 1
1 11 1
1 12 1
1 13 1
1 14 1
1 15 1
1 16 1
1 17 1
1 18 1
1 19 1
1 20 1
1 21 1
1 22 1
1 23 1
1 24 1
1 25 1
1 26 1
1 27 1
1 28 1
1 29 1
1 30 1
1 31 1
1 32 1
1 33 1
1 34 1
1 35 1
1 36 1
1 37 1
1 38 1
1 39 1
1 40 1
1 41 1
1 42 1
1 43 1
...

output:

1000

result:

ok answer is '1000'

Test #8:

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

input:

300 44850 299
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
1 9 1
1 10 1
1 11 1
1 12 1
1 13 1
1 14 1
1 15 1
1 16 1
1 17 1
1 18 1
1 19 1
1 20 1
1 21 1
1 22 1
1 23 1
1 24 1
1 25 1
1 26 1
1 27 1
1 28 1
1 29 1
1 30 1
1 31 1
1 32 1
1 33 1
1 34 1
1 35 1
1 36 1
1 37 1
1 38 1
1 39 1
1 40 1
1 41 1
1 42 1
1 43 1
...

output:

1000

result:

ok answer is '1000'

Test #9:

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

input:

300 44850 150
1 2 4
1 3 4
1 4 4
1 5 3
1 6 10
1 7 4
1 8 8
1 9 5
1 10 4
1 11 9
1 12 9
1 13 1
1 14 3
1 15 5
1 16 7
1 17 5
1 18 2
1 19 6
1 20 4
1 21 10
1 22 5
1 23 7
1 24 2
1 25 2
1 26 4
1 27 4
1 28 5
1 29 8
1 30 10
1 31 9
1 32 1
1 33 7
1 34 5
1 35 4
1 36 6
1 37 8
1 38 1
1 39 2
1 40 1
1 41 1
1 42 1
1 43...

output:

249

result:

ok answer is '249'

Test #10:

score: 0
Accepted
time: 12ms
memory: 4656kb

input:

300 44850 150
1 2 70
1 3 26
1 4 76
1 5 74
1 6 98
1 7 72
1 8 66
1 9 25
1 10 36
1 11 57
1 12 8
1 13 88
1 14 98
1 15 33
1 16 85
1 17 56
1 18 16
1 19 62
1 20 41
1 21 81
1 22 18
1 23 15
1 24 69
1 25 11
1 26 29
1 27 62
1 28 64
1 29 41
1 30 92
1 31 29
1 32 99
1 33 40
1 34 30
1 35 23
1 36 49
1 37 6
1 38 84
...

output:

1299

result:

ok answer is '1299'

Test #11:

score: 0
Accepted
time: 15ms
memory: 4692kb

input:

300 44850 150
1 2 3
1 3 2
1 4 20
1 5 77
1 6 77
1 7 23
1 8 39
1 9 57
1 10 83
1 11 60
1 12 6
1 13 78
1 14 64
1 15 62
1 16 41
1 17 88
1 18 77
1 19 58
1 20 39
1 21 18
1 22 43
1 23 26
1 24 40
1 25 61
1 26 23
1 27 6
1 28 47
1 29 100
1 30 59
1 31 92
1 32 60
1 33 13
1 34 57
1 35 55
1 36 99
1 37 77
1 38 63
1...

output:

1310

result:

ok answer is '1310'

Test #12:

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

input:

300 44551 299
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
1 9 1
1 10 1
1 11 1
1 12 1
1 13 1
1 14 1
1 15 1
1 16 1
1 17 1
1 18 1
1 19 1
1 20 1
1 21 1
1 22 1
1 23 1
1 24 1
1 25 1
1 26 1
1 27 1
1 28 1
1 29 1
1 30 1
1 31 1
1 32 1
1 33 1
1 34 1
1 35 1
1 36 1
1 37 1
1 38 1
1 39 1
1 40 1
1 41 1
1 42 1
1 43 1
...

output:

-1

result:

ok answer is '-1'

Test #13:

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

input:

300 44552 299
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
1 9 1
1 10 1
1 11 1
1 12 1
1 13 1
1 14 1
1 15 1
1 16 1
1 17 1
1 18 1
1 19 1
1 20 1
1 21 1
1 22 1
1 23 1
1 24 1
1 25 1
1 26 1
1 27 1
1 28 1
1 29 1
1 30 1
1 31 1
1 32 1
1 33 1
1 34 1
1 35 1
1 36 1
1 37 1
1 38 1
1 39 1
1 40 1
1 41 1
1 42 1
1 43 1
...

output:

2

result:

ok answer is '2'

Test #14:

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

input:

300 44552 300
1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
1 9 1
1 10 1
1 11 1
1 12 1
1 13 1
1 14 1
1 15 1
1 16 1
1 17 1
1 18 1
1 19 1
1 20 1
1 21 1
1 22 1
1 23 1
1 24 1
1 25 1
1 26 1
1 27 1
1 28 1
1 29 1
1 30 1
1 31 1
1 32 1
1 33 1
1 34 1
1 35 1
1 36 1
1 37 1
1 38 1
1 39 1
1 40 1
1 41 1
1 42 1
1 43 1
...

output:

-1

result:

ok answer is '-1'

Test #15:

score: 0
Accepted
time: 8ms
memory: 4124kb

input:

300 44850 299
1 2 124
1 3 199
1 4 812
1 5 959
1 6 760
1 7 501
1 8 467
1 9 351
1 10 495
1 11 117
1 12 123
1 13 309
1 14 722
1 15 926
1 16 532
1 17 94
1 18 807
1 19 865
1 20 139
1 21 887
1 22 147
1 23 55
1 24 214
1 25 900
1 26 301
1 27 834
1 28 523
1 29 375
1 30 187
1 31 851
1 32 120
1 33 763
1 34 859...

output:

1

result:

ok answer is '1'

Test #16:

score: 0
Accepted
time: 8ms
memory: 4188kb

input:

300 44850 300
1 2 308
1 3 313
1 4 997
1 5 3
1 6 741
1 7 653
1 8 653
1 9 235
1 10 788
1 11 215
1 12 982
1 13 346
1 14 444
1 15 721
1 16 855
1 17 348
1 18 549
1 19 355
1 20 836
1 21 53
1 22 207
1 23 944
1 24 880
1 25 569
1 26 951
1 27 923
1 28 511
1 29 47
1 30 506
1 31 187
1 32 934
1 33 777
1 34 652
1...

output:

0

result:

ok answer is '0'

Test #17:

score: 0
Accepted
time: 11ms
memory: 4784kb

input:

300 44850 300
1 2 226
1 3 881
1 4 502
1 5 213
1 6 52
1 7 177
1 8 946
1 9 798
1 10 423
1 11 485
1 12 498
1 13 368
1 14 879
1 15 309
1 16 24
1 17 642
1 18 698
1 19 617
1 20 279
1 21 918
1 22 303
1 23 385
1 24 879
1 25 489
1 26 345
1 27 591
1 28 536
1 29 817
1 30 342
1 31 91
1 32 232
1 33 572
1 34 968
...

output:

0

result:

ok answer is '0'

Test #18:

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

input:

300 44850 300
1 2 433
1 3 780
1 4 144
1 5 734
1 6 131
1 7 867
1 8 980
1 9 901
1 10 226
1 11 386
1 12 44
1 13 851
1 14 740
1 15 924
1 16 218
1 17 895
1 18 156
1 19 695
1 20 491
1 21 375
1 22 171
1 23 460
1 24 308
1 25 59
1 26 483
1 27 494
1 28 495
1 29 859
1 30 483
1 31 347
1 32 343
1 33 743
1 34 734...

output:

0

result:

ok answer is '0'

Test #19:

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

input:

300 44313 219
81 124 61
95 185 213
123 238 928
171 206 319
32 173 62
16 102 979
111 222 360
52 223 579
81 139 955
25 181 959
9 295 276
90 254 725
130 132 990
231 259 912
216 218 789
149 195 575
204 211 885
39 100 762
7 233 775
54 116 500
31 283 84
31 189 387
101 140 278
61 227 587
38 97 30
115 237 3...

output:

106

result:

ok answer is '106'

Test #20:

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

input:

300 44614 243
59 192 809
114 169 523
55 270 698
127 128 619
210 288 64
165 184 539
158 200 385
50 277 590
151 226 964
9 41 37
37 251 870
222 231 98
105 120 558
2 156 18
164 184 412
120 199 11
157 183 595
143 146 383
190 240 577
61 163 695
46 85 107
92 299 851
231 251 780
4 114 752
21 67 218
70 166 3...

output:

63

result:

ok answer is '63'

Test #21:

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

input:

300 43263 44
172 220 779
60 269 398
264 283 307
115 235 895
140 175 125
113 257 841
155 262 979
188 240 202
59 243 155
219 230 326
229 247 793
19 142 783
161 206 203
26 108 671
51 93 417
22 195 471
175 203 143
126 266 568
14 210 466
39 251 65
145 151 566
69 118 667
110 268 109
51 122 889
5 156 472
1...

output:

1017

result:

ok answer is '1017'

Test #22:

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

input:

300 36802 149
79 150 325
1 254 817
13 285 630
153 275 180
61 276 135
68 187 68
271 285 391
10 164 987
34 144 700
64 197 429
87 206 326
106 179 613
11 263 100
22 180 272
44 69 424
66 128 796
123 265 287
254 270 663
52 56 8
4 210 107
146 238 680
151 238 313
134 241 954
82 135 924
191 273 400
116 145 1...

output:

419

result:

ok answer is '419'

Test #23:

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

input:

300 40463 41
128 189 463
50 96 453
29 209 998
13 77 971
80 207 976
145 256 634
17 36 703
6 49 159
124 199 6
121 156 33
30 37 276
118 266 598
266 284 488
212 224 418
267 279 305
150 281 794
269 290 60
57 260 971
121 193 948
32 227 531
26 127 683
9 194 806
147 299 568
121 155 751
97 273 525
33 239 729...

output:

1085

result:

ok answer is '1085'

Test #24:

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

input:

300 39338 137
5 144 55
30 266 119
49 162 697
139 163 458
57 246 798
55 291 712
32 212 941
106 203 194
75 177 813
6 147 163
41 53 780
15 254 524
64 141 2
97 248 834
2 270 407
293 299 511
139 278 720
81 254 968
54 255 692
226 291 31
44 265 922
60 229 72
47 229 343
112 157 893
101 166 927
92 264 392
21...

output:

470

result:

ok answer is '470'

Test #25:

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

input:

300 1978 261
15 180 594
42 91 394
71 212 11
79 281 531
61 70 169
80 258 921
85 173 632
48 142 543
34 66 483
71 238 391
7 25 309
108 297 333
98 252 990
206 222 140
9 275 58
49 186 601
222 265 566
15 109 74
198 286 32
49 258 658
200 226 142
52 123 566
86 279 989
20 241 794
129 297 367
132 154 91
112 1...

output:

663

result:

ok answer is '663'

Test #26:

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

input:

300 11083 192
54 112 651
211 236 605
198 291 978
28 145 728
109 111 818
180 273 77
25 106 921
246 261 2
170 174 915
11 173 783
51 57 90
69 111 263
92 189 834
75 298 433
204 276 783
5 239 52
3 240 996
57 262 866
81 264 50
97 120 161
43 247 270
40 235 813
202 211 40
89 219 969
193 284 442
174 284 865
...

output:

571

result:

ok answer is '571'

Test #27:

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

input:

300 43393 259
10 33 464
150 276 306
67 146 269
63 121 168
145 256 855
119 144 281
126 295 83
95 100 89
23 68 853
12 179 61
236 247 177
60 84 335
165 233 247
103 216 768
91 208 598
80 275 458
85 123 197
174 240 170
110 162 703
44 259 526
174 264 503
111 228 214
201 286 732
98 295 892
89 154 458
69 79...

output:

41

result:

ok answer is '41'

Test #28:

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

input:

300 32631 189
56 151 813
160 200 594
89 268 193
75 239 670
108 208 531
60 124 55
56 275 736
16 121 266
93 266 388
60 136 474
8 25 832
107 187 27
60 130 803
180 260 601
48 149 218
100 215 874
16 143 925
83 167 264
46 141 241
113 139 970
149 280 359
64 194 146
20 23 630
211 235 327
108 227 446
76 277 ...

output:

259

result:

ok answer is '259'

Test #29:

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

input:

300 27256 143
159 214 293
116 222 263
96 174 561
39 107 296
92 280 613
201 210 918
140 273 76
130 217 733
117 159 337
161 215 865
13 16 653
28 189 259
11 62 692
70 91 610
23 148 94
3 161 818
114 134 864
30 235 637
30 102 205
24 200 698
167 202 873
194 203 773
260 299 426
71 291 477
104 183 1
184 293...

output:

505

result:

ok answer is '505'

Test #30:

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

input:

300 44078 122
103 277 508
50 233 845
42 159 325
120 147 280
209 215 134
9 189 965
229 259 275
218 288 633
73 119 351
116 272 472
76 82 888
206 269 569
37 49 799
132 157 324
129 237 914
227 289 992
92 262 174
155 293 887
106 131 936
60 171 436
48 88 675
196 254 595
145 251 230
104 119 117
104 105 598...

output:

438

result:

ok answer is '438'

Test #31:

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

input:

300 33108 152
157 275 474
46 111 257
56 287 318
66 182 332
16 150 757
63 85 57
55 79 714
126 217 211
30 280 847
53 57 303
163 169 285
129 293 527
249 285 567
192 249 966
233 274 296
17 34 255
5 200 314
11 235 270
170 203 697
62 190 36
117 285 414
39 239 593
93 235 560
178 240 49
13 97 654
214 264 33...

output:

457

result:

ok answer is '457'

Test #32:

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

input:

3 0 1
2 1 2

output:

-1

result:

ok answer is '-1'

Test #33:

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

input:

1 0 1
1 1

output:

0

result:

ok answer is '0'