QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#167272 | #4095. 날다람쥐 | Lynkcat# | 35 | 39ms | 23060kb | C++20 | 2.5kb | 2023-09-07 13:20:51 | 2024-07-04 01:53:15 |
Judging History
answer
#include "squirrel.h"
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,ll >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
// #define int ll
// #define N
using namespace std;
long long fly(std::vector<int> D, std::vector<int> H, std::vector<int> W, int L, int R)
{
int n = D.size();
deque<pa> g;
g.push_back(mp(0,0ll));
g.push_back(mp(L,0ll));
g.push_back(mp(H[0],1ll*(H[0]-L)*W[0]));
ll sm=0;
// for (auto [u,v]:g) cout<<u-sm<<":"<<v<<",";
// cout<<endl;
for (int i=1;i<n;i++)
{
sm+=D[i]-D[i-1];
while (g.size()&&g[0].fi<sm)
{
pa nxt=mp(-1,-1ll);
if (g.size()>1&&g[1].fi>sm) nxt=mp(sm,g[0].se+(g[1].se-g[0].se)/(g[1].fi-g[0].fi)*(sm-g[0].fi));
g.pop_front();
if (nxt.fi!=-1) g.push_front(nxt);
}
// cout<<"----";
// for (auto [u,v]:g) cout<<u-sm<<":"<<v<<",";
// cout<<endl;
while (g.size()&&g[sz(g)-1].fi>sm+H[i])
{
pa nxt=mp(-1,-1ll);
if (g.size()>1&&g[sz(g)-2].fi<sm+H[i])
nxt=mp(sm+H[i],g[sz(g)-2].se+
(g[sz(g)-1].se-g[sz(g)-2].se)/
(g[sz(g)-1].fi-g[sz(g)-2].fi)*
(sm+H[i]-g[sz(g)-2].fi));
g.pop_back();
if (nxt.fi!=-1) g.push_back(nxt);
}
if (g.empty()) return -1;
while (g.size()>=2&&
(g[sz(g)-1].se-g[sz(g)-2].se)
/(g[sz(g)-1].fi-g[sz(g)-2].fi)>W[i]) g.pop_back();
if (g.size()&&g.back().fi!=sm+H[i])
{
// cout<<"??"<<i<<" "<<(sm+H[i]-g.back().fi)<<" "<<W[i]<<endl;
g.push_back(mp(sm+H[i],g.back().se+(sm+H[i]-g.back().fi)*W[i]));
}
// for (auto [u,v]:g) cout<<u-sm<<":"<<v<<",";
// cout<<endl;
}
while (g.size()&&g[sz(g)-1].fi>sm+R)
{
if (g.size()<=1) return -1;
pa nxt=mp(-1,-1ll);
if (g.size()>1&&g[sz(g)-1].fi>sm+R&&g[sz(g)-2].fi<sm+R)
nxt=mp(sm+R,g[sz(g)-2].se+
(g[sz(g)-1].se-g[sz(g)-2].se)/
(g[sz(g)-1].fi-g[sz(g)-2].fi)*
(sm+R-g[sz(g)-2].fi));
g.pop_back();
if (nxt.fi!=-1) g.push_back(nxt);
}
return g.back().se;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 4
Accepted
Test #1:
score: 4
Accepted
time: 30ms
memory: 14936kb
input:
500000 0 74201083 0 1894 103949999 0 1976 991641614 0 6829 836886815 0 7228 145466667 0 8362 872980184 0 12946 992583286 0 15616 517178776 0 16265 554052070 0 17815 316840754 0 17968 707530952 0 20234 453750281 0 20430 600152122 0 20883 596429721 0 20904 475724209 0 21127 592035055 0 21432 661316980...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 8ms
memory: 14980kb
input:
500000 0 992872946 0 259 811956587 0 469 550123431 0 2397 128381855 0 4730 718488908 0 6189 369164617 0 9133 337457335 0 10306 265011040 0 10471 405898782 0 12748 631300989 0 12984 573431455 0 14284 32253024 0 20210 30568121 0 20599 698978409 0 23446 816300753 0 23885 941673503 0 25069 866145199 0 2...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #3:
score: 0
Accepted
time: 15ms
memory: 14916kb
input:
500000 0 61287913 0 690 665187368 0 781 403572543 0 1651 860068383 0 2054 996543853 0 5677 715605946 0 6248 387364087 0 6656 457553703 0 8128 257745494 0 8837 650793929 0 10048 439331958 0 11218 50947254 0 13825 606208312 0 16388 946751289 0 16392 451844593 0 18200 586279248 0 19879 925749226 0 2406...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #4:
score: 0
Accepted
time: 28ms
memory: 14916kb
input:
500000 0 103400 0 772 6145 0 1414 183504 0 5066 187069 0 5891 79363 0 7491 117644 0 9622 118377 0 10097 116975 0 12404 109700 0 13725 169198 0 16882 13919 0 17883 104432 0 23188 160382 0 24199 129066 0 26818 115866 0 27382 156598 0 28717 136194 0 28894 151222 0 30661 72164 0 30896 51701 0 31421 1647...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #5:
score: 0
Accepted
time: 27ms
memory: 14912kb
input:
500000 0 173941000 0 681 512523109 0 1498 428379766 0 2673 573977082 0 4146 324738666 0 6078 83575224 0 6402 326966377 0 10578 137523697 0 11678 237474053 0 11822 182597856 0 13415 346229244 0 13893 156260942 0 14805 274922884 0 15146 141916015 0 15188 643754804 0 15783 470355700 0 16872 230632992 0...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #6:
score: 0
Accepted
time: 21ms
memory: 14908kb
input:
500000 0 816 0 816 1904 0 2720 1517 0 4237 3531 0 7768 3319 0 11087 352 0 11439 423 0 11862 2630 0 14492 824 0 15316 2345 0 17661 201 0 17862 195 0 18057 1880 0 19937 1945 0 21882 128 0 22010 713 0 22723 1728 0 24451 1640 0 26091 144 0 26235 1451 0 27686 828 0 28514 2185 0 30699 2423 0 33122 1794 0 ...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #7:
score: 0
Accepted
time: 13ms
memory: 14984kb
input:
500000 0 1782 0 1782 733 0 2515 1103 0 3618 2837 0 6455 4818 0 11273 491 0 11764 1626 0 13390 292 0 13682 1379 0 15061 64 0 15125 3576 0 18701 837 0 19538 123 0 19661 154 0 19815 1652 0 21467 303 0 21770 97 0 21867 397 0 22264 910 0 23174 4135 0 27309 727 0 28036 20 0 28056 218 0 28274 156 0 28430 4...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #8:
score: 0
Accepted
time: 14ms
memory: 14912kb
input:
500000 0 2082 0 2082 3301 0 5383 2849 0 8232 266 0 8498 5841 0 14339 311 0 14650 884 0 15534 446 0 15980 5119 0 21099 457 0 21556 770 0 22326 1385 0 23711 466 0 24177 2529 0 26706 874 0 27580 350 0 27930 38 0 27968 2913 0 30881 10 0 30891 1196 0 32087 771 0 32858 251 0 33109 761 0 33870 2329 0 36199...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #9:
score: 0
Accepted
time: 24ms
memory: 23060kb
input:
500000 0 1000000000 0 2000 1000000000 0 4000 1000000000 0 6000 1000000000 0 8000 1000000000 0 10000 1000000000 0 12000 1000000000 0 14000 1000000000 0 16000 1000000000 0 18000 1000000000 0 20000 1000000000 0 22000 1000000000 0 24000 1000000000 0 26000 1000000000 0 28000 1000000000 0 30000 1000000000...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #10:
score: 0
Accepted
time: 23ms
memory: 14980kb
input:
500000 0 2724 0 2000 3214 0 4000 3264 0 6000 2369 0 8000 3795 0 10000 3667 0 12000 3237 0 14000 3056 0 16000 3030 0 18000 2888 0 20000 2824 0 22000 3215 0 24000 2032 0 26000 3724 0 28000 3848 0 30000 3230 0 32000 3376 0 34000 3090 0 36000 2857 0 38000 2750 0 40000 2648 0 42000 3866 0 44000 2665 0 46...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #11:
score: 0
Accepted
time: 23ms
memory: 14956kb
input:
500000 0 3079 0 1829 1959 0 3436 3184 0 5335 2104 0 7336 3203 0 8890 2090 0 10747 2034 0 12382 3496 0 14066 3518 0 15893 2791 0 17808 3583 0 19985 3261 0 21554 2783 0 23603 2663 0 25586 2310 0 27227 3587 0 29272 3385 0 31133 3425 0 33011 1806 0 34668 3448 0 36767 2948 0 38317 2648 0 39948 3099 0 420...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #12:
score: 0
Accepted
time: 21ms
memory: 14980kb
input:
500000 0 22 0 1 37 0 2 33 0 3 23 0 4 39 0 5 10 0 6 32 0 7 45 0 8 18 0 9 14 0 10 14 0 11 50 0 12 47 0 13 16 0 14 17 0 15 45 0 16 48 0 17 32 0 18 39 0 19 49 0 20 16 0 21 45 0 22 46 0 23 35 0 24 16 0 25 14 0 26 21 0 27 17 0 28 29 0 29 48 0 30 35 0 31 40 0 32 35 0 33 44 0 34 39 0 35 24 0 36 25 0 37 11 0...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #13:
score: 0
Accepted
time: 27ms
memory: 14952kb
input:
500000 0 4565 0 1 4463 0 2 4349 0 3 4146 0 4 4844 0 5 4018 0 6 4171 0 7 4904 0 8 4840 0 9 4107 0 10 4289 0 11 4462 0 12 4812 0 13 4113 0 14 4591 0 15 4833 0 16 4078 0 17 4921 0 18 4533 0 19 4416 0 20 4502 0 21 4930 0 22 4343 0 23 4638 0 24 4481 0 25 4509 0 26 4838 0 27 4425 0 28 4424 0 29 4292 0 30 ...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #14:
score: 0
Accepted
time: 28ms
memory: 14980kb
input:
500000 0 447380 0 1 477102 0 2 454039 0 3 464090 0 4 473337 0 5 481729 0 6 423665 0 7 494736 0 8 467467 0 9 485580 0 10 439098 0 11 477492 0 12 469263 0 13 400817 0 14 450992 0 15 405935 0 16 421286 0 17 415691 0 18 497610 0 19 485527 0 20 455709 0 21 421232 0 22 450487 0 23 486966 0 24 491451 0 25 ...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #15:
score: 0
Accepted
time: 23ms
memory: 14904kb
input:
500000 0 759 0 3 699 0 7 408 0 12 781 0 16 404 0 19 526 0 24 614 0 27 641 0 30 562 0 33 608 0 36 726 0 40 627 0 43 636 0 48 560 0 51 505 0 55 557 0 58 798 0 63 555 0 66 425 0 69 820 0 72 709 0 76 618 0 80 536 0 84 641 0 89 608 0 93 770 0 97 636 0 102 409 0 106 550 0 111 688 0 116 512 0 119 485 0 123...
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Subtask #2:
score: 13
Accepted
Test #16:
score: 13
Accepted
time: 0ms
memory: 3736kb
input:
3 0 8 1 2 4 1 4 9 1 7 5
output:
3 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #17:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
3 0 8 1 3 6 1 5 9 1 7 0
output:
0 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #18:
score: 0
Accepted
time: 31ms
memory: 15028kb
input:
500000 0 880898257 1 449 697805005 1 832 732167074 1 1215 76849645 1 1235 794467866 1 1420 214671183 1 5637 797829256 1 8769 882665474 1 9532 129301213 1 10004 585069308 1 12187 307040559 1 15062 932082580 1 15573 153996345 1 16803 883017734 1 17855 868527578 1 21933 326154227 1 26329 938464658 1 26...
output:
694100402 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #19:
score: 0
Accepted
time: 27ms
memory: 14928kb
input:
500000 0 949313224 1 536 846003081 1 571 290648891 1 953 808536173 1 2120 367490107 1 4604 710855616 1 4945 287927496 1 6989 485273546 1 7221 981147924 1 7467 194496840 1 10881 172941062 1 11386 510585322 1 11560 729636537 1 11810 130790614 1 12180 504071418 1 13051 970759971 1 14859 143292877 1 150...
output:
934838048 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #20:
score: 0
Accepted
time: 26ms
memory: 14872kb
input:
500000 0 156184140 1 3054 622527975 1 3208 516548797 1 5692 247545111 1 7508 13127422 1 17512 67126270 1 18016 190688043 1 19968 156456297 1 21064 386558439 1 21986 144704235 1 23086 70168788 1 23319 268167517 1 24038 667094814 1 27637 604168024 1 29680 391816689 1 33374 916670397 1 35434 801630974 ...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #21:
score: 0
Accepted
time: 31ms
memory: 14952kb
input:
500000 0 75576 1 383 81438 1 2642 79979 1 10372 76365 1 10690 18055 1 11884 13518 1 13146 86022 1 13902 136109 1 16874 35181 1 18010 122565 1 19529 92479 1 22776 50832 1 23520 51645 1 24383 124785 1 25441 124006 1 28632 97752 1 32905 158390 1 38134 65706 1 40554 85608 1 43884 136910 1 44535 139427 1...
output:
962368093 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #22:
score: 0
Accepted
time: 23ms
memory: 15048kb
input:
500000 0 562480579 1 252 5532018 1 2128 527064950 1 2500 435138920 1 7247 350987032 1 8627 226187649 1 10549 193522852 1 11937 445467260 1 12049 355631276 1 12967 196297414 1 13413 404500058 1 14518 448419652 1 15834 301210583 1 17006 265985484 1 17451 292300713 1 18460 532237985 1 19973 41679802 1 ...
output:
631620359 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #23:
score: 0
Accepted
time: 20ms
memory: 14980kb
input:
500000 0 4835 1 4835 682 1 5517 757 1 6274 1678 1 7952 1016 1 8968 410 1 9378 3707 1 13085 2304 1 15389 5734 1 21123 595 1 21718 856 1 22574 2007 1 24581 5017 1 29598 3183 1 32781 739 1 33520 1027 1 34547 1631 1 36178 331 1 36509 1687 1 38196 518 1 38714 499 1 39213 5379 1 44592 1507 1 46099 352 1 4...
output:
1038034809 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #24:
score: 0
Accepted
time: 12ms
memory: 15052kb
input:
500000 0 29 1 29 1099 1 1128 1935 1 3063 3500 1 6563 884 1 7447 1086 1 8533 94 1 8627 5334 1 13961 5919 1 19880 2975 1 22855 3106 1 25961 946 1 26907 3024 1 29931 2347 1 32278 652 1 32930 1009 1 33939 1477 1 35416 3704 1 39120 154 1 39274 2243 1 41517 1129 1 42646 149 1 42795 3924 1 46719 353 1 4707...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #25:
score: 0
Accepted
time: 20ms
memory: 23012kb
input:
500000 0 1000000000 1 2000 1000000000 1 4000 1000000000 1 6000 1000000000 1 8000 1000000000 1 10000 1000000000 1 12000 1000000000 1 14000 1000000000 1 16000 1000000000 1 18000 1000000000 1 20000 1000000000 1 22000 1000000000 1 24000 1000000000 1 26000 1000000000 1 28000 1000000000 1 30000 1000000000...
output:
1999998000 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #26:
score: 0
Accepted
time: 22ms
memory: 14980kb
input:
500000 0 3427 1 2000 2246 1 4000 2911 1 6000 2505 1 8000 2766 1 10000 2166 1 12000 2769 1 14000 2053 1 16000 3146 1 18000 3509 1 20000 3346 1 22000 3590 1 24000 3220 1 26000 2735 1 28000 3888 1 30000 2313 1 32000 3289 1 34000 3505 1 36000 2343 1 38000 2506 1 40000 3766 1 42000 2985 1 44000 2149 1 46...
output:
1000001002 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #27:
score: 0
Accepted
time: 19ms
memory: 14984kb
input:
500000 0 2970 1 1996 2336 1 3518 2759 1 5190 3002 1 6882 3024 1 8855 2207 1 10447 2472 1 12184 2614 1 14361 3793 1 16496 2228 1 18195 1898 1 19891 2113 1 21619 2946 1 23550 3405 1 25470 2486 1 27250 2028 1 28876 2698 1 30987 2160 1 32931 3088 1 34594 1723 1 36176 2847 1 37885 3122 1 39797 2073 1 414...
output:
1085003283 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #28:
score: 0
Accepted
time: 21ms
memory: 14984kb
input:
500000 0 19 1 1 11 1 2 42 1 3 17 1 4 18 1 5 50 1 6 47 1 7 34 1 8 34 1 9 23 1 10 45 1 11 38 1 12 33 1 13 18 1 14 11 1 15 11 1 16 37 1 17 22 1 18 48 1 19 24 1 20 32 1 21 21 1 22 32 1 23 32 1 24 15 1 25 30 1 26 40 1 27 33 1 28 49 1 29 14 1 30 26 1 31 42 1 32 50 1 33 44 1 34 26 1 35 33 1 36 48 1 37 36 1...
output:
499996 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #29:
score: 0
Accepted
time: 24ms
memory: 14980kb
input:
500000 0 4342 1 1 4653 1 2 4434 1 3 4445 1 4 4270 1 5 4914 1 6 4900 1 7 4659 1 8 4864 1 9 4918 1 10 4937 1 11 4967 1 12 4513 1 13 4884 1 14 4672 1 15 4196 1 16 4167 1 17 4564 1 18 4661 1 19 4715 1 20 4149 1 21 4455 1 22 4974 1 23 4261 1 24 4856 1 25 4135 1 26 4899 1 27 4738 1 28 4386 1 29 4404 1 30 ...
output:
502975 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #30:
score: 0
Accepted
time: 24ms
memory: 14856kb
input:
500000 0 450344 1 1 481586 1 2 425451 1 3 436062 1 4 414845 1 5 498028 1 6 494391 1 7 430527 1 8 478999 1 9 434484 1 10 484966 1 11 427702 1 12 414103 1 13 442685 1 14 480007 1 15 415903 1 16 406353 1 17 413165 1 18 407808 1 19 450837 1 20 406617 1 21 414042 1 22 436094 1 23 445454 1 24 419452 1 25 ...
output:
441146 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #31:
score: 0
Accepted
time: 32ms
memory: 14836kb
input:
500000 0 782 1 5 661 1 9 586 1 14 557 1 17 478 1 21 563 1 25 764 1 28 547 1 32 467 1 37 710 1 40 433 1 44 562 1 47 682 1 51 535 1 54 762 1 57 465 1 62 637 1 67 446 1 71 443 1 74 593 1 78 761 1 83 486 1 88 765 1 93 607 1 96 508 1 100 466 1 103 756 1 107 743 1 110 701 1 114 657 1 117 545 1 121 651 1 1...
output:
307899638 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Subtask #3:
score: 18
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #32:
score: 18
Accepted
time: 0ms
memory: 3728kb
input:
3 0 8 3 2 5 4 5 5 6 5 4
output:
18 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #33:
score: 0
Accepted
time: 1ms
memory: 3980kb
input:
5000 0 117875 374274 55099 9717920 546247 60332 9380694 591263 117809 7866858 968857 117896 11747297 1061215 583058 6040452 1480049 585303 12563613 1687570 631094 327079 1721490 707181 12145476 2806144 760298 9280111 3041852 1396518 6709466 3429175 1528809 2350909 3816442 1597745 7618117 3960315 204...
output:
408427806508977949 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #34:
score: 0
Accepted
time: 1ms
memory: 3968kb
input:
5000 0 110807212 397691 310306 174851336 433374 410350 15812669 598924 627863 99033962 784952 926462 190709579 961580 1053746 186937406 1163640 1210624 31606846 1235135 1250906 197249407 1533363 1331200 62390208 1581901 1672630 189229108 1665646 1685271 13651483 1685335 1701134 125665166 2196798 191...
output:
542164065509156009 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #35:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
5000 0 461419319 182429 47498 382598589 290137 230224 16101018 484825 313520 130173662 570599 527925 348363493 1644918 659010 65721342 1748202 674096 401848447 1922017 759290 501986556 2101021 809471 494291338 2148689 863035 72462008 2723756 993092 51873016 2745894 1046455 511834171 2816694 1150028 ...
output:
684782006466602673 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #36:
score: 0
Accepted
time: 35ms
memory: 14916kb
input:
500000 0 959740890 2520 103 62425685 6927 822 228575329 11046 2711 724596428 11848 2728 26425084 11976 2749 659925556 13161 5252 634195734 15788 7047 448198504 15844 7546 523815450 16944 7599 789249415 17038 7797 101321211 17995 8298 387108981 23470 9949 829831597 24974 10529 801878872 30216 12321 6...
output:
294810996328283877 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #37:
score: 0
Accepted
time: 31ms
memory: 14976kb
input:
500000 0 820267568 870 1002 817982095 1077 2062 791772830 1339 2700 580525400 4425 2806 770888780 6834 3326 276710836 7753 8392 850806213 13188 9927 11936072 18248 11791 284511081 21713 12132 194032334 25604 12933 860555243 25625 14477 931037844 26307 15849 832822995 29768 17539 732809979 33412 1898...
output:
391300183555469312 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #38:
score: 0
Accepted
time: 29ms
memory: 14828kb
input:
500000 0 121650118 1649 502 250988291 1651 4111 397530558 2269 6540 226383202 2520 7590 431645349 7235 7764 246758378 7463 8441 804903397 7972 10088 727145604 8704 10331 882121229 9295 11133 160059523 9961 14339 836705102 11183 14690 205009178 11933 15305 247872510 12270 15361 880110049 12545 16167 ...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #39:
score: 0
Accepted
time: 38ms
memory: 14856kb
input:
500000 0 31528 824 3124 60756 4067 4219 51695 4177 7296 108390 6720 8997 88562 8158 11041 34081 10567 12593 72852 14327 12877 84130 17355 14124 124651 21082 14423 79255 24262 16436 81596 24640 17372 134673 30353 19523 93100 31272 19610 127400 32468 20046 119508 33028 20424 129792 33648 20525 61887 3...
output:
407655124229284657 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #40:
score: 0
Accepted
time: 39ms
memory: 15024kb
input:
500000 0 1559096 2240 2568 290430 4145 3647 1190974 5517 4572 470362 5538 9036 805157 8565 12547 1164940 8860 15678 443493 10558 19474 1543885 16722 20916 1099317 21482 23257 1227298 25550 25396 1230015 31093 26804 964440 31236 26820 347048 34172 30636 468619 34448 32457 791301 42017 34310 1628030 4...
output:
957507507318588271 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #41:
score: 0
Accepted
time: 39ms
memory: 14908kb
input:
500000 0 519151874 660 268 453459690 2123 1230 551622234 4149 1523 539254 4586 2931 5513253 7094 3198 9974082 12984 3323 522780985 13936 3959 237149471 16417 3983 476868978 18627 4738 73549790 21082 5635 113288456 26278 6820 463594727 27746 8410 363870720 28582 9453 162992841 33450 9737 227054995 34...
output:
318764630420282221 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #42:
score: 0
Accepted
time: 24ms
memory: 14984kb
input:
500000 0 8472 1439 8472 3927 1688 12399 545 5062 12944 7099 6093 20043 165 11202 20208 4057 13740 24265 738 16059 25003 1722 16546 26725 90 17864 26815 2722 18422 29537 336 19557 29873 2131 21265 32004 592 23783 32596 586 25467 33182 2870 29520 36052 2702 33785 38754 671 37457 39425 990 37767 40415 ...
output:
562448295378387568 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #43:
score: 0
Accepted
time: 20ms
memory: 14980kb
input:
500000 0 860 5254 860 144 6494 1004 925 8758 1929 1759 14224 3688 2658 15216 6346 1591 18617 7937 3106 18791 11043 1832 21567 12875 1172 23310 14047 6016 28198 20063 1120 28320 21183 1335 32054 22518 631 32630 23149 1359 33325 24508 1824 34885 26332 1193 35334 27525 2430 38131 29955 1925 44106 31880...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #44:
score: 0
Accepted
time: 28ms
memory: 22976kb
input:
500000 0 1000000000 4313 2000 1000000000 5403 4000 1000000000 8011 6000 1000000000 9253 8000 1000000000 10468 10000 1000000000 14415 12000 1000000000 16495 14000 1000000000 16853 16000 1000000000 18629 18000 1000000000 18722 20000 1000000000 18908 22000 1000000000 19211 24000 1000000000 22377 26000 ...
output:
500506543021744000 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #45:
score: 0
Accepted
time: 22ms
memory: 14912kb
input:
500000 0 2490 56 2000 3447 3284 4000 3701 5578 6000 2974 6467 8000 3489 11802 10000 3828 14500 12000 2552 14691 14000 2686 14864 16000 3561 16403 18000 2789 17741 20000 3831 28966 22000 3285 29481 24000 2568 30345 26000 2624 30597 28000 2855 32162 30000 3385 38702 32000 2051 41860 34000 3930 43942 3...
output:
499887285174153021 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #46:
score: 0
Accepted
time: 20ms
memory: 14952kb
input:
500000 0 3301 767 2123 2085 1163 3801 2853 5085 5733 2704 5095 7438 2855 5486 9378 2370 5513 11102 3240 7356 13106 2704 7532 14946 3172 9297 16788 1808 10883 18592 3299 13501 20219 3172 13962 21962 3158 18815 23617 2367 18848 25243 2089 18999 26766 1992 19504 28588 2774 20613 30309 2262 22615 32267 ...
output:
497829837147032098 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #47:
score: 0
Accepted
time: 30ms
memory: 14976kb
input:
500000 0 39 1597 1 18 3417 2 11 4160 3 40 4380 4 41 6222 5 31 8451 6 24 9449 7 21 12958 8 16 13691 9 14 13698 10 10 14120 11 20 16712 12 24 18506 13 42 20528 14 45 21854 15 34 23080 16 26 25900 17 14 26514 18 39 30445 19 40 33372 20 12 35881 21 22 40788 22 23 42027 23 16 42780 24 49 47137 25 13 5034...
output:
249923787717815 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #48:
score: 0
Accepted
time: 27ms
memory: 14912kb
input:
500000 0 4241 2375 1 4545 3008 2 4142 5275 3 4523 5776 4 4261 5888 5 4072 6279 6 4877 6893 7 4222 8477 8 4148 8700 9 4360 10866 10 4684 12623 11 4012 13580 12 4521 23271 13 4222 26322 14 4242 27201 15 4847 30155 16 4896 35414 17 4361 36727 18 4707 38213 19 4131 41774 20 4073 44462 21 4018 45516 22 4...
output:
248170602496530 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #49:
score: 0
Accepted
time: 36ms
memory: 14852kb
input:
500000 0 452238 4270 1 415586 6105 2 416145 9772 3 433287 15787 4 428700 15846 5 454850 18737 6 422102 19173 7 421756 21325 8 448110 22372 9 407153 25430 10 426397 26698 11 491481 29281 12 457734 29410 13 487084 34788 14 425113 35126 15 485187 36934 16 497335 39750 17 436849 43201 18 496408 46962 19...
output:
118192516701133 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #50:
score: 0
Accepted
time: 32ms
memory: 14792kb
input:
500000 0 297574 765 1 195505 936 10 74711 7250 16 334037 8018 19 376054 11043 23 178144 16097 25 293842 16450 31 43913 16527 32 267740 16960 36 9362 17272 42 164075 18392 49 271488 23776 53 345914 32104 56 367775 34587 59 289135 36112 63 247493 37468 65 222958 38522 76 230383 39880 89 200663 41851 9...
output:
259973815352373006 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #51:
score: 0
Accepted
time: 14ms
memory: 14912kb
input:
500000 0 74263 3913 429 92160 6213 1324 38808 6545 1968 8323 7254 4333 95031 11157 8330 49264 11970 10437 95879 16202 12719 28803 18804 13123 72815 21535 16587 43021 26154 17001 29834 26845 18668 87442 29742 20279 81285 32637 21334 35594 33939 22455 69380 37216 22905 59683 42863 23303 29213 43785 24...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #52:
score: 0
Accepted
time: 11ms
memory: 14984kb
input:
500000 0 9554 2924 6 85019 5038 7 83791 5711 14 72775 5869 19 12354 7733 22 78792 13611 25 52401 15920 28 27110 16132 35 1480 17798 37 84625 18458 38 22201 32629 42 59227 34410 47 25143 34426 48 89433 35538 52 86778 36165 55 66213 39203 59 59294 39204 71 32415 39959 73 66115 41705 84 7367 44073 85 1...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #53:
score: 0
Accepted
time: 31ms
memory: 14984kb
input:
500000 0 718 1073 4 757 2191 8 802 4002 11 735 4644 16 498 7293 19 684 8478 23 519 9400 26 501 19769 31 652 22033 35 774 23974 39 626 25189 43 431 25231 48 647 25974 51 575 27886 55 501 29838 60 427 31502 63 447 32691 67 439 33759 71 582 37812 74 728 43492 79 562 43622 82 568 45031 86 452 45158 90 7...
output:
226973786448537014 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Subtask #4:
score: 0
Runtime Error
Test #54:
score: 15
Accepted
time: 0ms
memory: 3728kb
input:
3 0 5 3 2 6 2 8 4 1 4 2
output:
10 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #55:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
500 0 36 477870592 1 49 225118723 2 12 305549731 3 50 199782350 4 12 621067277 5 17 634339441 6 33 724737436 7 44 600042161 8 50 270266672 9 45 325722239 10 24 344756214 11 47 280078638 12 31 289312397 13 30 577859437 14 29 99532301 15 12 765519665 16 14 729669577 17 33 859013484 18 45 377019268 19 ...
output:
29696474768 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #56:
score: 0
Accepted
time: 0ms
memory: 4008kb
input:
500 0 44 435213639 1 30 653422811 2 14 397819976 3 25 81288885 4 14 534643415 5 40 727614621 6 34 232508110 7 29 937246678 8 26 809838502 9 19 671612396 10 23 440663685 11 34 636252166 12 40 408340232 13 45 295446844 14 34 78416008 15 29 349723822 16 28 862774834 17 49 221362227 18 21 21820877 19 27...
output:
29797101974 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #57:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
500 0 441 299704642 1 402 184439868 2 413 315891467 3 438 4619197 4 413 97959310 5 458 135031882 6 447 644631663 7 458 598160799 8 460 908409753 9 423 826605292 10 429 58028035 11 479 531135263 12 411 630775087 13 467 516908714 14 413 751942403 15 421 805587001 16 472 142636088 17 455 988715678 18 4...
output:
377531566 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #58:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
500 0 49 252307363 1 16 278103265 2 14 630031893 3 11 614159759 4 40 563438726 5 20 94098384 6 34 211148802 7 47 730449135 8 11 791553775 9 47 277724840 10 38 731011679 11 32 62086840 12 11 686611439 13 30 732517854 14 23 73773462 15 27 231282167 16 47 138084934 17 49 34456523 18 49 898618683 19 26 ...
output:
37131719443 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #59:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
500 0 26 899534796 1 17 658384741 2 19 822415707 3 35 565209089 4 22 616259168 5 37 904824814 6 50 713249368 7 16 79545272 8 41 540811818 9 37 279724341 10 41 232376586 11 15 654634186 12 15 819454345 13 37 880686491 14 26 402729190 15 33 540141763 16 21 733713365 17 23 885467459 18 43 474582634 19 ...
output:
56170995680 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #60:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
500 0 32 221856011 1 43 995858974 2 28 885445582 3 32 854188454 4 10 544904994 5 34 381493768 6 44 697261526 7 44 850936766 8 19 638726200 9 11 392155835 10 49 313607609 11 11 223198175 12 31 479208076 13 42 677192213 14 34 167573003 15 12 954946657 16 25 678955345 17 46 602170627 18 28 27989995 19 ...
output:
31176413476 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #61:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
3 0 4 6 3 2 5 5 6 3 1 5
output:
37 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #62:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
500 0 71 429651037 1 210 383157805 2 97 460639973 3 106 389018740 4 180 25973521 5 373 538897675 6 13 11985764 7 41 480153390 8 190 935155535 9 253 981210408 10 153 962360737 11 278 272348276 12 18 721952635 13 281 719028218 14 86 450661028 15 303 210214190 16 9 617009192 17 484 522228015 18 492 356...
output:
30448080639 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #63:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
500 0 428 500485592 8 100 197300250 15 364 108570405 26 380 588915252 37 397 49951707 47 330 292289816 49 28 448671433 56 294 955843868 59 332 582823449 70 45 182269427 76 79 954919975 87 139 126851350 92 301 15253544 109 93 996158484 112 47 519790654 120 80 505158751 123 81 126032837 128 192 279653...
output:
274501237781 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #64:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
500 0 431 745479530 431 284 850980730 715 213 235632174 928 65 971032611 993 433 569263662 1426 409 829062540 1835 264 964926070 2099 192 820602707 2291 295 903440082 2586 42 502842333 2628 191 784029969 2819 4 683354774 2823 162 629309040 2985 381 405080164 3366 403 530687 3769 135 175221360 3904 4...
output:
60139981187136 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #65:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
500 0 158 917152382 158 289 230796878 447 232 615674787 679 406 459941193 1085 429 176201473 1514 362 126087038 1876 452 610168273 2328 80 624298248 2408 358 326204004 2766 25 389398823 2791 254 988502886 3045 310 126397614 3355 32 929820592 3387 177 465824887 3564 43 741996373 3607 249 605671709 38...
output:
-1 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #66:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
500 0 500 132715729 500 500 94222202 1000 500 147360684 1500 500 261881649 2000 500 683235219 2500 500 198866036 3000 500 39238416 3500 500 998348130 4000 500 648721066 4500 500 505617606 5000 500 963233836 5500 500 487930771 6000 500 193062799 6500 500 257710331 7000 500 209618684 7500 500 21785938...
output:
120051724124500 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #67:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
500 0 414 271307969 34 90 645852394 64 458 579635487 109 41 963993829 139 106 285474598 180 112 527740248 228 150 944918995 264 430 276710575 314 425 747832721 347 316 807590178 394 364 929818023 440 421 255864635 485 54 43360954 525 79 508850682 570 304 701770689 605 80 990659862 646 413 11580470 6...
output:
4284484287502 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #68:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
500 0 201 328897141 180 188 673224188 336 291 76865482 502 219 993523720 662 347 600859857 905 251 303270063 1109 359 146159824 1337 349 593224336 1562 189 39518455 1738 295 699616646 1921 264 944996763 2145 400 357634747 2332 396 866874604 2553 395 110201654 2791 435 277532775 2996 272 602848825 32...
output:
41252368861546 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #69:
score: 0
Accepted
time: 0ms
memory: 4088kb
input:
500 0 16 930284288 1 36 952606202 2 36 907267913 3 29 317187438 4 30 990685573 5 15 274792113 6 39 537468898 7 11 936304508 8 31 530779161 9 44 422954416 10 12 328774816 11 39 173982106 12 38 7989018 13 42 365783446 14 28 608659786 15 34 72609336 16 36 763696081 17 44 954531194 18 45 693060480 19 27...
output:
24717625826 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #70:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
500 0 439 533543232 1 466 312807673 2 410 142716473 3 438 130877491 4 455 426357689 5 485 116553872 6 476 945338453 7 470 57298423 8 434 338783132 9 423 374996767 10 480 314474231 11 494 532623118 12 438 535985690 13 437 469234717 14 451 959312672 15 460 513908749 16 496 24410475 17 439 611070248 18...
output:
4814640656 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #71:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2 0 5 522836298 5 8 365727313 1 1
output:
2457072505 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #72:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
3 0 4 699212936 3 5 314612374 4 4 171789950 2 2
output:
1357405210 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #73:
score: 0
Accepted
time: 0ms
memory: 3996kb
input:
5 0 10 343976639 5 4 843538459 8 1 731022891 9 5 993586008 10 12 552904230 5 8
output:
6792726404 jP0CvdiJvC0xnBnhWA0Okzbk OK
result:
ok 3 lines
Test #74:
score: -15
Runtime Error
input:
7 0 1 24853831 1 3 342978906 3 5 50230379 5 2 196479721 6 7 283136311 13 5 124100992 15 8 704647351 1 3
output:
Unauthorized output
result:
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
0%