QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#487194 | #8601. Герої та Монстри | green_gold_dog | 24 | 27ms | 4040kb | C++20 | 2.3kb | 2024-07-22 18:02:25 | 2024-07-22 18:02:25 |
Judging History
answer
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,sse4,abm,popcnt,mmx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef complex<double> cd;
constexpr ll INF64 = 9'000'000'000'000'000'000, INF32 = 2'000'000'000, MOD = 998'244'353;
constexpr db PI = acos(-1);
constexpr bool IS_FILE = false, IS_TEST_CASES = false;
random_device rd;
mt19937 rnd32(rd());
mt19937_64 rnd64(rd());
template<typename T>
bool assign_max(T& a, T b) {
if (b > a) {
a = b;
return true;
}
return false;
}
template<typename T>
bool assign_min(T& a, T b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template<typename T>
T square(T a) {
return a * a;
}
template<>
struct std::hash<pair<ll, ll>> {
ll operator() (pair<ll, ll> p) const {
return ((__int128)p.first * MOD + p.second) % INF64;
}
};
void solve() {
ll n;
cin >> n;
vector<ll> a(n), b(n);
for (ll i = 0; i < n; i++) {
cin >> a[i];
}
for (ll i = 0; i < n; i++) {
cin >> b[i];
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
ll q;
cin >> q;
vector<pair<ll, ll>> qs(q);
vector<ll> add(n + 1, 0), dec(n + 1, 0);
for (ll i = 0; i < q; i++) {
cin >> qs[i].first >> qs[i].second;
add[qs[i].first]++;
dec[qs[i].second]++;
}
vector<ll> all(n + 1, 0);
ll sum = 0;
for (ll i = 0; i <= n; i++) {
sum += add[i];
if (sum == 0) {
continue;
}
vector<ll> dp(i + 1, 0);
dp[0] = 1;
for (ll j = 0; j < n; j++) {
vector<ll> ndp(i + 1, 0);
for (ll k = 0; k <= min(i, j); k++) {
ll ost = j - k;
if (i + ost < n && a[j] <= b[i + ost]) {
ndp[k] += dp[k];
if (ndp[k] >= MOD) {
ndp[k] -= MOD;
}
}
if (k < i && a[j] > b[k]) {
ndp[k + 1] += dp[k];
if (ndp[k + 1] >= MOD) {
ndp[k + 1] %= MOD;
}
}
}
swap(dp, ndp);
}
all[i] = dp.back();
sum -= dec[i];
}
vector<ll> pref(1, 0);
for (ll i = 0; i <= n; i++) {
pref.push_back(pref.back() + all[i]);
}
for (ll i = 0; i < q; i++) {
cout << pref[qs[i].second + 1] - pref[qs[i].first] << '\n';
}
}
int main() {
if (IS_FILE) {
freopen("", "r", stdin);
freopen("", "w", stdout);
}
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll t = 1;
if (IS_TEST_CASES) {
cin >> t;
}
for (ll i = 0; i < t; i++) {
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 0
Time Limit Exceeded
input:
5000 1903 4400 1211 1700 2191 4378 4216 4601 2907 2029 3009 1858 4926 2981 2848 1345 689 4704 3137 51 1755 787 4679 1555 496 4259 3989 1122 3983 3966 3493 2869 4203 823 410 3144 738 41 3977 1767 2663 4779 3252 1930 4989 3003 1269 1604 3888 1737 3776 351 1035 4600 3740 1534 4846 2440 3725 838 76 2786...
output:
result:
Subtask #2:
score: 9
Accepted
Test #11:
score: 9
Accepted
time: 1ms
memory: 4036kb
input:
5000 2034 4850 3399 4589 4777 643 1832 1410 3705 2859 3002 1824 2063 2342 2885 1715 2531 2809 1389 1050 3167 374 242 368 4346 1850 3418 4129 4626 2762 1365 4440 3165 857 1042 61 713 2313 4467 2864 29 4725 4959 571 4753 378 4674 1960 1654 21 1704 4401 2068 3375 2092 2086 3004 4179 2865 2619 2873 4755...
output:
1674
result:
ok 1 number(s): "1674"
Test #12:
score: 9
Accepted
time: 2ms
memory: 3956kb
input:
5000 3164 3005 3927 2471 3834 3286 1963 1828 4806 2027 1836 2727 255 3460 849 112 1123 3671 59 4507 214 899 199 2640 4221 551 787 3631 3835 754 3039 115 1952 764 1799 3215 2038 2423 528 4331 4098 4043 4978 3482 4398 217 1501 4836 2499 1943 1769 3370 1627 3263 4820 27 765 992 3093 1065 4427 3073 3717...
output:
1650
result:
ok 1 number(s): "1650"
Test #13:
score: 9
Accepted
time: 2ms
memory: 4032kb
input:
5000 3937 123 4522 2530 2416 2628 183 2053 4490 3976 1469 4794 2772 1313 1671 129 402 1157 3141 3914 260 3997 2245 1008 84 109 2887 2433 1489 4690 2817 858 3442 718 3392 3804 4740 2690 2664 1110 2352 3011 2408 1334 4763 4547 4392 4985 1521 2532 4110 1233 4590 3787 1681 965 729 3871 2979 1547 1302 44...
output:
2520
result:
ok 1 number(s): "2520"
Test #14:
score: 9
Accepted
time: 2ms
memory: 3836kb
input:
5000 4959 1583 1829 3598 687 4953 3347 3771 2772 1821 1316 3698 3225 2922 559 2265 3856 476 4479 3315 2730 619 1226 203 1439 1657 2131 2347 1314 4202 3211 3573 4778 2494 1299 1525 1487 1892 86 1496 4289 1384 2757 1640 1367 2448 307 4762 1083 4143 3953 1592 1603 3533 3184 510 524 1777 2852 1776 453 6...
output:
2496
result:
ok 1 number(s): "2496"
Test #15:
score: 9
Accepted
time: 2ms
memory: 3960kb
input:
5000 3843 764 4390 4144 4885 3595 3144 2051 4735 4609 1049 1828 2591 3055 4680 2425 3651 3928 1384 4337 489 3742 4483 1073 3652 3419 3430 924 3912 1718 4127 3460 3579 1991 938 738 3756 3570 2897 1259 2504 4325 2175 3980 2197 3224 3640 3946 1676 1998 994 2472 261 2525 4278 175 2587 1984 4862 1981 875...
output:
2471
result:
ok 1 number(s): "2471"
Test #16:
score: 9
Accepted
time: 0ms
memory: 3864kb
input:
5000 3174 4007 4271 2224 2582 4317 3900 3368 1949 624 3673 2468 1541 4092 4622 4681 1540 4340 308 3651 763 1218 4075 3243 4736 109 2832 2526 4734 1588 41 101 349 301 1598 3179 3830 3040 3768 4264 2439 1466 2775 3461 3313 1425 2344 3846 2036 4755 1791 810 4916 2957 3297 3130 4791 2160 4737 107 4655 3...
output:
2447
result:
ok 1 number(s): "2447"
Test #17:
score: 9
Accepted
time: 2ms
memory: 3852kb
input:
5000 1510 1208 3421 4648 2976 4143 4896 596 330 2089 1014 2756 3209 749 1999 135 581 1337 3145 1376 1388 3523 3651 4255 4209 4691 576 3256 1972 4556 808 918 1366 3028 996 2368 181 1638 1537 687 547 4629 3766 1440 4044 1286 3988 2086 3446 4609 4299 977 4834 3260 2384 1948 4100 567 647 1338 867 3169 4...
output:
3949
result:
ok 1 number(s): "3949"
Test #18:
score: 9
Accepted
time: 2ms
memory: 3860kb
input:
5000 2373 2968 1535 3837 3598 1425 4465 2526 9 2045 3208 1366 3978 2660 2990 4579 4872 3151 1420 2932 474 4488 2162 3385 498 651 4147 779 4497 4207 3931 1637 4004 4675 3983 4036 2481 3455 1705 707 1156 4268 4509 517 3496 3214 671 3116 4503 1940 3770 3107 350 254 2605 1453 419 3179 117 1661 242 2142 ...
output:
4819
result:
ok 1 number(s): "4819"
Test #19:
score: 9
Accepted
time: 2ms
memory: 3960kb
input:
5000 1464 30 2482 2081 3223 3499 4411 1734 1714 4315 3783 329 3770 554 3708 935 2415 1592 3731 291 2413 2673 236 2625 3001 3370 4002 4011 2656 455 4869 4249 4912 1954 595 560 367 3672 1989 3560 991 2471 830 525 3177 2240 3581 2507 33 2716 4319 1488 4625 2516 1773 2512 2031 4572 1856 1447 3324 3484 3...
output:
4795
result:
ok 1 number(s): "4795"
Test #20:
score: 9
Accepted
time: 2ms
memory: 3768kb
input:
5000 4771 1693 2402 744 2676 2499 905 178 3584 2951 1591 295 1139 4603 1237 608 803 2496 3032 565 886 758 1798 1543 4191 605 2303 4196 1009 222 4925 4187 4906 1486 304 62 359 2646 959 2107 527 741 1569 2046 3438 441 2606 1311 4010 930 3850 4174 2898 1387 982 4901 4149 2352 942 4479 1721 4789 536 286...
output:
4028
result:
ok 1 number(s): "4028"
Test #21:
score: 9
Accepted
time: 2ms
memory: 3784kb
input:
5000 3998 139 4491 3750 4102 2149 1521 2002 4315 680 4659 1898 3121 162 4241 1914 3714 674 2159 2862 1685 2324 690 4312 1259 4769 774 3435 2384 2318 969 4310 3832 2287 1977 2887 3810 2440 1826 3919 3281 4125 4415 3886 2333 2782 1029 382 2449 399 1701 4359 1023 1674 4525 3808 4266 2982 331 4631 641 4...
output:
1
result:
ok 1 number(s): "1"
Test #22:
score: 9
Accepted
time: 2ms
memory: 3844kb
input:
5000 1520 4178 2161 1439 2930 3173 3400 715 4453 4073 3268 4169 93 2396 2996 2249 3812 1336 4693 866 4598 3393 2344 3944 1964 1985 740 3557 3672 4681 4290 3761 889 2469 1896 1134 4420 2112 2178 4031 3095 1359 2767 1868 1472 4463 1313 3205 4550 167 2137 3894 391 3333 590 4258 1275 3599 4852 4482 796 ...
output:
3979
result:
ok 1 number(s): "3979"
Test #23:
score: 9
Accepted
time: 2ms
memory: 3824kb
input:
5000 2636 2177 103 712 2572 4357 4535 2319 4994 623 4099 2754 4320 1431 4927 947 513 2922 4502 11 4139 4869 4979 1774 2159 916 3092 4764 735 4564 3933 1098 1558 387 1955 4905 2683 2737 1072 4235 2341 1951 3042 3593 3785 2981 3755 2425 4942 4717 4351 4305 501 3300 3604 813 861 1926 2983 2487 1494 447...
output:
3955
result:
ok 1 number(s): "3955"
Test #24:
score: 9
Accepted
time: 2ms
memory: 3820kb
input:
5000 779 1051 2701 2243 1168 2626 4914 1534 3646 4964 2663 2696 2578 3653 3305 3267 562 1158 654 4451 4020 3789 54 389 4346 1429 3793 1838 4701 1697 1142 4704 4854 2520 3453 2584 4056 371 4553 2650 2309 4370 4416 4139 3548 968 2528 4741 2224 2556 1867 1717 4962 4748 1084 2218 4371 3560 4015 35 3395 ...
output:
4825
result:
ok 1 number(s): "4825"
Test #25:
score: 9
Accepted
time: 1ms
memory: 3852kb
input:
5000 3317 265 1660 2194 3302 992 3883 3266 498 1130 4019 408 1655 4441 4968 1160 1030 34 3017 54 47 2411 2396 846 3430 4896 4423 3197 1100 1598 1225 972 3875 2756 3411 4449 204 146 1920 1928 791 3400 996 2716 3794 1535 4822 2802 1344 3419 3476 1625 1373 975 1990 2440 2239 2203 40 942 3233 603 1045 2...
output:
1
result:
ok 1 number(s): "1"
Test #26:
score: 9
Accepted
time: 2ms
memory: 3784kb
input:
5000 54 1863 637 921 3216 8 1410 4866 3497 1993 2272 4052 4512 2538 4042 4586 2521 2985 3776 2681 2406 2399 2472 3409 2012 446 3615 1639 4876 1448 4853 468 2149 1396 1288 1696 1767 589 4982 1870 3309 1933 4554 134 3927 2546 1563 1910 3745 1180 46 1101 3719 2949 458 3168 3184 763 4099 453 4435 4593 4...
output:
4776
result:
ok 1 number(s): "4776"
Test #27:
score: 9
Accepted
time: 2ms
memory: 3964kb
input:
5000 2010 975 3913 2684 1452 1884 3380 3151 2893 1159 1823 4910 2957 4878 2256 2484 578 376 2732 1008 3325 3565 1030 216 904 4671 2084 3947 226 242 3682 915 3032 3042 4157 2306 3078 4637 3230 3769 4914 2458 4586 4415 3004 3866 2722 718 1681 2338 1927 4996 292 3475 1527 1031 3931 598 820 2036 4801 26...
output:
1
result:
ok 1 number(s): "1"
Test #28:
score: 9
Accepted
time: 2ms
memory: 3860kb
input:
5000 27 4950 1857 1688 2760 4409 3888 1910 3734 4741 2319 3299 300 446 1489 315 1432 2534 4467 2169 1679 3246 4072 4973 334 2445 3367 4326 3674 754 3161 1684 92 4389 1131 2847 913 471 1882 1753 3723 2520 2635 4456 2934 2881 1586 2948 3562 3115 3960 1425 43 4698 97 54 3146 107 4979 1064 2192 2104 600...
output:
1253
result:
ok 1 number(s): "1253"
Test #29:
score: 9
Accepted
time: 2ms
memory: 3820kb
input:
5000 4249 2930 3891 4353 901 1990 4749 1000 4175 1226 4248 1401 3925 1816 1081 2991 2408 2542 849 2183 3272 951 1305 4149 4620 2916 3794 3157 4506 1429 2475 2456 1018 4326 3039 4030 848 3672 4743 2545 3894 762 172 884 3097 2531 4789 877 4599 725 4753 284 1396 3886 2524 3681 4378 946 3251 523 3364 11...
output:
1228
result:
ok 1 number(s): "1228"
Test #30:
score: 9
Accepted
time: 2ms
memory: 3960kb
input:
5000 4475 4056 10 1114 3924 4146 16 4653 3141 1056 4529 1552 2768 4342 2548 4026 2852 1508 3964 4380 3288 2341 1082 2649 2752 3941 1713 1924 2947 2794 1664 924 2861 1700 3074 4381 2102 2155 225 240 3309 22 4726 3613 3945 3736 3636 2053 1102 4745 493 2007 4266 4360 3095 3771 613 1628 139 4915 4460 41...
output:
4570
result:
ok 1 number(s): "4570"
Test #31:
score: 9
Accepted
time: 0ms
memory: 3960kb
input:
5000 4465 4341 1146 3874 2962 1252 1747 4907 2975 2586 4905 566 381 330 4156 2005 75 3657 2030 182 561 2707 910 1007 3173 289 1221 1707 2841 28 2605 1648 85 3856 1468 1142 1058 1354 2245 1135 250 1945 2352 3579 2581 3868 1441 1003 1997 219 1972 3865 694 2992 2921 2871 4911 2787 994 4485 1768 3584 39...
output:
1071
result:
ok 1 number(s): "1071"
Test #32:
score: 9
Accepted
time: 2ms
memory: 4032kb
input:
5000 4580 4605 509 2595 4569 4152 157 1077 2145 1285 1476 454 4061 2462 230 50 885 2795 1638 3014 824 4024 4117 4174 40 3036 444 4823 4709 2298 1244 2187 72 2100 4703 3533 2312 2109 3776 4258 3523 1788 3852 3671 1960 4499 2708 4254 2508 1209 2405 521 4253 1903 3111 2278 3372 3735 4207 1506 4428 1481...
output:
1
result:
ok 1 number(s): "1"
Test #33:
score: 9
Accepted
time: 2ms
memory: 3820kb
input:
5000 3799 4735 1274 4096 2769 4623 3933 4825 2269 1544 721 297 2892 3873 2186 195 1672 4453 1606 2312 739 527 1910 2525 2612 1230 311 2237 4341 4378 4434 4537 2805 3880 4127 1092 2824 3415 4584 3572 3328 3961 1052 1538 872 3209 2306 3376 2394 2387 181 4884 3258 2358 3265 2303 860 830 3177 509 3215 3...
output:
1022
result:
ok 1 number(s): "1022"
Test #34:
score: 9
Accepted
time: 0ms
memory: 3840kb
input:
5000 350 3967 2312 4604 785 3746 2069 1750 763 1502 449 2024 3362 2027 609 2147 4145 661 3447 4375 537 4652 2134 531 2050 955 4419 3338 4942 4758 1599 1746 3102 3204 501 3192 577 3456 1837 622 2225 2676 691 116 3846 1276 875 943 3677 2845 254 4007 270 4574 737 4553 972 1112 1823 4180 1863 1719 2540 ...
output:
997
result:
ok 1 number(s): "997"
Test #35:
score: 9
Accepted
time: 2ms
memory: 3812kb
input:
5000 3109 4136 1449 3647 3117 3156 2102 2766 3359 1349 87 4915 3353 964 38 1717 2852 1319 3128 4315 461 4281 543 616 35 3984 1399 624 3889 2722 3658 4698 2738 779 3542 3985 3934 2994 969 3580 2464 4666 2117 845 4151 2222 2253 1170 2473 3597 3521 687 4892 1529 591 4341 2110 292 1111 3376 2335 1473 47...
output:
1868
result:
ok 1 number(s): "1868"
Test #36:
score: 9
Accepted
time: 2ms
memory: 4040kb
input:
5000 4005 4652 3074 1072 3491 4670 2155 2306 4787 2380 4740 4067 455 400 1283 2501 2485 1310 1277 972 4412 723 834 296 4604 381 3670 3674 4054 3414 568 231 598 1045 4639 4103 3128 667 4306 3526 1293 1882 3684 4384 2445 2519 4965 949 3254 2645 3344 328 3934 3326 3644 746 868 538 3112 2805 1949 3836 3...
output:
1844
result:
ok 1 number(s): "1844"
Test #37:
score: 9
Accepted
time: 2ms
memory: 3796kb
input:
5000 4799 2911 2082 2539 1691 1747 3537 3660 902 4084 1215 4493 2445 2746 4559 3247 2359 160 3823 1512 2199 1688 4038 1172 4876 3389 304 1015 4337 1056 4802 997 3437 2419 3924 4376 2611 4643 1667 3911 2337 678 3766 4930 1342 1352 3611 3032 250 3102 471 3629 3312 4807 2220 3370 1132 1546 1471 4290 16...
output:
3345
result:
ok 1 number(s): "3345"
Test #38:
score: 9
Accepted
time: 2ms
memory: 3836kb
input:
5000 4836 300 3848 682 4967 2506 947 4358 907 2345 3369 4890 2768 4345 3849 7 4419 2875 2365 1421 338 4239 2629 3855 595 1402 4994 1044 1730 4300 3764 2897 4456 3175 4028 1052 86 1974 3648 2939 1332 140 1625 4896 4243 4604 1945 2877 2700 4126 1980 2937 1867 1227 4793 2691 2977 3148 2458 313 1878 454...
output:
3321
result:
ok 1 number(s): "3321"
Test #39:
score: 9
Accepted
time: 2ms
memory: 3960kb
input:
5000 742 4645 2110 622 1497 4179 2015 69 2283 2940 735 344 1611 558 1534 4624 2324 1910 4605 2864 3049 1278 2546 4617 2627 4206 3941 1605 2305 3551 452 3160 3031 420 114 2300 4910 132 4 4399 291 4301 2887 1817 2884 4812 4929 4221 4325 610 4427 2860 1794 545 665 4938 4368 3659 482 302 4634 1208 332 4...
output:
3297
result:
ok 1 number(s): "3297"
Test #40:
score: 9
Accepted
time: 2ms
memory: 3852kb
input:
5000 3707 2273 3749 2767 4969 2862 4181 1439 2393 194 4682 1505 1661 3203 417 1485 1064 2908 3681 4870 1400 4205 4159 1349 3511 1657 113 1418 2370 2067 2432 3584 779 1803 3468 3652 4704 4955 3721 898 568 128 2643 695 783 3834 3541 2163 1261 2467 3849 3464 3018 439 1199 4861 699 926 3351 615 1928 129...
output:
742
result:
ok 1 number(s): "742"
Subtask #3:
score: 0
Time Limit Exceeded
Test #41:
score: 0
Time Limit Exceeded
input:
5000 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 17...
output:
result:
Subtask #4:
score: 0
Wrong Answer
Test #71:
score: 0
Wrong Answer
time: 18ms
memory: 3560kb
input:
300 127 142 125 327 217 438 162 129 16 370 452 170 418 357 397 446 398 597 5 296 558 159 140 566 433 132 302 565 472 513 477 198 350 467 177 160 272 155 251 440 84 176 387 112 237 578 258 278 26 74 332 6 136 400 367 273 535 146 252 141 11 484 285 465 474 512 373 462 480 207 505 580 114 22 340 42 288...
output:
134032835264
result:
wrong answer 1st numbers differ - expected: '268091962', found: '134032835264'
Subtask #5:
score: 0
Time Limit Exceeded
Test #101:
score: 0
Time Limit Exceeded
input:
5000 214 8143 377 4551 6212 1807 4966 4535 3579 997 7830 3921 7330 6511 8039 1554 3258 9014 4821 7807 1039 7535 4022 2642 2781 8442 3246 141 9033 2806 9569 8010 565 2546 6114 7896 4315 3054 384 1100 9263 9236 8117 8983 8184 2987 5491 8267 1271 5488 3990 494 2917 6363 3528 8154 3334 4216 8742 2805 53...
output:
result:
Subtask #6:
score: 15
Accepted
Test #131:
score: 15
Accepted
time: 3ms
memory: 3856kb
input:
5000 3846 2428 4235 4639 1041 2385 198 6154 6899 8917 6284 9752 8913 2027 9242 6979 498 2562 5915 3968 9943 2767 3776 3415 3532 1826 8061 9507 6540 1850 2235 7245 5751 5780 3048 23 361 2777 262 8551 4969 1367 8671 7424 504 5822 3056 6816 9246 6810 1643 8378 9672 7472 4092 8226 5973 157 9275 4757 619...
output:
293162006
result:
ok 1 number(s): "293162006"
Test #132:
score: 15
Accepted
time: 7ms
memory: 3844kb
input:
5000 240 4709 3812 6283 3693 1669 9860 3134 5254 7223 3622 5405 5334 8727 2320 4081 5921 7770 56 5206 6720 791 5109 5488 6479 972 5972 3418 4238 1080 671 3169 1655 6331 3262 7239 9046 4566 3578 2042 7627 5631 2386 5707 1485 5286 4220 1799 4386 5613 5667 8696 1382 5027 2932 9940 9177 5115 9712 9218 7...
output:
982495908
result:
ok 1 number(s): "982495908"
Test #133:
score: 15
Accepted
time: 27ms
memory: 3864kb
input:
5000 1699 1241 5807 206 1274 2020 5048 4096 3631 1656 295 8588 9787 9927 7125 8332 8251 4720 8444 4085 2236 5592 5941 7136 3421 7052 2897 744 2284 5393 7425 4196 901 2670 4880 6984 7870 951 9392 1536 8962 5403 617 6922 3367 544 6840 4662 7877 3856 3870 5560 4598 7025 8375 9608 2094 9232 6021 9414 85...
output:
810997105
result:
ok 1 number(s): "810997105"
Test #134:
score: 15
Accepted
time: 17ms
memory: 3816kb
input:
5000 3423 7958 7269 7816 6453 5678 9437 4465 8047 9907 4128 6776 5511 1497 3007 817 6219 3914 5805 9209 4639 6293 2114 396 7104 5250 3072 5605 8079 3077 5784 7090 324 6611 4427 2817 2948 7716 6697 4959 6129 6417 4569 2830 6217 1602 1660 138 3519 9646 9521 4309 1532 4768 217 4432 6295 8560 76 3886 76...
output:
289324667
result:
ok 1 number(s): "289324667"
Test #135:
score: 15
Accepted
time: 22ms
memory: 3792kb
input:
5000 2705 3823 7650 789 5507 9707 7219 8902 2396 3573 8421 9720 5487 3984 388 7838 3617 3546 4383 2479 3522 4561 6706 3887 9833 5323 4173 3003 4924 2368 4159 8558 8289 8674 2643 5861 3012 4569 7072 1891 8481 8987 7449 9057 2236 7101 8659 6215 9515 1272 3958 8735 5735 2301 4388 6947 4048 6858 7693 96...
output:
539769486
result:
ok 1 number(s): "539769486"
Test #136:
score: 15
Accepted
time: 22ms
memory: 3848kb
input:
5000 6077 3742 9908 10000 8838 3859 8752 4146 7761 3934 9383 2760 5733 4697 2482 9862 6148 738 977 7783 6072 4568 3777 9826 9691 8776 3267 7804 3579 3261 3547 5673 5303 4569 2512 1110 1112 5566 7447 7312 1494 3682 6250 4910 8392 5147 1203 1600 8372 500 5774 9449 2033 3666 3560 327 9181 5339 8035 255...
output:
588728530
result:
ok 1 number(s): "588728530"
Test #137:
score: 15
Accepted
time: 10ms
memory: 3816kb
input:
5000 6922 347 630 6220 3525 6843 9351 9180 9243 6405 5614 7512 5364 6746 9925 9619 2446 134 3772 6870 2292 4845 8610 9596 8429 8799 1482 651 8028 9611 2822 7264 8234 8165 3993 631 1709 7975 1235 7506 8272 3730 175 325 1567 509 6963 4058 3322 4618 924 3718 7098 9575 9885 4120 1310 1975 5397 634 2312 ...
output:
634459802
result:
ok 1 number(s): "634459802"
Test #138:
score: 15
Accepted
time: 11ms
memory: 3904kb
input:
5000 4749 5073 5623 9534 7406 2269 2303 8969 8193 1460 7389 6815 5448 3120 1534 4989 6577 118 2189 9937 8669 7590 1258 6313 2956 2333 1447 7591 6394 1670 4162 941 4679 3407 5041 2051 3603 156 143 4429 900 8462 8355 8221 3046 5296 4407 7562 7444 5857 7297 2245 1036 312 2792 3511 6675 3720 7019 158 60...
output:
981183435
result:
ok 1 number(s): "981183435"
Test #139:
score: 15
Accepted
time: 19ms
memory: 3840kb
input:
5000 5177 512 2717 47 7993 5591 4003 1 770 510 8258 8815 5666 6285 3544 9573 9774 425 267 1479 1419 177 3540 7371 3905 6210 9158 2299 3998 2654 3165 3901 1780 5947 1582 8502 5179 6687 1875 678 1763 6454 4481 9172 5613 988 6154 3020 890 4840 6788 4279 622 3914 3316 2679 1178 1986 3637 2513 5157 6122 ...
output:
583471891
result:
ok 1 number(s): "583471891"
Test #140:
score: 15
Accepted
time: 10ms
memory: 3772kb
input:
5000 6978 6535 2430 3300 3059 2934 5786 2005 1317 217 6395 7952 3667 260 9414 4168 311 2516 8380 4316 2394 2666 6892 1944 2239 6386 1636 3650 2495 3660 3664 6047 5155 2377 8878 8288 6383 6706 7732 349 2278 4095 9686 5812 100 5097 2874 6262 126 8066 6011 9562 8814 8164 3810 5006 2090 9336 4937 7874 1...
output:
448725950
result:
ok 1 number(s): "448725950"
Test #141:
score: 15
Accepted
time: 19ms
memory: 3956kb
input:
5000 3522 4657 994 5336 4378 295 4422 827 1650 4479 502 3369 6320 203 7741 8041 949 9701 8368 5930 1340 3990 5315 7450 4380 3957 9598 9403 5018 2154 9735 2622 8241 2305 9948 1470 6490 8891 5041 562 1936 714 6809 8976 6517 7861 1059 6556 8184 1343 8524 6046 8562 8350 3342 3274 7753 3046 2101 5148 707...
output:
878469109
result:
ok 1 number(s): "878469109"
Test #142:
score: 15
Accepted
time: 23ms
memory: 3852kb
input:
5000 5221 2248 4912 8212 7213 401 6818 6955 7372 551 2599 7697 7169 2707 540 3096 7146 54 8889 8290 1399 2166 8452 3502 5866 5974 1102 7360 2892 176 2817 6114 3730 6489 7008 6312 7838 9020 581 5844 394 1324 1683 9650 6270 7735 3918 9301 2606 2451 1204 4875 3430 6207 9751 9964 4584 5962 2600 6735 303...
output:
955174962
result:
ok 1 number(s): "955174962"
Test #143:
score: 15
Accepted
time: 8ms
memory: 3956kb
input:
5000 436 1051 279 12 3940 7923 1069 2941 9169 2661 2149 8721 8378 7578 7951 2770 6262 5999 1657 2881 9661 809 4185 301 6896 7495 9564 7420 6807 2996 645 1715 3570 4601 2348 9328 5748 7853 166 1825 8577 1284 6000 1080 9141 7962 335 3357 6727 472 3229 6993 5964 3286 2355 3455 6003 6999 7327 2152 6205 ...
output:
984823517
result:
ok 1 number(s): "984823517"
Test #144:
score: 15
Accepted
time: 9ms
memory: 4040kb
input:
5000 2000 612 5498 6477 7189 6953 3277 4256 8763 9494 4366 1333 2647 8383 618 2335 6673 9192 7015 1894 7216 2668 1420 12 8198 8528 7021 1565 704 4777 5607 9165 3607 4070 106 4244 1601 6452 4257 1643 6441 7771 5768 5973 3201 469 9265 7359 5217 7944 1060 8559 3248 3137 6971 4482 9153 6596 520 1464 977...
output:
15065864
result:
ok 1 number(s): "15065864"
Test #145:
score: 15
Accepted
time: 19ms
memory: 3776kb
input:
5000 1463 6468 5812 4238 900 6433 5564 5916 7626 4371 651 3843 1975 9916 2891 8050 7869 4306 1152 1776 8052 4295 2912 625 8309 1800 5457 4076 8521 7022 4601 1593 5865 6052 6784 4551 7931 3046 7801 8217 9914 2588 5375 817 8537 7347 8931 4088 9928 9877 110 4431 7546 6664 7643 9963 812 7621 8685 9177 6...
output:
948060514
result:
ok 1 number(s): "948060514"
Test #146:
score: 15
Accepted
time: 20ms
memory: 4000kb
input:
5000 674 55 5723 783 3653 1165 2000 6882 3505 2846 2862 7185 8733 5370 1290 8523 8830 9274 4865 9817 7817 6677 8717 8393 5020 1269 7496 1543 230 3097 8238 4867 8504 3385 6097 6590 7539 5923 4189 3241 1887 5512 689 4308 2558 3976 4143 2920 2182 769 7215 1937 4807 51 6728 8377 9126 7628 6135 9079 6035...
output:
450594619
result:
ok 1 number(s): "450594619"
Test #147:
score: 15
Accepted
time: 4ms
memory: 3796kb
input:
5000 7726 7503 845 332 8711 6404 2520 1681 499 416 8671 6470 4800 2281 4439 87 6222 3573 5407 8436 3658 3657 4469 6571 268 7597 3485 4407 3724 7259 2764 6784 4948 6485 1389 4645 4633 5790 1403 5086 3336 6930 4642 1314 5651 1608 4526 9754 9335 7748 2823 5534 349 8484 6680 4837 2282 4389 4432 5090 826...
output:
89143754
result:
ok 1 number(s): "89143754"
Test #148:
score: 15
Accepted
time: 5ms
memory: 3772kb
input:
5000 6570 3360 8804 3873 5779 6303 541 7362 1680 5403 5919 3951 9020 5086 4915 8009 8825 4041 6513 9502 4589 9158 69 2243 7580 6874 614 1982 871 8159 2503 609 9219 6222 1247 536 338 9307 3611 12 8285 8834 300 2133 7888 3946 9032 478 9127 9575 1123 6003 5034 1644 5189 6845 1735 8364 6307 4303 1002 13...
output:
966325097
result:
ok 1 number(s): "966325097"
Test #149:
score: 15
Accepted
time: 15ms
memory: 3956kb
input:
5000 4678 2523 9203 6911 6285 9537 2958 5940 140 8310 4970 504 9531 8107 9210 2203 7448 1260 940 6118 6876 8656 8315 5148 3366 4318 9322 4077 8113 1708 721 8857 526 5012 9326 5917 3278 9467 4145 4018 8464 1997 4245 7147 282 8788 2476 1207 1171 4742 6490 8343 6668 1486 2955 8247 9078 8532 6802 4822 2...
output:
320130853
result:
ok 1 number(s): "320130853"
Test #150:
score: 15
Accepted
time: 22ms
memory: 3784kb
input:
5000 5693 9926 4379 4075 8827 7375 6591 6517 9545 2827 1210 2479 8886 5796 6925 3307 9563 4242 1437 8059 9557 7415 5623 5332 2598 3054 9744 7032 762 5484 3728 6981 2356 6303 2559 2069 9512 4472 2088 2130 9644 563 463 2798 9635 1952 4506 3190 3106 8374 5945 1979 669 2778 6754 3063 2729 4218 7852 4881...
output:
102623056
result:
ok 1 number(s): "102623056"
Test #151:
score: 15
Accepted
time: 11ms
memory: 3844kb
input:
5000 1374 1800 3181 2586 5344 434 9784 4166 8291 208 7901 651 8963 2818 352 4437 5018 9997 2596 5924 9163 5912 1404 9384 6554 6430 8357 691 9201 9622 2470 9177 7379 3870 1271 7520 364 1888 835 9494 6946 7461 3074 8395 685 7130 1953 143 3711 647 2128 3945 8616 2480 6437 8767 8025 1042 3776 8447 5949 ...
output:
895146486
result:
ok 1 number(s): "895146486"
Test #152:
score: 15
Accepted
time: 23ms
memory: 3772kb
input:
5000 6943 2525 8619 5977 1341 9841 600 8031 7245 5457 2501 4794 4086 457 1675 3053 9793 5123 3005 5822 2591 1000 2207 4841 491 4855 2219 8528 4515 4728 9038 320 5746 6655 5949 4387 6010 7568 4182 1175 8883 8737 6604 6983 929 8715 5277 5882 298 8952 1925 3427 3290 5662 9502 6385 9066 4094 2679 2807 5...
output:
743687661
result:
ok 1 number(s): "743687661"
Test #153:
score: 15
Accepted
time: 19ms
memory: 3856kb
input:
5000 5412 8259 2256 6833 4357 8463 3594 6876 347 8828 5258 7161 1979 5975 1114 9793 9679 3970 5526 6128 2972 3018 7959 7874 6567 3601 9929 7322 2456 2951 9803 3356 6696 3888 9495 5800 3329 4352 2789 5613 5970 6446 1158 9881 3260 5357 3928 1789 4649 8005 1275 4212 2712 2542 3980 1748 6000 2301 2652 2...
output:
345242788
result:
ok 1 number(s): "345242788"
Test #154:
score: 15
Accepted
time: 16ms
memory: 3784kb
input:
5000 2712 9669 5725 4610 9905 7585 3257 280 834 7256 8279 1854 7077 2814 7065 898 6210 1180 8424 4870 5811 660 6116 4541 5094 8037 2629 9350 8253 6544 5262 3170 5699 9466 7149 4986 7985 9676 3537 3875 1232 4706 5549 3589 4533 1684 7641 8600 3315 6806 8572 7825 9253 6893 3142 4954 1910 4894 239 9620 ...
output:
924128079
result:
ok 1 number(s): "924128079"
Test #155:
score: 15
Accepted
time: 0ms
memory: 3836kb
input:
5000 6480 8087 8226 8465 2335 3984 897 5064 4046 9153 2816 10 9653 4872 2338 8800 545 6708 711 2229 6855 5779 2587 2582 4088 2368 1801 1447 468 7698 1287 5459 9240 9763 6268 1891 2976 3758 4984 4738 1681 4618 6456 7045 6612 5348 2469 4465 9710 565 6449 2691 9618 8566 6238 6473 3807 2942 3893 6990 96...
output:
329370807
result:
ok 1 number(s): "329370807"
Test #156:
score: 15
Accepted
time: 5ms
memory: 3780kb
input:
5000 6985 5119 6467 6125 1567 6617 7979 6812 7190 6991 5595 3433 4632 3773 2179 9442 8929 3569 2634 6200 954 318 2314 6685 275 9895 387 1843 7047 3721 220 455 983 3434 1711 3178 3897 7236 6777 8524 6097 9573 3029 842 447 2669 5063 8219 984 3899 248 905 2919 7514 8553 923 1909 4143 1149 6794 8146 492...
output:
365890389
result:
ok 1 number(s): "365890389"
Test #157:
score: 15
Accepted
time: 15ms
memory: 3848kb
input:
5000 8352 8078 7174 7376 1960 3231 7451 3176 3314 9710 2299 7461 1951 8640 2245 2321 904 9405 6136 8794 895 2828 7335 6592 13 6363 8919 3932 4479 1802 3666 8800 9967 9081 2886 4887 6376 7609 4852 6212 5135 1053 35 6653 2664 4316 3391 2444 7212 2671 8054 5483 4820 5865 1117 1958 8493 7198 4609 8576 6...
output:
862874037
result:
ok 1 number(s): "862874037"
Test #158:
score: 15
Accepted
time: 17ms
memory: 3960kb
input:
5000 434 8072 7671 3385 5519 6111 4147 3519 8300 4983 9204 8959 732 676 5029 618 7839 7243 7852 7734 177 5182 8989 7364 7733 6057 2759 3480 1761 7805 793 1078 8265 8071 4125 3606 5172 1415 3090 1312 3425 241 3968 2920 4496 3301 4862 4355 1995 508 8321 6085 9640 8142 7663 8270 4717 4149 7028 6241 331...
output:
58087383
result:
ok 1 number(s): "58087383"
Test #159:
score: 15
Accepted
time: 6ms
memory: 3796kb
input:
5000 7603 9124 4188 8310 8718 3713 6004 568 5952 8121 2848 6998 2752 6387 8932 4751 4851 372 8223 612 7195 1274 1675 3398 6124 4747 7998 8117 4895 5168 1481 2821 980 4341 7811 1043 9263 5099 1881 9578 5566 2058 4853 2833 9141 6294 8019 9551 442 437 6761 2820 6221 5868 7552 2877 4013 5496 7240 1253 7...
output:
139767526
result:
ok 1 number(s): "139767526"
Test #160:
score: 15
Accepted
time: 19ms
memory: 3780kb
input:
5000 3203 9872 8925 3448 9048 9982 8842 159 7168 7699 1428 8478 6026 7044 6861 9810 9472 5918 2403 3655 7667 4297 6972 6322 8125 1031 3019 5746 5038 4723 1212 6596 4813 2343 5476 9231 3975 7206 4127 7607 690 1271 5871 8627 1576 7073 9985 7224 6723 8668 931 7474 5683 2705 8102 8393 5428 4371 4375 360...
output:
30037674
result:
ok 1 number(s): "30037674"
Subtask #7:
score: 0
Skipped
Dependency #4:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
0%