QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#882898 | #3159. Sugar Glider | fryan | 50 | 345ms | 46020kb | C++20 | 1.1kb | 2025-02-05 13:02:11 | 2025-02-05 13:02:12 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()
#define int long long
const int mxn = 1e5+5;
const int inf = 1e18;
int n,m,x,h[mxn];
vector<array<int,2>> adj[mxn];
map<array<int,2>,int> dist;
priority_queue<array<int,3>,vector<array<int,3>>,greater<array<int,3>>> dij;
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cin>>n>>m>>x;
for (int i=0; i<n; i++)
cin>>h[i];
for (int i=0; i<m; i++) {
int a,b,t; cin>>a>>b>>t; --a; --b;
adj[a].push_back({b,t});
adj[b].push_back({a,t});
}
dij.push({0,0,x});
int ds = inf;
int stata = 0;
while (sz(dij)) {
auto [d,v,a] = dij.top(); dij.pop();
if (dist.count({v,a}) && dist[{v,a}] <= d)
continue;
if (v==n-1) {
ds = min(ds,h[n-1]-a+d);
}
stata++;
assert(stata<2e6);
dist[{v,a}] = d;
for (auto [u,w] : adj[v]) {
if (w > h[v]) continue;
int ad =0, ta = a;
if (a < w) ad += w-a, ta=w;
if (a-w > h[u]) ad += a-w-h[u], ta=h[u]+w;
dij.push({d+ad+w,u,ta-w});
}
}
if (ds==inf) ds=-1;
cout<<ds;
}
詳細信息
Subtask #1:
score: 25
Accepted
Test #1:
score: 25
Accepted
time: 1ms
memory: 5864kb
input:
1000 1002 55 100 11 3 46 40 11 11 35 21 40 5 19 24 16 30 35 12 44 22 5 14 3 21 48 47 12 27 16 48 18 22 10 17 1 37 48 8 36 38 19 27 21 6 6 23 24 20 10 25 4 16 33 3 19 3 25 41 34 18 17 17 1 11 13 42 41 10 33 43 13 23 24 21 19 31 19 48 8 32 15 15 22 29 2 7 6 43 29 21 11 13 6 43 40 37 11 17 29 49 44 40 ...
output:
-1
result:
ok single line: '-1'
Test #2:
score: 25
Accepted
time: 2ms
memory: 3840kb
input:
1000 2699 22 22 11 52 60 49 45 31 20 9 57 5 58 39 52 29 19 48 53 3 30 62 42 60 2 68 54 55 13 64 67 29 23 66 56 17 3 26 9 36 50 36 35 55 10 2 29 54 15 36 53 30 16 38 30 62 12 40 35 40 55 14 60 5 39 56 41 32 6 15 42 48 61 3 24 31 51 20 51 20 37 10 20 7 15 17 68 47 20 37 57 47 16 2 16 58 31 18 20 25 19...
output:
168
result:
ok single line: '168'
Test #3:
score: 25
Accepted
time: 3ms
memory: 5996kb
input:
1000 3000 100 100 24 35 18 3 17 12 8 20 37 12 4 4 11 37 27 23 4 14 22 12 42 4 22 4 12 27 44 30 24 44 30 5 17 42 19 3 21 37 41 49 18 10 23 48 34 47 10 6 33 17 4 35 22 21 27 47 47 37 36 11 34 7 40 34 20 10 4 3 4 12 39 19 50 32 4 50 28 18 42 38 43 27 4 46 13 21 2 40 5 21 24 31 12 8 16 45 2 49 5 7 14 22...
output:
149
result:
ok single line: '149'
Test #4:
score: 25
Accepted
time: 0ms
memory: 3712kb
input:
876 1139 3 6 40 4 43 14 1 1 4 36 45 38 20 50 39 7 12 43 27 40 6 44 13 48 44 44 47 19 33 29 44 47 32 18 6 12 26 3 49 50 4 18 16 50 3 13 4 18 4 19 16 42 32 1 32 45 8 21 7 37 39 11 43 30 13 50 41 7 3 24 16 23 15 40 7 41 14 46 32 35 50 38 45 15 18 42 50 27 41 42 25 43 48 36 21 29 3 21 39 18 47 1 10 48 4...
output:
461
result:
ok single line: '461'
Test #5:
score: 25
Accepted
time: 0ms
memory: 5992kb
input:
609 1507 66 85 15 19 37 27 16 51 34 46 13 2 36 2 37 35 23 58 51 34 21 56 18 19 43 26 17 61 48 1 18 14 22 48 53 27 22 50 48 10 44 53 8 51 13 6 38 52 22 4 42 23 32 42 42 50 44 54 19 58 16 55 41 40 29 40 5 29 29 16 40 26 18 8 37 48 43 42 51 19 2 15 59 17 47 4 8 39 31 61 6 21 42 59 16 59 16 15 60 60 58 ...
output:
228
result:
ok single line: '228'
Test #6:
score: 25
Accepted
time: 0ms
memory: 3840kb
input:
547 39 50 50 38 28 36 43 42 2 7 40 22 5 27 1 12 26 16 2 38 3 9 33 4 9 14 3 16 35 49 40 38 28 47 21 1 13 25 45 13 35 4 26 22 25 47 4 23 21 49 26 39 38 41 26 8 28 16 47 25 1 2 33 17 3 29 48 9 47 42 32 35 10 2 34 45 9 48 6 32 26 27 31 34 45 22 25 50 38 2 42 26 30 12 38 29 44 8 42 16 48 26 27 49 36 22 1...
output:
130
result:
ok single line: '130'
Test #7:
score: 25
Accepted
time: 1ms
memory: 3712kb
input:
1000 439 44 100 25 10 3 18 7 49 38 6 4 45 20 12 4 8 50 3 47 41 40 36 23 30 1 23 36 6 15 30 19 6 15 8 4 33 1 46 32 9 8 16 2 1 14 35 13 30 13 5 25 2 30 15 22 42 13 34 12 12 33 26 46 8 33 5 5 6 5 49 28 16 41 42 18 27 33 34 34 35 22 15 3 41 31 34 26 31 24 5 32 49 37 46 10 17 41 26 39 23 33 18 23 14 37 2...
output:
1299
result:
ok single line: '1299'
Test #8:
score: 25
Accepted
time: 2ms
memory: 5996kb
input:
1000 3000 57 65 27 19 30 47 32 9 27 23 10 10 21 44 43 19 19 22 11 30 21 35 10 18 24 50 4 43 10 25 28 28 13 48 17 2 35 34 31 12 18 23 29 23 44 44 3 21 36 12 10 13 34 40 23 27 48 36 28 19 4 10 19 11 10 43 24 23 41 12 24 38 49 28 40 46 25 42 3 50 43 34 31 25 32 46 46 48 3 22 38 24 49 21 50 15 15 36 9 1...
output:
125
result:
ok single line: '125'
Test #9:
score: 25
Accepted
time: 4ms
memory: 4012kb
input:
491 3000 37 78 48 29 12 9 6 49 36 14 3 36 35 32 43 35 25 26 43 10 3 44 4 27 5 2 25 41 36 17 14 21 34 39 17 38 44 20 23 3 41 28 7 3 16 10 31 16 41 5 9 48 41 1 11 27 38 47 39 41 2 7 29 4 22 28 15 5 8 39 6 29 12 44 48 50 2 29 15 9 31 24 20 11 43 35 14 30 33 34 48 19 45 47 10 33 33 7 13 4 30 41 32 3 49 ...
output:
76
result:
ok single line: '76'
Test #10:
score: 25
Accepted
time: 7ms
memory: 3996kb
input:
614 3000 70 70 21 3 27 9 29 24 23 2 35 18 6 48 3 41 24 37 49 44 20 43 40 26 3 10 14 7 17 6 42 16 15 40 28 47 5 27 33 7 3 21 26 47 7 12 15 13 14 14 20 49 40 45 50 48 46 22 33 37 28 2 37 39 21 17 50 32 37 36 22 6 22 22 16 43 31 27 6 13 35 39 1 42 36 43 39 40 49 8 2 33 22 39 47 15 36 33 50 30 25 2 4 44...
output:
77
result:
ok single line: '77'
Test #11:
score: 25
Accepted
time: 0ms
memory: 3712kb
input:
482 20 9 45 15 48 19 23 16 27 15 41 1 30 33 1 19 20 33 5 35 15 8 31 30 23 4 3 37 7 46 1 39 3 29 36 32 8 30 13 4 35 48 6 16 26 41 49 13 40 25 47 39 49 28 14 24 3 26 13 32 17 5 34 23 2 42 26 27 50 39 9 49 21 38 5 16 9 8 26 46 2 19 13 30 10 46 29 37 40 22 34 35 4 10 33 1 21 42 36 31 5 42 5 22 23 37 23 ...
output:
-1
result:
ok single line: '-1'
Test #12:
score: 25
Accepted
time: 2ms
memory: 4096kb
input:
1000 3000 46 100 30 16 47 18 16 27 33 14 13 41 34 49 38 29 29 38 31 17 24 40 18 17 13 33 43 43 33 19 28 21 32 25 7 19 46 2 1 3 50 40 9 11 38 35 39 26 49 37 50 4 48 28 12 9 5 26 27 25 23 15 4 46 41 4 30 49 40 10 7 14 46 8 27 1 23 47 30 8 50 31 7 36 10 31 2 33 18 11 36 30 45 42 20 5 2 29 10 19 5 36 37...
output:
149
result:
ok single line: '149'
Test #13:
score: 25
Accepted
time: 1ms
memory: 5988kb
input:
1000 3000 84 100 41 24 20 43 3 27 50 26 50 14 17 2 39 7 42 41 19 48 5 34 19 42 35 22 50 1 37 8 5 31 50 26 41 9 43 14 10 40 37 17 42 40 5 5 21 50 28 45 42 45 40 49 46 41 25 29 11 21 5 31 8 1 12 50 33 44 15 36 21 28 26 38 24 25 1 36 7 48 27 27 10 3 47 11 20 23 32 36 42 38 50 33 3 39 19 30 3 32 36 29 4...
output:
138
result:
ok single line: '138'
Test #14:
score: 25
Accepted
time: 1ms
memory: 5736kb
input:
170 920 27 79 45 15 14 32 42 41 6 34 38 36 43 38 6 14 27 34 28 31 7 38 14 38 22 17 24 14 19 11 37 3 49 44 45 7 2 14 45 21 13 7 35 44 35 37 15 27 50 50 25 4 35 28 33 30 38 34 25 10 50 42 43 21 46 30 17 36 31 50 21 7 1 6 35 18 37 24 24 5 6 31 32 32 22 6 15 8 20 7 11 4 4 27 43 26 2 29 50 37 22 47 37 39...
output:
86
result:
ok single line: '86'
Test #15:
score: 25
Accepted
time: 2ms
memory: 4224kb
input:
437 2650 88 100 23 10 15 34 44 47 1 30 19 47 20 22 12 32 4 30 18 43 23 18 46 48 28 3 50 40 23 7 1 6 41 8 25 47 19 45 23 19 37 40 46 45 49 9 45 43 36 35 48 40 35 15 17 45 35 13 13 43 17 38 4 8 32 35 9 16 31 49 38 29 10 14 23 49 19 4 41 48 20 15 34 1 46 33 32 21 10 38 3 42 23 5 39 18 41 16 33 40 17 1 ...
output:
130
result:
ok single line: '130'
Test #16:
score: 25
Accepted
time: 0ms
memory: 3840kb
input:
1000 961 65 100 43 25 29 1 26 45 40 43 5 13 4 14 13 10 5 30 5 32 6 22 6 12 9 23 18 18 33 11 41 37 34 47 7 1 2 3 48 20 21 17 37 3 45 42 23 34 17 5 48 32 40 47 47 14 33 28 44 31 19 7 45 24 40 10 15 9 40 41 48 19 5 11 23 3 32 50 25 7 23 20 45 19 21 26 40 21 25 19 29 42 40 10 11 15 38 19 44 29 9 32 25 3...
output:
-1
result:
ok single line: '-1'
Test #17:
score: 25
Accepted
time: 0ms
memory: 3712kb
input:
1000 289 71 100 49 26 42 32 3 48 20 34 6 19 2 42 15 47 16 27 44 11 10 46 28 28 41 51 7 39 38 50 6 19 33 28 39 30 50 34 28 34 49 48 14 14 35 34 2 12 38 35 30 43 16 30 22 30 24 3 12 3 49 1 39 49 28 46 22 11 12 30 15 5 15 8 5 10 21 16 22 38 2 31 37 41 49 51 24 50 31 29 23 19 7 41 12 22 26 1 40 52 17 11...
output:
8659
result:
ok single line: '8659'
Test #18:
score: 25
Accepted
time: 1ms
memory: 5864kb
input:
1000 705 5 5 39 43 36 45 37 29 31 21 37 17 1 45 45 41 11 22 38 36 30 31 49 29 30 3 3 2 4 11 8 11 27 27 15 42 44 40 31 27 38 43 48 30 20 21 14 20 18 15 24 4 15 9 45 45 45 20 3 17 15 27 34 29 37 1 12 9 24 8 16 30 18 24 1 37 49 23 48 32 20 14 23 28 26 29 23 1 35 32 5 42 44 31 32 39 15 16 49 31 36 8 27 ...
output:
7672
result:
ok single line: '7672'
Test #19:
score: 25
Accepted
time: 0ms
memory: 5864kb
input:
1000 392 24 100 46 33 47 40 39 25 45 30 23 13 34 42 44 49 25 35 5 13 38 8 2 19 23 44 44 40 38 8 42 45 47 45 42 27 20 19 32 46 7 35 9 30 4 41 28 24 42 4 29 29 38 39 22 23 20 37 23 20 47 28 46 42 29 39 37 18 39 9 23 48 16 48 7 48 3 20 27 27 30 17 7 10 9 11 28 38 40 12 16 34 10 40 12 11 7 50 8 39 38 7 ...
output:
8259
result:
ok single line: '8259'
Test #20:
score: 25
Accepted
time: 1ms
memory: 3712kb
input:
1000 993 57 88 6 27 4 35 49 21 14 2 48 27 47 2 7 9 23 33 30 18 1 32 50 12 40 28 15 40 8 21 16 8 34 4 32 26 17 27 12 36 27 6 18 30 32 25 30 8 19 24 41 45 36 36 45 24 32 3 11 39 2 33 13 2 19 50 28 6 26 42 14 14 14 44 41 35 17 20 31 1 14 36 41 21 42 21 23 44 50 19 32 8 19 37 46 20 43 3 7 19 3 26 45 18 ...
output:
6046
result:
ok single line: '6046'
Subtask #2:
score: 25
Accepted
Test #21:
score: 25
Accepted
time: 150ms
memory: 25176kb
input:
100000 300000 0 1000000000 6252036 2478953 10427170 9627366 7209791 2693718 9708485 7249936 10617908 6324658 7316124 2936320 6127220 10315955 1335528 8828453 5276518 5323734 908445 4214021 9084361 7603977 2594805 4889830 10745625 10186019 7628251 3182274 7028365 1117322 4415746 7061952 7575909 61522...
output:
91684617
result:
ok single line: '91684617'
Test #22:
score: 25
Accepted
time: 345ms
memory: 34528kb
input:
18628 300000 0 1000000000 451191979 504164906 81274270 360402988 150343635 124699825 158575812 129200008 106549527 60508419 98119895 342585670 287291320 200857843 544297702 92724275 6576299 88098732 258551216 216318047 189873309 262538576 503909318 101348740 422816599 112157613 425144018 419443172 5...
output:
358898213
result:
ok single line: '358898213'
Test #23:
score: 25
Accepted
time: 154ms
memory: 19176kb
input:
95707 122429 0 325381813 7728322 7640388 7314166 6483446 3526898 9290172 4844753 805136 6571737 8860798 6094569 6157170 1509383 8787144 5086011 5730745 1936819 8189050 3111015 1556244 3309258 5912520 8644284 7465066 3486401 2704687 5197828 2440225 1505647 6240983 8930144 5885634 7450651 9414293 3416...
output:
202573214
result:
ok single line: '202573214'
Test #24:
score: 25
Accepted
time: 303ms
memory: 34976kb
input:
51865 300000 0 1000000000 285 149 375 317 611 65 342 152 428 499 42 194 369 14 464 414 244 317 455 348 349 355 589 575 495 390 405 585 234 331 574 105 520 537 366 465 618 387 374 475 491 62 498 137 548 389 102 587 355 443 136 569 442 58 367 28 287 200 363 501 239 601 375 385 608 571 300 632 294 482 ...
output:
945
result:
ok single line: '945'
Test #25:
score: 25
Accepted
time: 308ms
memory: 46020kb
input:
14406 300000 0 144526518 371684135 378793895 173151017 70766484 649335569 581666162 290232378 650388539 523245002 120048489 707409684 3629545 581050976 641071841 526493942 114320488 395559192 498750056 638471151 235185388 374632513 149704572 652257556 649152431 231118677 140674074 458159754 40558394...
output:
698741882
result:
ok single line: '698741882'
Test #26:
score: 25
Accepted
time: 3ms
memory: 6248kb
input:
191 18145 0 1000000000 77 790 2412 687 2410 2436 737 433 1522 1871 2602 381 691 2745 2030 1155 2970 816 487 990 2649 1065 903 2279 1461 2883 587 1021 877 610 2976 1012 2669 1197 190 954 1742 2290 2572 1821 2724 1858 1348 195 1175 101 1579 2093 2311 2178 1839 2300 329 2915 2295 288 2166 333 318 2403 ...
output:
12647929
result:
ok single line: '12647929'
Test #27:
score: 25
Accepted
time: 89ms
memory: 22144kb
input:
100000 300000 0 1000000000 14 21 27 27 20 6 17 27 22 9 28 31 14 10 7 24 9 31 11 28 29 7 4 15 7 21 15 14 24 26 26 4 27 7 18 1 19 6 20 23 17 7 3 23 19 24 6 8 30 2 20 29 4 25 17 31 5 2 2 3 2 14 15 30 24 26 3 27 18 14 21 7 14 25 2 17 20 16 3 18 2 3 11 7 18 24 1 21 26 13 28 31 28 24 29 3 3 22 30 24 9 9 1...
output:
-1
result:
ok single line: '-1'
Test #28:
score: 25
Accepted
time: 316ms
memory: 29296kb
input:
90733 232740 0 993699461 3118368 233164 3580558 3671189 2438093 794109 1366356 4036210 3420838 720615 1914088 2152173 3427237 2748056 1481805 2650261 1775133 3529041 1774607 1586636 840051 3061706 559748 2579769 2523998 904248 3230787 2800836 3975958 395174 3679210 3318509 4026427 2192496 3694355 13...
output:
4474392
result:
ok single line: '4474392'
Test #29:
score: 25
Accepted
time: 114ms
memory: 22888kb
input:
60620 300000 0 276963356 27 27 94 9 67 91 60 23 26 42 53 41 72 54 15 68 40 23 59 79 18 79 28 94 77 80 38 73 30 26 59 70 66 3 39 9 57 48 13 17 49 36 31 62 59 66 64 63 34 35 53 65 17 39 88 41 28 27 4 1 69 69 91 89 9 17 62 60 9 66 57 74 16 23 41 82 60 1 4 12 55 40 38 67 19 48 63 21 33 28 83 11 23 71 66...
output:
25129297
result:
ok single line: '25129297'
Test #30:
score: 25
Accepted
time: 54ms
memory: 17512kb
input:
93864 207375 0 1000000000 987 858 122 632 507 380 1113 1008 298 1134 813 822 792 1080 1029 361 1129 955 1076 852 32 123 388 560 866 950 254 734 495 588 978 893 840 475 380 314 872 222 935 622 805 499 62 315 335 696 459 132 358 226 484 819 1018 807 1005 43 300 315 301 1045 129 403 849 1118 598 884 28...
output:
-1
result:
ok single line: '-1'
Test #31:
score: 25
Accepted
time: 21ms
memory: 8380kb
input:
19132 23048 0 665441593 211 228 238 147 88 37 26 93 109 116 206 40 206 280 10 109 157 172 130 120 93 279 187 70 271 152 277 229 306 244 78 149 228 236 189 137 155 51 263 71 195 151 169 206 49 12 267 287 133 293 208 203 34 78 224 131 74 54 99 227 200 50 50 253 132 63 280 124 139 16 14 86 96 123 230 2...
output:
314
result:
ok single line: '314'
Test #32:
score: 25
Accepted
time: 153ms
memory: 23128kb
input:
19001 195093 0 1000000000 94177561 13522119 80987792 12816641 39138650 8411657 81448467 85607497 7594878 17521156 49665721 54162845 30183341 23373830 91897390 30120605 50018211 13425521 88889617 2818327 37586992 64759728 13817036 86623820 89191937 70666594 31580363 80378075 22219072 95800041 3006880...
output:
79284195
result:
ok single line: '79284195'
Test #33:
score: 25
Accepted
time: 85ms
memory: 28572kb
input:
987 149992 0 1000000000 1642 119 581 670 1188 1148 2833 2966 833 1333 1244 2443 2637 1304 1000 576 953 1494 2043 2614 1246 1907 1253 2444 675 2902 1358 1898 1384 713 2943 1269 768 264 2626 141 2740 1323 1334 1742 1043 311 210 2797 2029 14 1347 284 2842 2944 965 1046 412 956 1109 2619 2671 1407 1177 ...
output:
847
result:
ok single line: '847'
Test #34:
score: 25
Accepted
time: 90ms
memory: 22784kb
input:
100000 300000 0 1000000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
15939
result:
ok single line: '15939'
Test #35:
score: 25
Accepted
time: 4ms
memory: 4608kb
input:
9508 5631 0 1000000000 44626816 148865683 285096922 131919453 281182151 365923872 72756135 243864585 11908557 319576222 58513662 196192209 345640307 319073910 36847741 72709821 216607942 178633522 140858136 196135967 313555539 368052080 338737547 149023863 232141537 353569491 163495439 41991343 3225...
output:
1020473859092
result:
ok single line: '1020473859092'
Test #36:
score: 25
Accepted
time: 234ms
memory: 34816kb
input:
17591 300000 0 1000000000 203 110 201 32 130 104 66 187 59 38 113 31 134 185 164 200 129 92 97 77 1 1 59 197 78 26 41 156 117 181 161 61 3 8 210 176 18 199 122 113 77 41 151 7 61 82 119 206 204 178 8 85 115 135 204 201 10 173 210 182 106 191 131 127 96 3 141 32 53 131 200 20 134 173 129 56 32 191 67...
output:
163
result:
ok single line: '163'
Test #37:
score: 25
Accepted
time: 14ms
memory: 6784kb
input:
23231 20634 0 1000000000 8752695 9236212 2000645 12785095 8077746 10840198 13324722 16246965 10571386 3818772 8566011 4972548 12617020 534685 2853037 4612414 12673504 16092372 3943611 17192981 15705217 16385843 1497509 14211238 6195606 17140140 9419316 7782206 12640131 4809427 12233103 3182183 36053...
output:
50738101046
result:
ok single line: '50738101046'
Test #38:
score: 25
Accepted
time: 17ms
memory: 7168kb
input:
39465 20214 0 416222450 15313932 16818312 16706667 48998945 50476281 2959637 36383213 22784060 34598367 5668342 48265953 38544679 19906956 16054291 8538040 3081523 13610784 2762939 29165272 21364407 7371702 51585119 9916251 43733475 50509914 6891315 18622334 12382105 39684007 54123004 16898525 51706...
output:
100503158979
result:
ok single line: '100503158979'
Test #39:
score: 25
Accepted
time: 30ms
memory: 11008kb
input:
42990 118356 0 136679485 46 26 71 30 172 120 61 107 141 148 61 136 149 54 42 102 64 4 49 24 108 141 69 161 142 172 84 91 158 164 112 132 38 118 61 66 113 118 89 14 99 7 43 161 113 123 13 74 9 141 156 102 62 68 3 28 91 1 145 147 105 1 96 155 84 122 119 131 64 28 171 165 60 61 63 61 12 23 42 95 117 14...
output:
-1
result:
ok single line: '-1'
Test #40:
score: 25
Accepted
time: 25ms
memory: 9956kb
input:
37813 30008 0 1000000000 36 13 49 46 28 57 28 19 58 42 20 29 56 29 42 25 16 21 37 19 39 47 14 7 49 38 17 36 63 60 18 24 55 13 54 48 53 19 38 3 10 62 47 43 34 6 63 33 14 56 32 51 53 31 31 51 41 16 13 52 48 23 49 38 56 17 28 28 31 15 9 49 52 38 19 36 53 42 25 27 20 50 34 35 35 21 9 55 41 33 8 32 55 11...
output:
137724817
result:
ok single line: '137724817'
Subtask #3:
score: 0
Memory Limit Exceeded
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #41:
score: 50
Accepted
time: 70ms
memory: 19200kb
input:
26876 300000 623545298 623545298 165 155 20 152 29 7 188 122 143 94 149 72 49 211 29 80 181 205 72 172 4 3 22 166 18 126 170 146 98 169 30 156 206 149 32 154 151 1 99 133 168 85 166 33 5 140 94 154 36 90 201 53 6 42 97 25 194 101 6 161 23 112 134 75 173 101 68 147 69 87 25 41 70 22 203 216 181 3 11 ...
output:
-1
result:
ok single line: '-1'
Test #42:
score: 50
Accepted
time: 18ms
memory: 9088kb
input:
85981 29342 450724941 509796210 214416 284796 194998 404377 375425 117481 39475 336942 286974 198046 133034 145351 232294 214611 388718 67530 342407 241072 394612 238450 348303 13551 15010 222250 416065 108542 41342 417363 186520 327592 65005 215628 76482 257149 139820 135732 149284 199002 371497 10...
output:
576815306
result:
ok single line: '576815306'
Test #43:
score: 50
Accepted
time: 70ms
memory: 18816kb
input:
49801 269094 79392039 79392039 1 3 2 3 2 1 3 2 2 2 3 2 2 1 1 1 2 3 2 2 3 1 1 2 2 1 2 1 1 3 2 3 1 1 3 2 3 3 1 3 2 1 3 2 1 2 3 1 2 2 3 2 2 2 3 3 2 2 3 2 3 3 2 3 3 3 1 3 2 1 2 3 3 2 2 1 3 1 3 2 3 3 3 1 1 3 1 1 2 2 3 3 1 2 1 3 3 2 3 2 1 2 2 3 3 1 1 2 2 3 3 2 1 3 2 1 1 1 2 1 1 3 2 1 3 1 3 2 2 2 3 1 1 2 3...
output:
79393486
result:
ok single line: '79393486'
Test #44:
score: 0
Memory Limit Exceeded
input:
52746 98032 185494777 1000000000 11315531 5621210 11557362 437998 1740259 9842111 1352838 2874074 4159006 4253331 4917156 7358966 5141089 5649170 15243125 8126540 8609321 244426 9719734 2912082 5344990 9082947 16157871 13132386 4509560 2824424 9852268 9842816 10235713 6703345 15475385 6509528 139445...