QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#250500 | #7771. 不是这一道据数构结题 | hos_lyric# | 35 | 1462ms | 165652kb | C++14 | 5.7kb | 2023-11-13 11:16:47 | 2024-07-04 02:24:53 |
Judging History
answer
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
template <class T> void bAdd(vector<T> &bit, int pos, const T &val) {
const int bitN = bit.size();
for (int x = pos; x < bitN; x |= x + 1) bit[x] += val;
}
template <class T> T bSum(const vector<T> &bit, int pos) {
T ret = 0;
for (int x = pos; x > 0; x &= x - 1) ret += bit[x - 1];
return ret;
}
template <class T> T bSum(const vector<T> &bit, int pos0, int pos1) {
return bSum(bit, pos1) - bSum(bit, pos0);
}
// min pos s.t. pred(sum of [0, pos))
// assume pred(sum of [0, pos)) is non-decreasing
template <class T, class Pred>
int bBinarySearch(const vector<T> &bit, Pred pred) {
if (pred(T(0))) return 0;
const int bitLen = bit.size();
int pos = 0;
T sum = 0;
for (int e = 31 - __builtin_clz(bitLen); e >= 0; --e) {
const int x = (pos | 1 << e) - 1;
if (x < bitLen && !pred(sum + bit[x])) {
pos |= 1 << e;
sum += bit[x];
}
}
return pos + 1;
}
int N, Q;
vector<int> A;
vector<int> L, R;
namespace brute {
vector<int> run() {
cerr<<"[brute::run]"<<endl;
vector<int> ans(Q, 0);
for (int q = 0; q < Q; ++q) {
vector<int> bs(A.begin() + L[q], A.begin() + R[q]);
sort(bs.begin(), bs.end(), greater<int>{});
int mn = N;
for (int i = 0; i < R[q] - L[q]; ++i) {
chmin(mn, A[L[q] + i]);
if (mn < bs[i]) {
++ans[q];
}
}
}
return ans;
}
} // brute
namespace fast {
vector<int> run() {
cerr<<"[fast::run]"<<endl;
vector<int> ans(Q, 0);
vector<vector<int>> qss(N);
for (int q = 0; q < Q; ++q) {
qss[L[q]].push_back(q);
}
/*
es[l] = (r, t)
t-th (1-based) index >= r s.t. A[*] > A[l]
*/
vector<pair<int, int>> es(N);
vector<int> ks(N);
for (int phase = 0; phase < 2; ++phase) {
// stack for prefix min
int top = 0;
vector<int> is(N + 1);
vector<vector<int>> jss(N + 1);
vector<int> fulls(N + 1);
is[0] = N;
fulls[0] = 0;
vector<int> bitCost(N + 1, 0);
for (int l = N; --l >= 0; ) {
for (; A[l] < A[is[top]]; --top) {}
if (A[l] > A[is[top]]) {
++top;
is[top] = l;
jss[top] = {l};
} else {
is[top] = l;
jss[top].push_back(l);
}
// cerr<<"l = "<<l<<": is = "<<vector<int>(is.begin(),is.begin()+(top+1))<<", jss = "<<vector<vector<int>>(jss.begin(),jss.begin()+(top+1))<<endl;
if (phase == 0) {
es[l] = make_pair(is[top - 1], (int)jss[top].size());
} else {
bAdd(bitCost, ks[l], +1);
fulls[top] = ((is[top - 1] - is[top]) - (int)jss[top].size()) + fulls[top - 1];
for (const int q : qss[l]) {
const int pos = partition_point(is.begin(), is.begin() + (top + 1), [&](int i) -> bool {
return (i >= R[q]);
}) - is.begin();
assert(top >= pos); assert(pos >= 0);
assert(is[pos] < R[q]); assert(R[q] <= is[pos - 1]);
ans[q] += (fulls[top] - fulls[pos]);
ans[q] += bSum(bitCost, R[q]);
const int num = partition_point(jss[pos].begin(), jss[pos].end(), [&](int j) -> bool {
return (j >= R[q]);
}) - jss[pos].begin();
ans[q] += (R[q] - is[pos]) - ((int)jss[pos].size() - num);
}
}
}
if (phase == 0) {
vector<vector<int>> lss(N);
for (int l = 0; l < N; ++l) {
lss[A[l]].push_back(l);
}
vector<int> bitLarger(N, 0);
for (int a = N; --a >= 0; ) {
for (const int l : lss[a]) {
const int r = es[l].first;
const int t = es[l].second;
const int sumR = bSum(bitLarger, r);
ks[l] = min(bBinarySearch(bitLarger, [&](int s) -> bool {
return (s >= sumR + t);
}) - 1, N);
bAdd(bitLarger, l, +1);
}
}
// cerr<<"es = "<<es<<", ks = "<<ks<<endl;
}
}
return ans;
}
} // fast
int main() {
for (; ~scanf("%d%d", &N, &Q); ) {
A.resize(N + 1);
for (int i = 0; i < N; ++i) {
scanf("%d", &A[i]);
--A[i];
}
A[N] = -1;
L.resize(Q);
R.resize(Q);
for (int q = 0; q < Q; ++q) {
scanf("%d%d", &L[q], &R[q]);
--L[q];
}
const auto ans = fast::run();
for (int q = 0; q < Q; ++q) {
printf("%d\n", ans[q]);
}
#ifdef LOCAL
const auto brt=brute::run();
for(int q=0;q<Q;++q)if(brt[q]!=ans[q]){
cerr<<A<<" "<<L[q]<<" "<<R[q]<<": "<<vector<int>(A.begin()+L[q],A.begin()+R[q])<<" "<<brt[q]<<" "<<ans[q]<<endl;
break;
}
// assert(brt!=ans);
#endif
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3796kb
input:
100 100 57 39 73 88 98 3 54 10 63 31 96 22 94 53 99 66 7 90 29 27 91 37 74 4 64 43 86 100 12 58 78 97 75 87 36 51 40 20 48 92 26 72 89 85 46 13 55 80 6 47 41 17 30 25 60 35 93 28 69 16 83 23 1 34 56 45 18 21 38 11 68 71 8 2 84 76 15 33 44 81 77 82 70 24 67 95 61 9 32 49 50 65 19 59 5 42 14 62 52 79 ...
output:
117 169 25 8 15 1 100 35 0 17 85 12 4 18 6 61 15 161 2 98 63 0 80 120 77 34 3 50 72 41 90 94 55 28 60 64 64 10 98 66 25 2 16 3 70 160 79 8 1 55 26 143 24 104 32 106 79 13 124 69 23 146 81 98 14 47 148 8 4 119 66 31 4 58 50 67 69 2 10 29 19 27 63 106 118 85 56 13 9 26 36 117 90 0 70 81 1 40 7 0
result:
wrong answer 1st numbers differ - expected: '65', found: '117'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3864kb
input:
100 100 2 3 1 3 3 8 1 1 1 3 2 3 2 75 1 44 78 3 3 65 2 1 3 3 90 2 1 1 1 2 2 2 1 2 9 3 24 1 2 1 89 2 2 42 2 66 1 1 19 25 3 2 3 2 3 51 1 1 3 1 3 29 21 2 2 2 1 2 1 3 3 2 84 2 1 11 2 2 3 2 9 1 1 1 1 99 48 1 77 3 9 78 69 1 2 1 1 2 1 2 21 68 41 76 9 76 7 43 30 81 45 84 81 83 23 45 57 91 17 65 72 81 39 91 3...
output:
58 48 97 48 72 51 0 25 44 61 10 73 61 10 90 48 85 49 59 100 14 3 63 19 99 39 90 111 16 110 95 48 5 48 44 4 49 94 24 23 105 50 39 94 92 6 6 91 12 47 11 16 45 42 49 23 48 97 45 29 7 80 74 2 77 61 106 94 51 35 80 21 32 47 26 5 16 1 2 64 2 23 123 78 33 11 19 23 114 13 19 46 88 75 52 84 88 42 12 103
result:
wrong answer 1st numbers differ - expected: '35', found: '58'
Test #3:
score: 0
Wrong Answer
time: 3ms
memory: 4588kb
input:
3000 3000 82 1139 2770 344 363 880 427 2001 207 2969 1309 2063 2349 1817 1869 2724 2380 1887 1377 1422 1732 449 2105 1706 1155 2417 963 308 1996 2788 737 1963 1973 1163 2899 2438 760 1995 1435 1750 1947 2863 1606 1078 493 2922 1478 607 1871 2191 2978 2587 1699 332 1581 2048 68 350 2220 1306 1633 187...
output:
2905 1791 2183 491 5120 15 2332 642 3400 4431 1238 79 2682 2883 1259 5471 2022 1640 1253 1192 1961 2190 2238 2353 287 4492 1933 1958 1258 2189 1355 4612 3762 310 2292 2208 3337 1551 1444 4061 937 642 1947 1754 4151 5 2500 1943 1212 2074 2734 2990 3617 2297 2316 1184 1296 578 36 326 5184 3296 3936 33...
result:
wrong answer 1st numbers differ - expected: '1464', found: '2905'
Test #4:
score: 0
Wrong Answer
time: 3ms
memory: 4288kb
input:
3000 3000 2120 271 658 684 1092 795 2522 2924 2204 382 709 1351 2977 1639 1190 2472 458 1337 1034 566 2644 664 1224 1410 1820 625 2203 2045 1979 2297 2926 1238 2014 1492 1372 2594 1324 1854 1968 1074 919 2345 1544 1880 626 2505 1742 1427 2892 99 447 1732 2273 2490 1166 2419 2717 1248 2493 1048 2291 ...
output:
2141 1749 3645 97 650 191 4820 1141 2388 3157 945 2219 5461 3073 2472 104 2781 2073 1638 519 899 1713 487 2579 3623 547 434 2074 4868 2333 4902 828 1578 140 720 1679 1732 1996 820 1957 1430 878 673 5036 740 2304 5362 499 42 406 3380 1588 78 2143 657 2 3 221 3279 3726 1361 1462 126 796 4834 1545 913 ...
result:
wrong answer 1st numbers differ - expected: '1079', found: '2141'
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 4584kb
input:
3000 3000 2637 1681 2145 1131 33 618 2714 914 2587 2182 1823 1044 1320 2020 568 2 411 902 523 2075 910 459 124 669 1546 2593 1314 312 2736 1408 1578 28 291 1017 421 798 2202 978 597 2246 1349 1486 2756 2464 1912 636 1130 201 648 882 2737 2066 2007 1758 91 2923 49 1288 2254 776 2814 1315 1665 2306 25...
output:
1398 939 1999 3662 375 2949 2542 4584 162 3463 4457 591 501 1692 2853 4954 3376 1721 3257 652 2124 1445 728 46 1708 3002 2937 455 726 2946 170 1537 338 325 1894 3048 1604 2419 260 2918 1128 1085 872 201 46 4192 2900 2499 2516 516 14 438 1155 2859 3578 3776 335 1897 2816 2580 1131 996 3202 1950 860 3...
result:
wrong answer 1st numbers differ - expected: '708', found: '1398'
Test #6:
score: 0
Wrong Answer
time: 3ms
memory: 4224kb
input:
3000 3000 15 64 32 83 23 22 48 7 68 36 43 75 29 17 37 97 92 42 50 87 73 43 12 48 83 44 1 13 23 96 48 60 99 26 2 104 73 73 64 61 64 49 67 94 89 9 96 102 66 19 95 2 29 78 102 61 77 84 34 92 36 31 44 25 68 47 137 131 75 37 21 173 62 44 36 53 19 165 98 100 95 57 85 32 87 69 118 85 24 35 36 98 47 44 92 2...
output:
927 1425 835 882 2326 3588 1154 1530 1241 1325 2141 1745 5625 1022 2346 577 4027 750 3828 2926 1007 4236 927 2585 799 2341 695 975 801 1831 2494 36 63 3364 570 3447 1662 1108 5041 423 1704 1959 1397 1416 6 4535 514 108 322 1311 1758 49 2080 4382 1296 2413 853 3656 1115 4363 1773 2828 226 3788 3373 1...
result:
wrong answer 1st numbers differ - expected: '467', found: '927'
Test #7:
score: 0
Wrong Answer
time: 3ms
memory: 4536kb
input:
3000 3000 96 48 34 1 27 93 76 3 38 26 79 74 25 95 34 37 5 26 54 37 62 22 17 3 53 34 10 132 64 91 53 34 74 92 64 3 103 38 74 40 31 38 63 12 84 84 80 5 88 22 51 66 28 158 16 31 26 53 47 22 66 89 7 65 91 49 62 73 26 54 13 33 28 45 48 90 91 46 37 34 53 69 70 52 62 71 56 190 154 72 25 6 17 196 66 39 80 5...
output:
2961 1565 703 236 584 2006 1542 668 1297 737 3719 1041 596 2948 4590 408 2187 2114 2722 1777 2456 3642 3354 118 1250 356 1818 3418 1471 1437 589 680 3254 86 118 202 3353 2514 3904 1799 2675 699 346 302 224 3693 3549 2443 259 719 1521 2980 3252 656 428 104 2237 3263 1687 2650 916 519 1833 494 1820 44...
result:
wrong answer 1st numbers differ - expected: '1486', found: '2961'
Test #8:
score: 0
Wrong Answer
time: 3ms
memory: 4296kb
input:
3000 3000 24 75 55 19 9 74 4 22 81 77 75 46 60 50 19 50 1 41 8 63 4 47 93 24 105 16 28 76 18 96 1 68 46 80 41 83 78 36 88 45 83 54 67 46 94 99 44 61 14 50 143 97 95 78 8 92 36 59 95 26 67 23 26 95 77 92 98 13 63 149 129 61 74 39 38 55 15 90 48 3 37 39 100 77 18 10 19 10 20 77 71 46 65 84 46 7 175 81...
output:
3149 199 55 2836 2266 2264 10 319 366 3741 962 2281 2822 3031 1 2880 574 1236 1469 1307 4635 1051 1003 94 670 30 1936 542 2075 20 90 2185 1248 666 1056 4189 1249 460 199 156 1438 1440 2440 978 3256 2815 3551 1167 398 298 210 4017 1346 4761 2932 3934 1435 1088 3018 518 118 1640 1486 5177 1644 2502 66...
result:
wrong answer 1st numbers differ - expected: '1585', found: '3149'
Test #9:
score: 0
Wrong Answer
time: 8ms
memory: 4908kb
input:
10000 10000 1225 3839 1022 812 2195 8154 9848 3399 6401 5375 4192 5933 7758 9460 5569 6817 1504 104 7537 509 3830 3790 686 416 5452 4214 2651 2825 5881 4373 2118 8244 8803 5866 1737 5206 3037 4862 5976 2871 9541 6867 2024 8451 7815 1083 5523 8874 1745 828 8022 5706 3404 651 4212 8126 2555 6660 5481 ...
output:
4607 7174 6168 17049 375 1901 1581 6094 4050 4027 3055 4367 5643 1523 11095 8836 2584 4110 497 6928 13482 4431 6867 154 17957 7294 12000 12461 1171 13142 6907 11951 1552 5328 9207 7615 12984 10795 11241 6752 16944 6780 8188 1499 6736 5093 3257 882 6199 4616 12213 2442 12403 229 632 3775 4141 1507 32...
result:
wrong answer 1st numbers differ - expected: '2317', found: '4607'
Test #10:
score: 0
Wrong Answer
time: 8ms
memory: 4848kb
input:
10000 10000 4293 5943 4058 5440 7413 5250 1171 9947 4399 9939 5300 6419 5446 2275 8834 6841 1566 3814 2298 5294 8131 603 2736 4135 946 7071 3233 6196 6458 5162 8229 3087 227 828 7544 3423 7594 4496 8790 4052 8704 3088 7330 7269 5010 9400 9399 3819 302 4258 2985 3323 6455 5755 7489 321 501 3299 2026 ...
output:
4522 5283 869 14252 6837 165 9662 2958 3743 16849 13690 17115 9255 1566 7360 485 7785 2635 457 10741 11688 15972 1717 1858 6634 18576 7001 10531 5283 9077 484 6431 353 14311 15374 5600 4270 665 13937 4766 8726 10744 6449 7163 10943 9607 2714 2096 4223 5708 2886 2950 2827 5189 2135 11893 4771 7896 67...
result:
wrong answer 1st numbers differ - expected: '2271', found: '4522'
Test #11:
score: 0
Wrong Answer
time: 5ms
memory: 4848kb
input:
10000 10000 7 178 96 109 117 3 170 302 209 84 248 310 97 70 222 255 276 127 233 219 109 282 8 182 20 128 75 158 39 214 102 260 13 80 276 221 271 319 129 110 72 89 254 45 34 322 310 299 305 32 93 224 5 261 126 140 311 81 100 72 328 312 42 16 231 146 72 238 178 178 179 226 314 152 167 202 295 258 15 2...
output:
7060 6965 12750 533 1936 4221 1598 7915 5598 11 491 2841 18112 5654 11560 9423 10258 8359 3623 4050 790 10884 12262 5614 9507 6228 37 4001 179 1646 8316 8890 613 7715 17987 15631 4200 3524 15963 1292 6544 2699 17134 3464 9475 11922 260 10472 6822 1712 12518 1681 3679 16044 3469 3388 2887 7820 8652 1...
result:
wrong answer 1st numbers differ - expected: '3540', found: '7060'
Test #12:
score: 0
Wrong Answer
time: 4ms
memory: 4840kb
input:
10000 10000 3 31 195 326 322 174 300 177 87 56 74 14 39 240 134 249 176 187 87 118 177 304 269 44 128 328 112 121 96 93 140 163 209 271 29 296 232 309 228 183 238 100 66 118 204 90 156 45 204 126 232 68 318 327 5 3 153 331 180 62 308 172 175 142 88 318 236 75 276 251 67 218 28 118 141 257 65 151 183...
output:
2177 3159 7006 2045 12403 16631 5710 11458 2182 4674 1271 4953 926 2234 7625 12165 1232 5931 7498 772 7358 7483 9389 12808 9038 16254 12222 818 2978 2500 2318 10168 781 8830 3186 12670 8903 7940 9225 10641 7663 2178 358 8676 18298 3785 18330 405 1012 4805 4555 18601 4922 6391 3781 4500 11171 2485 30...
result:
wrong answer 1st numbers differ - expected: '1097', found: '2177'
Test #13:
score: 0
Wrong Answer
time: 208ms
memory: 35796kb
input:
200000 200000 120536 165588 195015 67563 60504 93355 188680 98879 30412 35909 162690 193085 79065 58869 51576 146413 166618 182838 56146 110147 142857 111033 186246 180779 63081 24777 52683 191278 98735 11504 115999 116939 157422 109468 175004 10755 112531 71163 35398 71262 141229 231 123311 168965 ...
output:
150145 185114 115222 57252 97813 113087 165916 133349 56610 332826 948 77864 236910 244107 100424 6094 158431 158370 27123 145941 91387 288377 60968 116664 325536 151123 148025 21630 8668 19414 281650 41782 105876 176760 126205 38657 237297 330700 224471 179605 114862 176740 245610 110434 204839 256...
result:
wrong answer 1st numbers differ - expected: '75089', found: '150145'
Test #14:
score: 5
Accepted
time: 179ms
memory: 31832kb
input:
200000 200000 5203 2776 2051 83 5255 4479 6328 3395 5764 3079 4020 4235 31 62 2282 1983 4052 5141 6514 108 45 84 2874 2225 5833 2277 5069 777 3458 4312 6577 1083 18 6003 4773 1935 2908 91 843 5317 6643 103 5581 113 6234 3738 144 3953 1234 396 4543 3518 5508 1833 1674 1446 1134 6455 4343 558 658 3664...
output:
137170 84019 63273 188238 28741 118840 249982 345058 85287 193180 35088 281789 2311 348222 12213 19776 236842 170530 105759 40294 40283 18885 226815 375382 47574 164073 76317 169892 232659 45538 113153 110266 118429 68768 202277 88452 98190 69373 36869 7334 94730 27703 251977 120041 112360 14318 234...
result:
ok 3000 numbers numbers differ - expected: '68599', found: '137170'
Test #15:
score: 5
Accepted
time: 183ms
memory: 31836kb
input:
200000 200000 5102 3159 748 5427 621 5896 499 5528 1847 6008 961 3084 1541 3370 3477 6551 3122 34 60 5045 1000 2091 119 35 345 92 47 6200 2305 611 27 20 4462 37 1192 108 5020 6490 5834 2997 6615 4662 102 4466 3073 634 2393 278 6122 6451 4679 4161 2316 2074 4859 782 3340 3997 6350 6659 4747 2199 5225...
output:
40298 785 17317 4347 89982 20182 75792 134659 58692 21702 83921 48401 54815 119876 40560 150258 124750 14795 160809 97958 47897 107999 71587 16826 48008 10218 57944 179400 11860 2878 44399 49565 62159 25921 101990 535 23716 7907 13857 66715 69134 130911 4084 25238 7969 57623 145624 93857 82020 24653...
result:
ok 200000 numbers
Test #16:
score: 5
Accepted
time: 170ms
memory: 31828kb
input:
200000 200000 5620 4596 1787 1569 11 3679 57 5561 1635 5384 5280 71 127 4084 4074 4 3533 4939 5115 96 336 75 3997 951 133 6410 4574 3466 3102 534 6321 107 2300 2531 5426 73 20 12 101 607 10 4424 5847 134 6212 862 855 5070 77 91 2010 4014 4678 4050 3695 3451 2790 4235 2235 5998 6354 5149 4794 4789 40...
output:
10114 12794 38733 16169 198022 30970 25818 58763 27232 68602 7180 19911 76362 116029 80149 179188 101783 7814 7875 5180 87629 100483 59653 68163 157981 33931 27895 170218 35519 27228 51571 72323 61591 23417 94041 95350 53049 39934 164686 5891 52211 90668 125176 1897 74148 9318 139081 32568 51275 830...
result:
ok 200000 numbers
Test #17:
score: 5
Accepted
time: 1462ms
memory: 165652kb
input:
1000000 1000000 87382 651796 951220 648926 497665 375383 228684 303780 166986 89826 91242 258504 374341 653338 160191 648153 603954 860894 376629 474180 967487 270337 3022 832849 628198 269953 992793 314447 701562 440916 559722 134912 67124 636002 748016 771119 200861 655997 618755 558 882633 709234...
output:
401390 115094 693946 405930 741547 92628 200488 82755 151394 228002 301572 510455 34245 128599 315022 504014 716098 46104 145061 544861 118917 145564 413047 596758 100851 50894 883811 180199 311843 417215 651492 188593 70440 122245 276161 104247 150070 733186 335338 609200 51884 907243 408520 507205...
result:
ok 1000000 numbers
Test #18:
score: 5
Accepted
time: 1065ms
memory: 145532kb
input:
1000000 1000000 3228 19 1838 21 15231 54 27226 18805 16744 57 25133 23568 27304 24323 9187 89 14287 13412 20542 21860 23602 65 1 32705 27 20439 19966 70 7865 13967 127 30379 34 95 12820 8224 14188 32692 93 29481 28113 14591 119 7443 2802 6678 51 6838 88 74 7855 95 775 11917 104 18776 34 22985 32134 ...
output:
601769 87976 543627 148209 122254 85819 8159 181383 13905 194237 213328 139431 173150 498620 268388 595806 407083 147643 107031 14141 345529 160968 75778 611045 108846 263607 11065 517134 545506 707798 287955 26600 639831 4459 247017 426986 139157 21859 357761 297213 695761 93734 571707 513905 14232...
result:
ok 1000000 numbers
Test #19:
score: 5
Accepted
time: 1165ms
memory: 145332kb
input:
1000000 1000000 13910 7760 24228 1793 79 14626 44 10663 25005 56 4240 15833 3609 19816 13269 28175 8807 67 1480 27123 69 12868 11829 3 18390 5510 58 28157 26708 17269 10176 14025 41 7746 12814 9220 24534 115 12446 51 6256 21293 28779 6845 31048 19928 19877 13972 13317 7203 9974 13131 133 13 5348 166...
output:
149909 626054 592281 104659 180043 665728 132510 790583 318334 111443 27229 177444 318900 202114 522920 250080 266060 306170 869695 340288 43427 690066 490517 148541 558734 328413 440519 667778 674164 327415 120947 251397 476744 316595 798070 255037 307454 809194 159186 146509 692633 450103 677093 2...
result:
ok 1000000 numbers
Test #20:
score: 5
Accepted
time: 1163ms
memory: 145408kb
input:
1000000 1000000 15899 2139 32955 19636 21943 29782 28207 9095 20266 68 15471 14533 17782 21804 31540 21751 19168 15466 19302 34 24617 3544 66 31466 31516 3341 30147 6947 26716 135 11544 50 30167 5 11 7820 149 5146 32617 20175 23019 23260 8830 16538 88 2357 22200 21845 2144 12436 104 31 24930 10455 1...
output:
127368 622411 88971 350112 62062 220821 468815 369350 696630 227040 194499 770552 698557 327855 58033 172056 19269 81502 11205 448626 621733 574034 298976 855981 21123 532372 932562 240268 256808 655255 96670 280067 640370 191914 328374 350250 422642 246030 781630 152850 111851 532536 705773 191469 ...
result:
ok 1000000 numbers