QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#250616 | #6391. Airplane | Licykoc | 100 ✓ | 169ms | 20216kb | C++20 | 1.4kb | 2023-11-13 14:14:54 | 2023-11-13 14:14:54 |
Judging History
answer
#include <bits/stdc++.h>
constexpr int INF = std::numeric_limits<int>::max() / 2;
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::istream &fin = std::cin;
std::ostream &fout = std::cout;
int n, m;
fin >> n >> m;
std::vector<int> a(n);
for (int i = 0; i < n; ++i) {
fin >> a[i];
}
std::vector<std::vector<int>> adj(n);
for (int i = 0; i < m; ++i) {
int u, v;
fin >> u >> v;
--u;
--v;
adj[u].emplace_back(v);
adj[v].emplace_back(u);
}
auto dijkstra = [&](int s) {
std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>>, std::greater<>> que;
std::vector<int> dis(n, INF);
que.emplace(dis[s] = 0, s);
while (!que.empty()) {
auto [d, u] = que.top();
que.pop();
if (d > dis[u]) {
continue;
}
for (auto v : adj[u]) {
if (std::max(d + 1, a[v]) < dis[v]) {
dis[v] = std::max(d + 1, a[v]);
que.emplace(dis[v], v);
}
}
}
return dis;
};
auto f = dijkstra(0), g = dijkstra(n - 1);
int res = INF;
for (int i = 0; i < n; ++i) {
if (f[i] == g[i]) {
res = std::min(res, f[i] * 2);
} else {
for (int j : adj[i]) {
if (f[i] == g[j]) {
res = std::min(res, f[i] * 2 + 1);
break;
}
}
}
}
fout << res << '\n';
}
詳細信息
Subtask #1:
score: 22
Accepted
Test #1:
score: 22
Accepted
time: 40ms
memory: 16364kb
input:
200000 199999 0 199 58 60 83 5 10 182 87 65 104 153 197 137 80 143 34 181 62 48 10 57 86 58 117 10 171 188 95 52 95 140 126 0 196 85 87 14 10 139 177 92 31 18 102 146 68 9 91 124 156 38 41 121 183 10 32 174 171 29 49 26 118 1 69 185 57 168 54 159 195 95 9 32 195 70 85 174 158 82 33 197 66 189 198 11...
output:
200378
result:
ok single line: '200378'
Test #2:
score: 0
Accepted
time: 34ms
memory: 16496kb
input:
200000 199999 0 7069 4413 15143 13876 8264 277 9620 7202 15692 14258 2614 13807 19768 18946 6508 4536 16015 11178 18780 13194 3126 15666 16341 13700 1400 17159 3289 11433 12997 4482 5897 10872 14089 17849 6479 3144 15034 9891 8465 13826 16423 12149 10812 5239 7420 17792 11494 11072 14771 3344 1911 1...
output:
239619
result:
ok single line: '239619'
Test #3:
score: 0
Accepted
time: 38ms
memory: 16424kb
input:
200000 199999 0 105078 122546 3300 193124 162196 69895 44289 178129 76428 110386 190856 77392 65308 189161 64387 71902 24922 105657 120731 46153 5597 21052 162261 196023 77743 170963 54028 139193 127878 140113 14217 151317 128769 23380 173618 110336 93825 77571 122871 173360 169754 1966 42143 54356 ...
output:
598642
result:
ok single line: '598642'
Test #4:
score: 0
Accepted
time: 30ms
memory: 16504kb
input:
200000 199999 0 55732397 60901872 31713584 64282037 77463086 78130904 29236225 77464050 12326209 35695263 99111327 44848052 73919813 99361339 64031085 21963112 46146914 19581700 98473686 21087087 54242856 62653021 31055752 36441739 13724968 81971647 69716899 10572812 27326027 48563556 20931826 95015...
output:
200183729
result:
ok single line: '200183729'
Test #5:
score: 0
Accepted
time: 40ms
memory: 16420kb
input:
200000 199999 0 14153985 80225532 13272347 34066896 98185012 58062091 42430466 1823846 68143435 98863385 71308404 30332450 96686087 79020069 30750664 7480097 90526895 28301108 29865758 30753745 29430412 20492643 57777905 13997322 80476824 96242732 85284473 91285058 40216138 34285402 69762369 1812243...
output:
200174572
result:
ok single line: '200174572'
Test #6:
score: 0
Accepted
time: 40ms
memory: 16372kb
input:
200000 199999 0 78942231 91484664 79018559 78574515 18404287 11722912 92098054 96690803 62113825 96826208 44496692 77166407 34844511 75375756 99899481 96108473 66849554 85354565 91982705 13456318 96084293 91552364 57499245 65232087 40896788 46634074 45492461 54045567 59320404 65370441 74893985 52947...
output:
200183449
result:
ok single line: '200183449'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
2 1 0 0 1 2
output:
1
result:
ok single line: '1'
Subtask #2:
score: 10
Accepted
Test #8:
score: 10
Accepted
time: 0ms
memory: 3620kb
input:
6 10 0 0 6 1 8 0 5 6 2 3 5 4 6 4 3 5 6 2 3 6 3 4 3 1 6 1
output:
1
result:
ok single line: '1'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
4 5 0 1 2 0 2 4 1 2 3 2 4 1 4 3
output:
1
result:
ok single line: '1'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
20 40 0 2 1 5 3 4 1 5 3 2 5 5 5 3 3 4 4 3 4 0 4 3 15 18 11 18 10 13 1 3 9 14 16 14 16 1 5 3 13 15 20 7 20 16 9 11 16 11 1 2 6 2 19 10 7 13 15 10 7 15 8 11 5 9 8 12 6 7 7 14 2 18 17 16 8 3 1 10 5 2 4 2 11 13 17 3 11 5 4 8 13 6 17 1 10 7 5 6 13 9
output:
4
result:
ok single line: '4'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
2000 2000 0 1990 1247 1110 1102 1411 1445 1492 1349 1302 1404 1541 1660 1333 1461 1710 1655 1489 1310 1660 1141 1069 1167 1020 1564 1746 1354 1607 1144 1636 1901 1099 1167 1112 1001 1210 1126 1537 1082 1814 1469 1884 1375 1703 1393 1335 1194 1444 1895 1933 1038 1357 1405 1039 1804 1958 1642 1418 169...
output:
4027
result:
ok single line: '4027'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
2000 2000 0 53 12 10 76 82 78 52 30 63 13 87 53 19 51 80 25 82 8 75 12 19 5 49 9 28 5 51 65 9 50 57 9 95 39 33 12 94 26 83 76 82 15 99 39 27 95 13 48 23 58 86 96 100 19 84 93 13 69 61 20 25 23 74 19 12 5 108 16 67 50 16 51 106 79 107 42 39 105 79 17 22 30 28 84 25 80 36 87 22 82 107 31 77 103 96 70 ...
output:
272
result:
ok single line: '272'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
2000 2001 0 1532 1936 1350 1411 1324 1289 1350 1176 1065 1668 1081 1175 1337 1755 1595 1530 1401 1553 1118 1045 1136 1120 1776 1670 1225 1267 1005 1170 1148 1363 1397 1448 1985 1510 1167 1131 1105 1993 1437 1138 1922 1106 1714 1205 1934 1565 1896 1021 1458 1339 1331 1054 1105 1650 1144 1456 1779 117...
output:
3914
result:
ok single line: '3914'
Test #14:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
2000 2010 0 2 3 2 4 4 6 6 7 3 4 5 5 6 7 6 7 5 3 4 5 2 5 6 7 3 6 8 7 7 5 6 6 4 8 10 6 7 4 3 10 6 8 6 7 6 7 11 9 8 7 8 6 7 12 11 7 8 9 13 9 9 10 13 11 12 6 8 14 9 10 7 11 11 9 14 11 13 15 8 11 12 12 15 11 12 8 15 16 11 12 12 9 11 9 12 13 16 14 9 14 13 16 13 13 9 17 11 18 12 17 14 18 11 15 15 17 12 15 ...
output:
35
result:
ok single line: '35'
Test #15:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
2000 2015 0 1980 1365 1349 1698 1949 1823 1611 1926 1298 1981 1818 2000 1789 1832 1371 1021 1765 1467 1273 1259 1941 1578 1597 1459 1817 1293 1362 1997 1465 1351 1145 1982 1838 1099 1899 1950 1771 1819 1999 1173 1013 1033 1459 1001 1994 1653 1224 1751 1534 1775 1221 1956 1291 1176 1864 1948 1322 105...
output:
3882
result:
ok single line: '3882'
Test #16:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
2000 2020 0 1 2 6 5 6 4 4 5 2 1 5 2 7 4 4 8 6 6 2 6 6 5 7 6 9 6 5 9 7 9 4 6 5 11 8 6 5 8 11 6 11 10 13 9 7 11 14 11 15 5 13 14 11 8 5 11 7 7 16 5 9 11 14 13 9 17 12 11 8 9 10 7 8 11 8 11 7 8 11 12 14 11 14 15 17 8 10 8 12 9 10 11 9 19 10 18 9 11 11 11 11 11 9 20 11 11 9 14 22 11 11 19 12 12 12 10 13...
output:
25
result:
ok single line: '25'
Test #17:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
2000 2050 0 1162 1770 1285 1260 1570 1982 1444 2000 1412 1924 1692 1196 1269 1324 1251 1673 1535 1739 1237 1009 1150 1679 1266 1183 1017 1737 1774 1046 1702 1724 1137 1297 1644 1684 1925 1222 1622 1025 1155 1002 1833 1520 1985 1869 1466 1752 1227 1956 1680 1820 1194 1519 1712 1595 1935 1344 1547 170...
output:
3816
result:
ok single line: '3816'
Test #18:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
2000 2200 0 1 9 2 9 6 8 8 3 6 7 3 7 10 4 7 4 11 11 15 6 6 9 12 3 11 13 12 7 4 11 10 12 6 7 9 12 15 16 6 9 15 10 9 8 11 11 6 8 15 6 13 15 5 10 15 6 10 7 6 10 8 12 11 12 8 12 9 8 13 14 7 11 12 16 10 7 9 15 15 9 12 7 14 17 13 13 19 17 10 10 11 11 18 14 19 10 12 8 16 11 19 10 19 18 15 15 20 9 15 14 16 1...
output:
24
result:
ok single line: '24'
Test #19:
score: 0
Accepted
time: 1ms
memory: 3688kb
input:
2000 3000 0 1249 1256 1118 1126 1622 1152 1586 1628 1879 1332 1571 1224 1789 1181 1131 1167 1202 1528 1769 1733 1448 1845 1389 1059 2000 1112 1846 1664 1315 1629 1870 1098 1957 1613 1680 1658 1809 1061 1490 1198 1929 1325 1007 1139 1318 1047 1964 1320 1191 1416 1742 1489 1925 1029 1228 1558 1315 152...
output:
2808
result:
ok single line: '2808'
Test #20:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
2000 4000 0 1980 1517 1527 1676 2000 1760 1795 1799 1525 1957 1920 1623 1959 1819 1895 1997 1746 1806 1605 1599 1588 1607 1792 1675 1916 1515 1941 1848 1717 1900 1540 1655 1504 1729 1693 1604 1887 1949 1638 1646 1968 1643 1916 1512 1966 1532 1966 1564 1724 1507 1540 1713 1816 1908 1676 1777 1559 165...
output:
3348
result:
ok single line: '3348'
Test #21:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
2000 4000 0 11 7 14 11 5 7 2 2 4 7 4 12 17 16 14 4 12 13 4 7 6 11 7 5 7 17 18 6 8 19 13 16 5 12 12 15 18 12 16 6 7 8 19 11 11 6 18 9 9 15 10 7 14 19 17 11 5 4 14 9 16 15 17 9 10 9 8 11 18 17 5 13 20 15 19 4 6 6 10 13 7 20 15 16 9 6 19 19 20 16 16 9 16 8 16 9 11 12 8 20 11 6 21 8 16 15 19 12 8 9 14 6...
output:
19
result:
ok single line: '19'
Test #22:
score: 0
Accepted
time: 1ms
memory: 4012kb
input:
2000 4000 0 65 44 21 21 34 74 39 78 23 58 40 60 71 38 3 97 86 102 35 77 48 19 9 87 41 27 83 32 91 72 51 60 50 82 82 73 101 30 81 80 52 13 56 42 29 30 87 43 101 99 58 12 62 26 38 30 28 36 86 28 73 105 51 39 92 26 21 68 9 16 77 81 98 32 81 19 72 99 9 30 36 40 59 93 12 19 68 43 42 90 104 57 78 16 56 57...
output:
100
result:
ok single line: '100'
Subtask #3:
score: 31
Accepted
Dependency #2:
100%
Accepted
Test #23:
score: 31
Accepted
time: 1ms
memory: 3696kb
input:
2000 2037 0 54690170 93351623 83472845 35611192 16997239 91266586 67753803 96779399 19868930 44883547 8667270 14743835 88895341 7795730 67505347 42672061 93860108 88628584 91944328 76624408 62327480 92377003 57852449 71536702 46048591 95278030 85805340 51440161 42807089 2455270 97621197 60345371 483...
output:
183216836
result:
ok single line: '183216836'
Test #24:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
2000 2001 0 57386683 68101872 10679154 99166649 75822867 72624809 84725887 54745585 30304623 26101645 39838629 53949077 89257315 99290834 46424096 86653075 74952057 37038017 63040613 34122545 3889069 39395641 14152090 69085573 115183 18466346 2070297 84420603 71659429 34545691 6681073 35269076 18845...
output:
191769664
result:
ok single line: '191769664'
Test #25:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
2000 2050 0 43944110 31886520 78117170 6645264 97089907 63728464 88413086 60325813 12243910 93805209 79729640 35121945 3148072 95181559 38571361 59799490 66103004 80224308 59819614 57213914 14545767 91929082 26822329 27516336 28692247 66131545 1603662 63617589 71526520 75349063 60129151 873344 40285...
output:
178243438
result:
ok single line: '178243438'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3968kb
input:
2000 2200 0 90186751 74597173 23646309 38695000 21016684 39557840 73091797 34375138 23412673 3785831 68145508 18921883 35728376 50750260 15214067 55506870 30725243 74737413 41773337 96592955 5565101 83929787 61549473 19028102 98200673 78067917 56366858 15919046 99040865 47021250 2533894 14723199 311...
output:
144202396
result:
ok single line: '144202396'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3948kb
input:
2000 2050 0 91846360 97142990 99751562 96726822 92651561 92286861 94395240 91505576 99210095 93331021 98361610 90099048 91208442 99553428 93640599 99787690 99320126 90992771 91200259 93209732 99760702 94447199 98239974 94468368 98264058 98546646 94111988 93903092 94836712 98645307 95471750 91662733 ...
output:
199988354
result:
ok single line: '199988354'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
2000 2100 0 99992983 99994334 99999026 99992345 99991028 99993337 99999398 99992222 99992899 99995164 99991163 99999453 99999125 99995794 99996298 99995294 99996669 99992723 99997663 99999140 99998590 99993581 99993069 99990376 99995516 99992883 99992930 99996596 99997231 99999727 99994962 99994086 ...
output:
199996834
result:
ok single line: '199996834'
Test #29:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
2000 2500 0 15318707 5946877 13780913 25442158 85506706 45194216 94967776 26960967 58933658 66588775 48504923 65910506 41033403 3399480 25885428 25607879 57444552 30149019 89452450 37696272 27903483 21690839 88389887 28102205 83622255 568499 36476872 47144074 99277733 66725629 40667745 19429492 3009...
output:
164957208
result:
ok single line: '164957208'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
2000 3000 0 99992659 99994852 99992308 99990553 99999512 99995116 99990954 99991141 99992599 99994995 99994116 99997274 99993005 99995954 99991694 99991328 99999120 99991769 99992528 99991409 99995334 99996994 99996943 99996964 99990190 99996983 99999127 99992305 99995300 99994625 99996751 99992048 ...
output:
199991456
result:
ok single line: '199991456'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
2000 3500 0 40912435 59081538 98845821 61705289 71144125 12705645 71984288 35341810 67199911 13674305 61508120 73452540 85316149 91295571 89383344 18157461 81967197 38853386 8620073 73164287 77152586 37024545 20986295 80573454 44673754 90346793 96969348 32929197 56051233 9111556 6276908 56785241 141...
output:
77030060
result:
ok single line: '77030060'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
2000 4000 0 99999992 99999743 99995154 99991999 99998151 99990521 99993943 99995886 99999441 99999707 99996000 99990967 99996896 99999440 99994145 99996546 99991886 99997916 99990547 99996834 99992087 99991884 99997125 99999544 99993131 99995550 99997934 99997340 99994344 99998501 99992779 99990987 ...
output:
199994952
result:
ok single line: '199994952'
Test #33:
score: 0
Accepted
time: 1ms
memory: 3776kb
input:
2000 4000 0 96847 46063287 66203087 44366837 92711285 68090865 233964 49614214 54490020 2087458 31347393 66463713 80075862 73612503 57603282 55378093 17801146 2295406 67664536 74148514 36789811 74188700 43834623 64138512 48022998 11361000 50932456 6924887 92146928 87335213 72889512 69291629 5532798 ...
output:
85157608
result:
ok single line: '85157608'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
2000 4000 0 99999875 99999795 99999634 99999300 99999366 99999012 99999661 99999336 99999391 99999580 99999170 99999917 99999747 99999840 99999942 99999089 99999248 99999332 99999742 99999477 99999677 99999447 99999473 99999124 99999358 99999081 99999727 99999583 99999428 99999234 99999786 99999627 ...
output:
199999160
result:
ok single line: '199999160'
Subtask #4:
score: 37
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #35:
score: 37
Accepted
time: 97ms
memory: 16356kb
input:
200000 200000 0 44314114 30212878 106452 19074658 9066152 60849255 37428877 58969870 86097224 50507514 85971497 33553346 7860175 82459405 42718922 50388402 47286857 19883360 7760372 18483072 56903427 44250962 85834895 79648024 14268239 52845763 93958650 93400615 96605218 89937297 66420929 73630652 7...
output:
199993446
result:
ok single line: '199993446'
Test #36:
score: 0
Accepted
time: 67ms
memory: 16428kb
input:
200000 199999 0 1 1 2 2 2 3 2 3 3 4 5 2 3 2 3 4 4 5 3 3 3 4 2 4 3 5 3 3 4 6 6 6 5 5 5 4 4 5 7 5 5 6 6 7 6 7 5 5 7 7 5 8 6 8 7 7 8 7 7 8 8 9 9 8 8 9 9 7 9 8 9 10 11 9 9 9 10 9 10 8 11 9 8 11 12 10 11 9 10 10 10 10 10 12 11 9 10 10 11 12 10 12 10 11 13 12 12 10 13 13 15 11 15 10 12 16 11 15 12 16 16 1...
output:
18922
result:
ok single line: '18922'
Test #37:
score: 0
Accepted
time: 67ms
memory: 16416kb
input:
200000 200000 0 1 2 4 3 3 4 2 5 2 4 4 3 2 4 4 4 2 4 6 3 6 4 3 5 5 4 5 6 5 5 5 5 7 5 6 4 6 3 9 6 6 8 5 7 6 7 8 7 8 7 8 7 9 8 7 8 9 7 8 7 8 9 10 9 7 8 9 8 9 10 10 9 10 9 8 9 9 10 10 11 12 12 9 10 10 10 12 10 10 11 12 10 11 11 11 12 13 13 12 13 10 10 12 13 12 12 13 11 11 15 12 12 15 13 13 12 14 16 12 1...
output:
11487
result:
ok single line: '11487'
Test #38:
score: 0
Accepted
time: 73ms
memory: 16432kb
input:
200000 200000 0 4 1 3 4 4 2 5 3 6 5 4 1 5 6 5 5 6 5 7 4 6 6 4 5 6 4 2 3 7 6 5 8 4 6 7 7 4 5 9 6 7 8 5 8 8 9 7 11 8 8 8 10 9 10 9 9 10 10 10 10 8 10 8 13 11 13 11 9 9 9 12 11 11 12 11 10 13 12 13 12 14 13 12 11 11 11 14 12 15 13 12 15 13 13 13 12 12 14 14 16 14 14 16 13 14 17 15 16 16 15 16 14 16 14 ...
output:
8891
result:
ok single line: '8891'
Test #39:
score: 0
Accepted
time: 75ms
memory: 16520kb
input:
200000 200000 0 7 6 8 3 9 3 3 7 4 5 9 5 4 5 8 6 9 8 4 9 11 7 9 6 11 11 5 10 5 8 9 11 10 11 4 9 11 10 9 8 6 9 6 10 9 7 8 5 8 12 9 11 8 6 11 13 12 9 10 8 12 12 8 9 15 7 7 13 11 11 12 12 9 10 12 7 12 9 14 8 11 9 11 12 12 14 10 17 10 13 11 15 14 8 13 16 10 12 16 15 10 15 13 14 13 9 12 11 13 16 16 11 12 ...
output:
14907
result:
ok single line: '14907'
Test #40:
score: 0
Accepted
time: 74ms
memory: 16420kb
input:
200000 200000 0 9 7 7 10 6 4 14 6 3 10 13 2 11 10 6 6 3 6 15 2 8 13 6 5 14 13 5 10 5 12 16 12 10 13 7 9 12 5 8 14 10 12 8 15 8 17 9 11 11 7 13 11 15 11 8 19 15 13 14 15 17 17 6 12 10 10 16 22 9 11 15 13 21 10 16 20 14 19 12 13 15 14 14 23 14 18 19 10 18 21 22 12 20 11 14 21 18 17 18 15 20 11 14 20 2...
output:
9658
result:
ok single line: '9658'
Test #41:
score: 0
Accepted
time: 77ms
memory: 16420kb
input:
200000 200012 0 1 2 2 3 3 2 2 2 2 3 2 4 4 3 2 4 2 3 3 4 4 4 4 5 3 3 6 5 5 5 5 5 6 5 7 6 5 5 4 5 7 5 7 7 6 7 8 9 5 6 6 7 5 8 9 7 6 7 7 9 6 8 9 8 8 10 9 10 6 8 8 10 6 11 8 7 11 12 7 10 8 12 10 10 13 8 12 8 14 12 9 13 13 14 12 9 15 12 11 14 11 11 12 12 9 14 14 8 11 12 11 15 10 15 14 15 12 12 12 9 14 14...
output:
681
result:
ok single line: '681'
Test #42:
score: 0
Accepted
time: 76ms
memory: 16296kb
input:
200000 200012 0 2 4 2 3 5 4 3 5 4 6 2 4 6 4 4 4 5 5 2 4 4 5 6 5 4 6 7 6 6 5 4 5 7 4 3 4 8 5 8 6 8 8 6 7 8 6 6 7 8 7 5 5 4 10 6 8 9 10 9 10 6 9 5 11 8 9 10 11 7 10 8 9 10 11 12 9 10 9 9 12 10 10 11 9 12 11 10 12 11 12 12 12 13 12 11 10 13 12 13 12 10 12 14 13 14 14 11 13 11 12 11 11 14 15 13 14 14 16...
output:
2995
result:
ok single line: '2995'
Test #43:
score: 0
Accepted
time: 82ms
memory: 16356kb
input:
200000 200014 0 3 1 4 2 12 7 2 11 12 10 3 10 3 5 10 11 7 7 14 5 10 10 7 11 12 14 9 13 14 9 12 14 11 12 12 9 14 13 12 4 10 15 10 11 7 10 10 14 15 10 13 5 15 11 8 9 8 8 9 10 11 7 9 9 11 6 7 16 11 18 6 8 6 13 9 10 13 13 19 9 12 14 10 12 10 11 19 14 9 16 13 13 16 11 17 19 17 17 20 20 8 18 19 18 13 15 17...
output:
1401
result:
ok single line: '1401'
Test #44:
score: 0
Accepted
time: 75ms
memory: 16580kb
input:
200000 200015 0 8 15 40 47 3 89 53 71 91 95 57 34 47 8 72 8 38 74 96 56 84 24 13 5 22 4 77 14 12 89 56 51 18 83 19 62 31 16 94 80 85 12 77 32 43 47 42 89 53 87 89 19 50 56 34 36 17 51 12 103 36 92 25 11 47 71 72 21 98 50 27 66 105 20 79 45 99 81 83 25 34 83 72 16 8 29 45 94 81 22 21 43 49 97 113 61 ...
output:
3829
result:
ok single line: '3829'
Test #45:
score: 0
Accepted
time: 96ms
memory: 16564kb
input:
200000 200100 0 99997903 99993855 99993965 99996088 99992957 99999813 99996001 99994178 99999009 99996134 99991253 99997332 99995249 99999374 99997757 99992170 99991748 99993022 99997957 99994653 99990877 99994124 99994525 99992010 99996045 99992822 99999513 99996501 99990908 99990795 99993047 99997...
output:
200000169
result:
ok single line: '200000169'
Test #46:
score: 0
Accepted
time: 95ms
memory: 16500kb
input:
200000 200003 0 9000015 9000019 9000015 9000012 9000018 9000012 9000010 9000010 9000011 9000020 9000014 9000018 9000019 9000014 9000016 9000015 9000015 9000018 9000016 9000012 9000014 9000012 9000012 9000016 9000019 9000018 9000019 9000018 9000013 9000016 9000015 9000019 9000020 9000011 9000016 9000...
output:
18002313
result:
ok single line: '18002313'
Test #47:
score: 0
Accepted
time: 90ms
memory: 16564kb
input:
200000 199999 0 9000020 9000020 9000011 9000013 9000019 9000016 9000015 9000014 9000013 9000018 9000012 9000015 9000018 9000017 9000019 9000018 9000019 9000015 9000016 9000016 9000011 9000013 9000020 9000011 9000016 9000017 9000013 9000020 9000019 9000020 9000014 9000017 9000017 9000011 9000016 9000...
output:
18009229
result:
ok single line: '18009229'
Test #48:
score: 0
Accepted
time: 135ms
memory: 18100kb
input:
200000 300000 0 99767802 99024032 99334006 99453493 99202216 99207102 99620415 99597857 99440162 99540908 99727830 99349755 99118378 99549222 99507896 99975101 99634494 99218905 99174613 99979781 99541476 99204107 99225865 99323273 99648314 99080503 99526757 99226967 99281187 99506733 99968012 99039...
output:
199981986
result:
ok single line: '199981986'
Test #49:
score: 0
Accepted
time: 128ms
memory: 18152kb
input:
200000 300000 0 2 2 3 2 5 1 2 2 2 2 4 4 5 1 3 2 3 3 3 4 5 4 3 3 5 3 5 3 3 3 5 5 4 5 5 6 5 5 6 5 5 5 4 4 6 5 6 6 5 8 5 5 5 7 6 6 6 7 5 6 6 6 7 7 8 6 7 7 7 7 7 7 7 6 7 9 7 7 9 9 10 7 7 8 9 8 10 9 9 10 10 11 9 12 10 12 10 8 10 9 11 11 9 11 9 10 9 10 12 11 9 12 11 9 12 12 9 12 10 10 13 10 12 10 12 11 9 ...
output:
14
result:
ok single line: '14'
Test #50:
score: 0
Accepted
time: 126ms
memory: 18232kb
input:
200000 300000 0 6 3 5 3 6 5 4 7 4 6 5 7 6 3 6 3 10 5 4 7 4 10 5 7 5 12 6 10 9 11 9 9 9 9 10 12 8 10 6 11 11 9 8 7 8 7 8 10 9 8 8 12 12 11 12 9 9 8 11 12 9 10 14 9 9 13 9 10 11 10 13 12 9 8 10 10 11 12 10 13 11 11 13 15 13 13 11 13 17 13 16 14 8 12 11 10 12 14 16 14 17 13 14 11 11 9 16 15 16 12 16 14...
output:
18
result:
ok single line: '18'
Test #51:
score: 0
Accepted
time: 133ms
memory: 18116kb
input:
200000 300000 0 172 827 419 215 364 634 676 191 216 65 699 896 206 241 71 947 94 14 175 796 652 686 241 575 885 510 612 373 576 120 339 806 204 985 91 24 750 258 878 476 42 219 859 48 312 67 703 607 89 670 180 417 928 466 546 463 503 290 719 535 302 336 497 951 256 587 53 508 920 847 543 227 18 807 ...
output:
1254
result:
ok single line: '1254'
Test #52:
score: 0
Accepted
time: 169ms
memory: 20080kb
input:
200000 400000 0 1 18 3 27 21 10 10 2 2 27 18 13 10 1 1 8 28 7 24 11 0 4 10 25 6 28 14 14 15 19 19 28 6 16 11 1 9 22 19 10 11 10 5 29 23 25 6 3 15 19 1 4 1 11 14 23 4 3 10 10 22 6 2 13 19 4 2 1 26 6 13 8 27 1 1 20 12 25 9 22 11 10 26 4 16 1 10 17 26 6 18 27 22 20 22 15 14 26 10 3 0 6 26 26 19 20 0 6 ...
output:
30
result:
ok single line: '30'
Test #53:
score: 0
Accepted
time: 169ms
memory: 20132kb
input:
200000 400000 0 377 458 437 389 473 490 450 352 347 331 255 309 411 402 496 489 356 352 358 469 373 387 435 494 371 273 453 308 276 336 364 272 467 412 462 460 354 328 363 279 346 479 404 415 394 478 313 294 300 455 474 356 284 267 325 255 269 345 466 314 442 348 325 411 495 472 368 408 348 366 487 ...
output:
786
result:
ok single line: '786'
Test #54:
score: 0
Accepted
time: 146ms
memory: 20064kb
input:
200000 400000 0 86130794 33253485 75089800 19272538 19886666 65924174 56590764 1698290 112291 64008169 78642864 12723351 78451533 36316504 36463634 18931456 99697879 60215404 11985077 7051381 86772554 96805170 6130943 66388459 82927390 41844767 25419543 23892228 11901627 35720645 2439262 93481803 40...
output:
59184662
result:
ok single line: '59184662'
Test #55:
score: 0
Accepted
time: 149ms
memory: 20156kb
input:
200000 400000 0 18478848 18323098 50879735 36939057 66474711 53624901 3804932 15308085 81552777 88863188 93702367 16633450 69545882 9401272 37109346 1943484 66064659 47758744 65833752 29522704 39153415 36225131 83158202 77766102 14840546 57001666 26788171 61272780 25700486 83033763 68245884 93578005...
output:
64167810
result:
ok single line: '64167810'
Test #56:
score: 0
Accepted
time: 150ms
memory: 20148kb
input:
200000 400000 0 9000012 9000012 9000019 9000014 9000015 9000018 9000012 9000019 9000013 9000014 9000018 9000011 9000016 9000013 9000015 9000012 9000019 9000012 9000010 9000014 9000018 9000019 9000011 9000014 9000013 9000011 9000010 9000017 9000014 9000019 9000018 9000013 9000020 9000019 9000011 9000...
output:
18000036
result:
ok single line: '18000036'
Test #57:
score: 0
Accepted
time: 159ms
memory: 20068kb
input:
200000 400000 0 152249 140246 73568 38636 132656 183889 154107 71085 141455 138221 67924 39070 181080 194939 57284 19953 37803 134251 185636 153735 197227 4060 128319 15281 86494 125668 196890 28314 102896 45139 120813 185203 89230 104184 166752 33378 14732 120004 191371 179894 34015 183953 107926 7...
output:
208322
result:
ok single line: '208322'
Test #58:
score: 0
Accepted
time: 147ms
memory: 20148kb
input:
200000 400000 0 1 2 3 1 2 2 3 3 4 2 3 4 4 4 4 3 4 4 4 5 3 2 4 4 5 4 4 5 5 5 4 4 4 5 4 4 5 4 5 5 5 4 5 5 5 4 5 5 5 6 5 4 6 6 6 6 6 8 7 5 5 6 7 6 6 6 6 7 6 6 8 7 9 8 8 8 8 7 7 7 9 8 7 9 7 8 9 8 9 9 9 8 9 7 8 8 9 9 9 8 10 8 9 9 6 9 8 9 10 10 8 9 9 9 5 9 8 8 9 9 10 9 9 8 10 10 9 8 9 10 10 9 9 8 9 8 8 9 ...
output:
10
result:
ok single line: '10'
Test #59:
score: 0
Accepted
time: 152ms
memory: 20064kb
input:
200000 400000 0 3 4 3 4 3 5 5 1 2 3 5 6 3 3 5 6 3 5 5 5 6 3 6 7 4 5 5 6 7 5 4 9 7 7 7 5 8 7 6 9 8 5 7 7 8 5 7 7 6 8 8 8 11 10 9 10 8 11 10 8 7 9 10 11 8 8 9 10 8 9 9 11 10 11 7 9 8 8 10 11 10 9 11 10 9 8 8 9 9 10 11 12 10 9 9 11 10 12 8 9 11 10 9 10 11 10 11 11 9 10 10 11 11 11 12 10 10 10 11 10 9 1...
output:
15
result:
ok single line: '15'
Test #60:
score: 0
Accepted
time: 152ms
memory: 20136kb
input:
200000 400000 0 3 4 1 6 4 10 3 6 14 5 13 4 10 12 12 9 8 8 11 5 5 9 3 9 6 12 15 15 13 5 12 10 11 11 9 14 7 11 6 11 16 7 13 7 9 9 16 8 17 16 17 17 9 16 14 15 18 14 16 15 12 13 11 17 11 10 16 15 16 9 9 13 12 16 16 13 9 19 9 14 11 17 18 11 11 19 20 10 9 17 17 12 8 16 18 11 19 14 18 9 17 12 15 14 7 16 9 ...
output:
22
result:
ok single line: '22'
Test #61:
score: 0
Accepted
time: 150ms
memory: 20060kb
input:
200000 400000 0 19 16 8 14 22 14 13 3 8 17 10 8 22 12 12 20 11 17 10 18 22 16 10 22 21 15 17 12 6 5 27 9 8 13 6 9 11 24 13 11 9 14 23 6 10 21 23 9 20 25 7 19 23 20 16 10 9 23 19 9 5 26 22 19 29 15 21 23 25 14 12 14 16 22 27 14 8 12 22 29 22 26 8 21 15 10 27 22 21 20 14 9 12 23 10 14 10 22 24 17 11 1...
output:
46
result:
ok single line: '46'
Test #62:
score: 0
Accepted
time: 150ms
memory: 20216kb
input:
200000 400000 0 64 77 85 58 52 35 95 46 89 26 83 84 65 72 17 50 33 39 92 91 74 30 100 41 3 63 71 82 63 54 23 63 56 59 38 36 7 67 79 103 23 83 63 106 29 45 44 82 36 29 78 80 63 17 71 63 107 29 94 71 106 92 22 61 65 13 104 7 62 32 29 74 33 37 47 44 91 11 59 53 22 43 40 9 21 100 69 27 38 63 33 66 101 7...
output:
116
result:
ok single line: '116'
Test #63:
score: 0
Accepted
time: 169ms
memory: 20160kb
input:
200000 400000 0 37 169 405 635 914 385 221 703 45 252 661 76 105 102 97 794 954 754 903 656 190 215 179 122 759 453 770 130 950 209 248 801 120 158 950 358 561 973 823 558 12 190 324 195 173 365 764 901 666 559 736 329 540 284 374 464 494 95 864 473 1002 757 156 414 611 501 476 751 984 413 879 930 2...
output:
1258
result:
ok single line: '1258'
Extra Test:
score: 0
Extra Test Passed