QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#234473 | #664. Triangle | PetroTarnavskyi# | AC ✓ | 14ms | 3836kb | C++17 | 1.2kb | 2023-11-01 17:36:30 | 2023-11-01 17:36:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout << fixed << setprecision(15);
int n;
cin >> n;
vector<LL> a(n);
for (LL& x : a)
cin >> x;
sort(ALL(a), greater());
if (n > 147)
{
a.resize(147);
n = 147;
}
LL ans = 0;
FOR(i1, 0, n)
{
FOR(j1, i1 + 1, min(n, i1 + 7))
FOR(k1, j1 + 1, min(n, i1 + 7))
{
if (a[j1] + a[k1] <= a[i1])
continue;
FOR(i2, i1 + 1, n)
{
if (i2 == j1 || i2 == k1)
continue;
FOR(j2, i2 + 1, min(n, i2 + 7))
FOR(k2, j2 + 1, min(n, i2 + 7))
{
if (j2 == j1 || j2 == k1 || k2 == j1 || k2 == k1 || a[j2] + a[k2] <= a[i2])
continue;
ans = max(ans, a[i1] + a[j1] + a[k1] + a[i2] + a[j2] + a[k2]);
}
}
}
}
cout << ans << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3404kb
input:
100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
6
result:
ok single line: '6'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3380kb
input:
100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1
output:
6
result:
ok single line: '6'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3444kb
input:
100 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
8
result:
ok single line: '8'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3376kb
input:
100 2 2 2 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 1 2 2 1 1 1 2 2 2 2 1 1 2 2 1 2 1 1 1 2 1 2 2 2 2 2 2 2 1 2 1 1 2 1 2 1 1 2 1 1 2 1 2 2 2 1 2 1 2 1 2 2 2 1 1 2 1 2 2 2 1 2 1 1 1 2 1 2 1 2 2 2 1 1 2 2 2 1 1 2 1 1
output:
12
result:
ok single line: '12'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
100 2 1 1 2 1 2 1 2 2 1 1 2 2 2 1 1 2 1 2 1 2 2 2 1 2 1 2 1 2 1 1 2 2 2 2 2 1 2 1 2 2 1 2 2 1 1 1 1 2 2 1 2 2 2 1 2 2 1 1 3 1 2 2 1 1 1 2 1 2 2 1 1 1 2 1 1 2 1 1 2 2 1 1 2 1 1 1 2 1 2 1 1 1 2 1 1 2 2 2 1
output:
13
result:
ok single line: '13'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3496kb
input:
100 2 1 2 1 1 1 2 1 1 2 2 1 1 1 1 2 1 1 1 2 2 2 1 2 1 2 1 1 3 1 2 2 2 2 1 2 1 2 2 1 1 2 2 2 1 2 2 2 2 1 1 2 2 1 2 1 1 2 1 2 2 1 2 3 2 1 1 2 1 1 1 2 1 1 2 1 2 2 2 1 1 2 1 2 1 2 2 1 1 1 1 2 2 1 1 2 1 1 2 2
output:
14
result:
ok single line: '14'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
100 1 1 1 1 2 1 1 2 3 2 2 2 2 1 2 1 2 2 2 1 1 2 1 2 2 3 1 1 1 1 1 1 1 1 2 3 2 2 1 1 1 2 1 2 1 2 2 2 1 2 1 2 2 2 1 1 2 1 2 2 2 1 1 1 2 2 1 2 1 2 2 1 2 1 2 1 2 1 2 2 1 1 1 1 2 2 1 1 1 2 1 2 2 2 1 2 2 1 1 1
output:
15
result:
ok single line: '15'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
100 43 88 72 16 18 60 86 25 73 62 42 27 83 5 97 56 33 95 69 15 17 24 50 78 100 77 2 93 9 98 66 52 35 67 32 3 37 6 55 57 22 71 30 23 45 94 40 61 38 80 53 49 44 36 82 54 7 11 34 92 79 70 59 65 4 19 1 12 13 99 46 26 28 85 10 47 51 84 20 91 89 96 29 87 75 74 90 41 31 76 58 8 68 21 39 48 14 81 64 63
output:
585
result:
ok single line: '585'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3460kb
input:
100 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000...
output:
6000000000000000
result:
ok single line: '6000000000000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
72 5 40549338 144801697634 22 992485600472 2680 613389834437 11006833975970 203760 65610207 533451 4987238892 48101 3656331 4337 55309326867 13 8 449699050 3 1024 57 277929297 1605875434910 2598361035382 379095766035 7017 234294068401 46625696939265 2259736 25060869 11355 171769752 21126282968 1 836...
output:
0
result:
ok single line: '0'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
76 1585411073324 28449047388867 124325 231308358283 3609737 510497441926296 1 6715909078885 74480573011612 29349 443968341 201163 54604496318 2646 526653 1635 1880680076 3043004285 147 979837929455 46031525622744 17582478233876 315504770280326 1162324208 21 2230940 18139 274387525 33747434663 4282 1...
output:
6
result:
ok single line: '6'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
74 274360 15289 6715243578 6 7965899 164362302080054 24739 28446228280 374227698 47 74473192489 33744090 4150248773 40028 265943791234706 64768 38800676229248 1 851 18 526 3042702 1336367216035 29 14820539533093 2 120500156698 1378 1162209 2230 62780812925403 9449 124 605513135 1585253969 2564994804...
output:
2126555977864232
result:
ok single line: '2126555977864232'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3456kb
input:
74 218072604127418 5506466789 1000 306864877 12537 2103283155 698 37741884849 953005 61067652485 4788 431 7510824737939 258686727155 134776281365944 44770982 3403183633 10568995 588990 1773065205240 14 32823 1 224974 1299900478 83296322761473 496517800 24 5 101 352848885493362 14416117212 1541995 15...
output:
3961
result:
ok single line: '3961'
Test #14:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
74 40226 105314 8005275 63091146220281 275716 2577673889 3627 165174765193885 7 376077552 74841322657 46254481165 24861 432433149361375 984583814 699691533528866 446118 9496 10919201818 2 1593090075 121095803822 47 33910891 1000 29 1889789 232428709 100 830002987084 3057743 54868975 856 529 4947532 ...
output:
5052
result:
ok single line: '5052'
Test #15:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
100 55512037798 28921878241564 2268019 1663 1027 17277313056 34308326143 122515042268241 3 7043 36372262149 21 52209500631 6827529301981 18440 320748544791384 1 615637933107 866306 38214780084 65850671 52180867698 88474888853 535406 149 21521902930 29836 1911937487 40697953 839730592105913 277256666...
output:
578132744825
result:
ok single line: '578132744825'
Test #16:
score: 0
Accepted
time: 2ms
memory: 3468kb
input:
100 642131309109367 697306106361135 110649648459755 808823032631671 10441467991195 347774914029329 833081181887635 457045950362894 769695680185870 15058385499813 613376191639211 759871281318629 928492827019533 878174772633942 564768490491581 360944099277939 105847895906973 918721132001792 9801054870...
output:
5886126984905962
result:
ok single line: '5886126984905962'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3456kb
input:
100 772978570617229 176661809488901 292421271020127 187218472378036 823465166867327 543640447293294 843006106734663 914401835690639 359082338704771 575189136322069 422818435179569 215061697745557 229097057181179 619133870579774 172192005071095 881661591461421 808585606168860 972677864692701 71323385...
output:
5884342740221791
result:
ok single line: '5884342740221791'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3500kb
input:
100 132827958064519 776491900067004 667094278608039 238260018616825 393605701593180 215408777035444 578714254258925 218699047383046 257023701301811 995778374333875 359635401180374 751433988726420 627265207530349 127383977024847 69538364233441 776804590101838 865426244898066 79589276394177 4739327310...
output:
5830336287511664
result:
ok single line: '5830336287511664'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
100 273751252846365 742499599289872 80453084028300 664945224738646 837009452304114 616513481410018 917840839200937 169339866167099 948132807182105 490278969872982 489217437376726 854304907817327 921153467042389 24720367276614 953083105409732 269187252993502 543907494299943 261582762857051 1971008625...
output:
5875369114292445
result:
ok single line: '5875369114292445'
Test #20:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
100 258649676493411 741690309529711 486090333911840 190015800315553 37446225989125 828228116408086 199940013192408 990827440584982 223734853329551 901764338887238 919912620340421 110649474294650 466555578181688 888805015505252 149628318104588 230115228834059 846394399535610 822854486347574 638566253...
output:
5685738539478299
result:
ok single line: '5685738539478299'
Test #21:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
100 4 2 1 2 8 2 2 1 7 4 2 4 6 2 4 2 2 2 2 2 2 2 4 1 2 2 2 1 1 4 1 2 5 1 4 1 1 1 3 4 1 8 3 1 1 1 4 4 7 5 1 2 5 2 1 3 1 2 1 1 1 4 4 3 1 4 1 1 2 4 2 1 2 3 4 2 4 8 8 7 4 1 3 4 3 2 4 2 3 6 4 2 7 7 2 4 4 3 6 1
output:
46
result:
ok single line: '46'
Test #22:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
100 533939861 2224631 231117 698582 8 64548174 2 37 13792048 256763665 3613 929565 987681 7466 840 1222954190 498 68 36384009 1621610171 56 18164 224 111236 7714525168 394924 3153431 698443635 593 136406 315673 4553 7848713 1596 4325 48310 8228649428 350996296 619 236 103696488 56 38628187 3 484 174...
output:
119478427015
result:
ok single line: '119478427015'
Test #23:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
100 448344 813 78 21148053 2023604969 3481 15 4175891973 2800 35034 14 248175 151676 539116 5884367759 45225379 39 70201 79669191 461503772 3520146115 43 40 116468 4413 1 181861040 3416245 121 1 6706988357 237377271 82026 955898 3094 1 1807936 6347560124 6 1 1385571 41 95858487 2723386 29208657 6 14...
output:
35821402743
result:
ok single line: '35821402743'
Test #24:
score: 0
Accepted
time: 1ms
memory: 3384kb
input:
100 25448717 323160223 1082103598300 252434508195 33584 1952 1826642399589 702440260 84592 117111 11103515 2 6 8433383148 309 134984 260960970 7000 2224 2545 2737095614226 227621858 1 115079 49342726 1676466 82885970 55094 1305910240 24332812 814059242235 6969216876205 1724219 5 2 786 2 133235040569...
output:
29596863402799
result:
ok single line: '29596863402799'
Test #25:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
100 242 16 10674 3 20 9219 381023468 111946 1249 5893947 344 67 115 6844514 38932090 433 221187004 107 648 409506321 1 190 3 3556514 511 7762 5371375 981 7 13400594 97 129119357 932410555 151622 368998627 54956 128874 13 469556859 7 18834180 233895 28945 28353827 138619 30422 69980 39 6757093 375440...
output:
2128999094
result:
ok single line: '2128999094'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
59 108878108 5047 43708943726799 13750 71602634199233 2 1375050456 29593693677 5 9 4950604990 19446574 302225790051299 6828 3 2285942459807 115311577926033 444933 3 759825763331 15 489140002176565 43621 1837630947 12078437218068 2 406294 1 1794918119 1015 20304388 15815253254365 113681200 2211990260...
output:
8778031126
result:
ok single line: '8778031126'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
97 23 1 8 722529 5696020237429 196 14 1169537 19 1 46312168975 2 1 12 831038152842 11 67455 376546590 1595076950 275520 14912374582197 608 447008 26 1892067 23 10932820063 1069 317428328437 43 4 74934663495 267591704326711 171487 396 4953673 165380768381420 1571 609265180 17689674456 837 16 7542 921...
output:
68014
result:
ok single line: '68014'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
56 23641655018392 1909138557 4 113732107668 160408 446391 14 728897700994 1 10751315765764 40397286 316230278201140 78792 19701 15655 25109422424562 1710 7666404518 11127 76774786973622 462542 89997 33821828333486 416368909 119727745613758 21 943 19580732 196502532587381 828963088989662 175848 33729...
output:
138151941499709
result:
ok single line: '138151941499709'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3388kb
input:
82 66730 37941583810013 11044435 10390 61390772191454 23449188381441 587822510 127221 499144958730 795265 41320 101201 148 81040 34825 1 2121 14819547 27391626 200206 3421190477167 27816304279 13751 72824233946 214949228 19 4057732398 157924054 241762 4366624 45007929666 372873282 240462 2203187 400...
output:
190459677
result:
ok single line: '190459677'
Test #30:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
95 1 520148496494 998361965 167486200487640 381340354 21251726 16310 1977 2643 13758 5820 245 3 154 438484565523220 4228 122056 124 75888642896 2823 13046 145659098 39538128608241 617021610 63 1912267 106 3565150832564 469168 270998365035580 539 4 46 198679046463 216786 321469450030 21 337 27837 556...
output:
822770
result:
ok single line: '822770'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
77 29248290855 1373595485348 11193357700 19679 5568933 583357 186 123854738876 29390381 2 13 715645777659613 18054933154 6861575454 3460 39881572299108 200406253743 2222523724332 24648167221401 15881219 7 77327335 3596119209681 1799102 3245161 848928238984 12111729 32 1 7 727804172 5863 107214792 61...
output:
424528951
result:
ok single line: '424528951'
Test #32:
score: 0
Accepted
time: 1ms
memory: 3404kb
input:
83 29484 106 7061214 107 5644 306627026767168 1636366 117121102355732 54 18 363733638790 430732972 1243 53068016796 1 1245261 20270165194 32 11 4034 48358 224799753594 267868768 189505924411435 5391351 138933885195 361007 698601740 116376 32797851602 952267031175 1 25540 4 1129334713 346 57859640 44...
output:
24943237
result:
ok single line: '24943237'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
90 2 615 62297 138757090 3 652 6 2099103926375 6519018991 32 142645 44682022069 203 10547994695 33795 2 2 1 1386349 2455821 5020081 98613202517555 342 1 1 417732229343318 5495525425169 23279419273096 124269 37666891622229 3396421498794 801786353955 2096 1 495531218463 675904945273756 58054 12604423 ...
output:
10513491
result:
ok single line: '10513491'
Test #34:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
67 4 3173 2990344 210 1747 17545617637 1950568479 26 2 7 14160506 7970092 7784 593740 60861958721294 8880144176145 28 6 239873766 13485829761 504086639214 290877233295 3703 23247367632480 2319 247525 28 471134 159338508531402 333068 7007599599 794963872509 1482857100 104 58416649 1537 1299050511723 ...
output:
282492823610
result:
ok single line: '282492823610'
Test #35:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
65 570456 1070879140 473913 251816210999917 107277 45398112 293 296912741 767626366635 40913 33 32 1 96185133551125 4 302256 407447288448709 3030870 5358116574298 31609445 1274287947009 3316202260654 659263499448626 239 14160728435 2 46980 67600415742 8674318834953 6515519 10513361812 3 594459438976...
output:
166436970966
result:
ok single line: '166436970966'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3404kb
input:
63 893220 22951080284 113608 1895190929467 890 540056320834586 70 11 47305724 78084106 3246195427 6265500 1980660 1724 31050 873827969191174 48689279279182 4474248763578 30108417320224 2223459418 78797696599407 5 11360886 2177 7053306597689 226200 11527555361267 2772 1145331689 18 662107938742 54833...
output:
2532128717002
result:
ok single line: '2532128717002'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3392kb
input:
66 9443872362053 1026482 21 13 4637615 17 24 3174 39051868 1546963 2222470468993 330148 1537598 453418436 15277043777576 3610700946529 32827 2 553990486079 32343634502 5833171415523 101 7822999138 148368686 119888138255 296 834239991456 3812861 717740808040745 5966158980 1 245055253 111770173 326812...
output:
822461221579
result:
ok single line: '822461221579'
Test #38:
score: 0
Accepted
time: 8ms
memory: 3752kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
6
result:
ok single line: '6'
Test #39:
score: 0
Accepted
time: 3ms
memory: 3760kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
6
result:
ok single line: '6'
Test #40:
score: 0
Accepted
time: 7ms
memory: 3728kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
8
result:
ok single line: '8'
Test #41:
score: 0
Accepted
time: 8ms
memory: 3832kb
input:
100000 2 1 1 1 1 1 1 2 1 2 2 2 1 2 1 1 1 1 2 2 2 2 2 2 1 2 1 1 1 1 1 2 2 2 1 2 1 1 1 1 1 2 1 1 2 1 1 1 2 1 2 1 2 2 1 1 1 2 1 1 1 1 1 2 2 1 2 1 1 2 2 1 2 2 2 1 2 2 2 2 2 2 1 2 1 2 2 1 1 2 2 2 2 1 2 2 2 2 1 2 2 2 2 1 2 2 2 2 1 1 2 2 1 1 1 2 1 1 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 1 2 1 1 1 2 1 1 1 1 1 2 1 1...
output:
12
result:
ok single line: '12'
Test #42:
score: 0
Accepted
time: 8ms
memory: 3780kb
input:
100000 2 2 2 2 1 2 2 1 1 1 1 1 2 2 1 2 1 1 1 2 2 2 2 1 1 1 1 2 2 1 1 2 1 1 2 2 1 1 2 1 1 1 1 2 2 1 2 2 2 2 2 2 1 1 1 2 2 2 1 2 1 1 1 2 2 1 2 2 2 2 2 1 1 2 1 2 2 1 2 2 1 2 1 2 2 2 2 2 2 2 2 1 2 1 2 2 2 1 2 2 2 1 1 1 2 2 2 1 1 2 1 1 1 1 2 1 2 2 1 2 1 1 1 2 1 2 1 2 2 1 1 1 2 1 2 1 1 1 1 2 2 1 1 1 2 2 1...
output:
13
result:
ok single line: '13'
Test #43:
score: 0
Accepted
time: 8ms
memory: 3760kb
input:
100000 1 2 1 2 2 1 1 2 1 1 1 1 1 2 1 2 2 1 2 2 1 2 2 2 2 1 1 2 2 2 2 1 2 2 2 2 2 1 2 1 1 1 1 1 2 2 2 1 1 1 2 2 2 2 2 1 1 1 2 1 1 1 1 2 1 2 2 2 2 1 1 2 1 1 1 1 2 1 2 2 1 2 1 1 1 2 2 2 2 2 1 1 1 2 2 2 1 2 2 1 2 1 1 2 2 2 1 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 1 2 1 2 2 1 1 1 2 2 2 1 1 1 1 2 1 1 1 2 2 2 2 2 2...
output:
14
result:
ok single line: '14'
Test #44:
score: 0
Accepted
time: 8ms
memory: 3808kb
input:
100000 2 2 1 2 2 1 2 1 1 2 2 2 1 1 2 1 1 2 2 2 2 1 2 2 2 2 2 1 1 2 1 1 2 1 2 1 1 2 1 1 2 1 2 2 2 1 1 2 2 2 1 1 2 1 2 2 2 1 2 2 1 2 1 2 2 1 2 2 2 2 2 1 2 1 1 1 2 2 1 2 2 2 2 1 1 1 1 2 1 2 1 1 1 2 2 2 1 1 2 2 1 2 2 2 2 2 1 2 1 2 2 1 1 1 1 1 2 2 1 1 2 1 2 2 1 2 1 1 1 1 1 2 1 1 1 1 2 1 1 1 2 1 1 1 1 2 2...
output:
15
result:
ok single line: '15'
Test #45:
score: 0
Accepted
time: 10ms
memory: 3824kb
input:
100000 84178 1339 62768 30707 60619 20343 17145 45912 71297 17747 86700 5795 37736 53512 88844 34535 85747 48051 34085 16643 50591 15685 97927 94193 73352 98651 2022 69962 24381 42574 73039 38483 96715 36404 51840 92487 43360 28497 52964 4201 16948 17970 73903 50480 68636 57037 1905 54758 99884 4846...
output:
599985
result:
ok single line: '599985'
Test #46:
score: 0
Accepted
time: 12ms
memory: 3772kb
input:
100000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000000000000000 1000...
output:
6000000000000000
result:
ok single line: '6000000000000000'
Test #47:
score: 0
Accepted
time: 2ms
memory: 3800kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
6
result:
ok single line: '6'
Test #48:
score: 0
Accepted
time: 2ms
memory: 3748kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
2402439276694664
result:
ok single line: '2402439276694664'
Test #49:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
4696
result:
ok single line: '4696'
Test #50:
score: 0
Accepted
time: 8ms
memory: 3748kb
input:
100000 20 81 14 37 30 15 22 56 62 8 72 91 27 65 12 14 40 75 68 71 71 21 92 70 66 41 79 2 61 6 7 41 89 65 45 74 21 40 51 77 29 47 16 69 32 94 73 14 50 31 40 97 5 4 23 93 11 31 19 44 39 82 32 48 81 22 28 74 32 38 38 69 12 5 71 56 13 39 94 76 100 31 1 20 49 1 47 30 8 35 8 46 35 29 3 97 18 23 68 50 37 6...
output:
704
result:
ok single line: '704'
Test #51:
score: 0
Accepted
time: 8ms
memory: 3728kb
input:
100000 492576 507495 157180 206160 743456 585435 737418 777596 606975 856367 946408 725596 463617 489253 771316 618327 700965 35169 816471 2429 497241 217714 231099 410914 842256 979671 352837 545596 378188 903711 221451 896718 965636 206240 271232 901159 480339 663183 476866 574027 375299 112522 23...
output:
7569033
result:
ok single line: '7569033'
Test #52:
score: 0
Accepted
time: 8ms
memory: 3832kb
input:
100000 9 20 21 32 80 31 43 85 61 79 34 11 97 64 91 21 81 56 63 44 79 89 34 2 52 78 30 5 68 22 68 42 42 8 77 50 56 8 67 90 15 3 4 68 54 5 66 40 47 18 41 33 66 98 13 93 36 69 15 40 68 66 71 70 22 74 95 87 40 9 46 29 64 71 49 9 77 69 29 63 35 62 49 3 28 33 77 9 72 62 29 13 96 31 42 76 65 97 2 48 42 35 ...
output:
2449250252635285
result:
ok single line: '2449250252635285'
Test #53:
score: 0
Accepted
time: 13ms
memory: 3764kb
input:
100000 18617 874239 553533 384501 73901 785822 52745 294005 41185 584783 889668 470932 387015 120742 971901 277563 281854 91685 136787 700539 215690 642074 363539 398178 545542 958051 529205 40075 31387 246244 988159 169742 305548 344642 903146 185122 438407 229672 101260 588184 295550 170945 485402...
output:
2571811129723279
result:
ok single line: '2571811129723279'
Test #54:
score: 0
Accepted
time: 5ms
memory: 3744kb
input:
100000 54 57 24 28 59 27 13 8 57 31 14 63 3 59 87 59 94 2 88 93 78 81 27 63 90 94 40 69 43 83 27 5 50 96 14 92 99 68 93 96 18 20 74 83 72 55 5 48 99 77 66 76 3 55 23 40 84 35 37 90 34 97 59 77 76 94 14 23 41 86 15 14 62 86 85 43 94 46 20 83 65 67 33 43 85 18 83 61 83 85 76 92 48 40 82 18 100 74 78 5...
output:
4243
result:
ok single line: '4243'
Test #55:
score: 0
Accepted
time: 13ms
memory: 3776kb
input:
100000 240569 607122 904065 971930 745432 150134 312939 967650 391167 807557 117426 14595 345753 874086 984290 224526 714916 638003 301329 84151 922334 113662 523943 738479 385356 478453 229567 521245 358509 124716 303179 719389 345189 8817 944620 401244 723161 366470 628058 293067 962177 923313 626...
output:
41757405
result:
ok single line: '41757405'
Test #56:
score: 0
Accepted
time: 14ms
memory: 3496kb
input:
76418 686222363251237 28582078163064 188173596104244 607876358847528 259417564838448 109632895005435 968775621816727 377396187621691 612000490754560 795917579875754 611335672290164 982411196962860 969866701815705 458270286998010 158682053813498 566186469410277 488331769848896 729668452553483 4395370...
output:
5999582795205174
result:
ok single line: '5999582795205174'
Test #57:
score: 0
Accepted
time: 5ms
memory: 3416kb
input:
34254 326832731597309 716408607655679 218095140180701 250630574860151 888870744156809 309306914402370 67235600179377 309212923028937 549492778867680 800508862050766 395756142526226 709060419840850 575213955328748 191438657923737 929574098765200 838654219032404 674174169616440 972420144243392 1626908...
output:
5999292960837937
result:
ok single line: '5999292960837937'
Test #58:
score: 0
Accepted
time: 7ms
memory: 3448kb
input:
27959 394601350958304 832731133209023 821536880492420 578282750536876 244468657737881 341624071679642 139045573461235 281861789019859 803921086695517 764368941420123 816565657656907 662929795932391 804665749019746 278679907563561 515886612838331 917243207487583 387323370155171 194818566355023 775224...
output:
5998661124140632
result:
ok single line: '5998661124140632'
Test #59:
score: 0
Accepted
time: 8ms
memory: 3444kb
input:
40402 15 979 51016 8733 346 70031 32 1597 614 999777 289 35 137 1343731 2 52401 591 226822 1 10 11 1200 29970 2 1 52526 4746 4 35 62001 319 3914 59108 23 26787 2264 2664 9473 3977 13660359 5 121990 9 12170 2 15700 866 10 32732 788383 19 20 765429 3 12 91875 16557574 57338 11 111 519 47 2 2 24 19832 ...
output:
100438137
result:
ok single line: '100438137'
Test #60:
score: 0
Accepted
time: 12ms
memory: 3788kb
input:
90428 2006 149 1 3 3069 93 4632 154 299429 236 1417 1761 1 25529 15 299 4 224 3 400 1 9356 328 501220 210 185749 68214 212 1 28 24 7 613 293 14035 14716 7 2 497 12460 210 8 75412 188507 127059 2658 29040 292 27445 2286 9356 9534 2 434 1909 11 7 2 2724 384725 57745 55615 87 52419 41473 9889 842 62372...
output:
3143618
result:
ok single line: '3143618'
Test #61:
score: 0
Accepted
time: 12ms
memory: 3520kb
input:
75242 13819 3 28 27582707355 260679360414 5808709 3036 6 1446 5 222924 9745955146300 309278431021 5483912 11348 14155 124 14704 118 377646958 12770582239008 7 1531774 2602553 17 71425796933373 139259050045300 29431959 1929978952 75195 33797221440 62529 1104 371 1816430 2062761917 6047285639 51821227...
output:
843225905472206
result:
ok single line: '843225905472206'
Test #62:
score: 0
Accepted
time: 10ms
memory: 3780kb
input:
100000 2197465 1284468 4883104 4796178 4856925 211447 1194161 951703 557386 4452141 3499649 4424044 2729124 2433072 4488789 1123755 5015626 5294904 2819543 5006320 4289711 186590 5204433 1954299 872177 1058866 2868402 4205469 4579321 4742201 5040492 340763 458920 5045395 450229 1444625 142489 222626...
output:
67330024622
result:
ok single line: '67330024622'
Test #63:
score: 0
Accepted
time: 14ms
memory: 3756kb
input:
100000 8768854 9862142 4070086 16158893 32855907 28900494 30884042 4908897 30686888 5811949 6258797 19757976 3061346 2553908 13575800 6213247 7674838 8638525 7686738 20043459 14312076 11865586 24392976 24423223 2057225 29020729 4341962 11537612 9443242 19424379 1615904 31059256 13265523 23007421 169...
output:
8747491882400
result:
ok single line: '8747491882400'
Test #64:
score: 0
Accepted
time: 13ms
memory: 3760kb
input:
100000 78608 39437 132463 108838 250503 46164 46054 168987 79631 218573 61872 144905 87611 220255 130826 60040 123983 162942 219256 181859 121198 71514 40411 219842 89105 104759 164310 58719 244837 65926 70360 60894 101895 20536 266688 140176 151595 245738 246824 150619 218751 44428 196810 90481 212...
output:
88606271895
result:
ok single line: '88606271895'
Test #65:
score: 0
Accepted
time: 12ms
memory: 3828kb
input:
100000 19333 3741 4347 459 13324 18532 21956 22789 17975 20396 15261 20336 17587 4613 23102 21223 4184 19454 9828 18948 5705 12119 21908 14927 13707 16956 22938 23242 20399 1259 1304 2861 12221 7860 8557 19392 4241 20841 10295 17693 12646 22137 908 6910 7964 7999 3313 7771 17689 23677 6993 12081 957...
output:
164143105
result:
ok single line: '164143105'
Test #66:
score: 0
Accepted
time: 8ms
memory: 3824kb
input:
100000 38031 4655 40181 16156 32126 4114 52594 17526 13588 41876 28741 1976 36118 19033 34373 22814 16451 17620 47615 52122 40644 52218 34197 33784 28128 50823 2532 37017 42888 25653 23954 23219 29251 35245 24284 20471 50782 36432 7401 16030 27020 16119 39476 18478 993 13502 808475160260 42250 4892 ...
output:
1697935434
result:
ok single line: '1697935434'
Test #67:
score: 0
Accepted
time: 13ms
memory: 3800kb
input:
100000 139545 82165 237897 218486 94172 215801 74225 27914 176909 148405 143641 169923 262511 122377 63679 23381 229899 265780 45593 155795 237136 150305 28773 141777 206966 105469 16171 57320 269080 174525 193662 136348 16485 217811 238392 26543 201198 81891 98098 171881 135011 3084 111893 179862 2...
output:
770344606
result:
ok single line: '770344606'
Test #68:
score: 0
Accepted
time: 13ms
memory: 3780kb
input:
100000 197063 452244 422470 135025 45857 486172 393488 574530 649136 212063 679175 631753 323439 341180 224196 449230 208989 135560 632799 356501 456522 593394 32897 693032 464628 590195 29127 692416 260218 581547 375607 72148 407328 679425 178714 656730 624313 704124 327643 618099 593218 699896 144...
output:
5256936080
result:
ok single line: '5256936080'
Test #69:
score: 0
Accepted
time: 13ms
memory: 3832kb
input:
100000 721585 870221 802355 2989960 86534 696795 1647218 2304431 2872567 1246809 2247082 2236134 1590450 775490 1706430 1664317 204324 2673534 1042034 796578 616245 429738 881894 172435 195490 351837 740059 2141818 385963 329178 91205 2821360 1205779 370634 2028598 1309807 673031 891996 1698901 2062...
output:
23465959403
result:
ok single line: '23465959403'
Test #70:
score: 0
Accepted
time: 13ms
memory: 3760kb
input:
100000 136181 146287 45045 32949 146661 85403 81997 127698 139905 109407 7339 29480 53758 107039 52755 108012 41454 97882 119860 35901 48460 136399 26098 92203 69021 123922 128133 16579 2069 43638 25646 99521 84306 54905 83839 61752 50273 85893 66117 42791 103860 118190 44290 91881 14397 136845 2632...
output:
188817643
result:
ok single line: '188817643'
Test #71:
score: 0
Accepted
time: 14ms
memory: 3768kb
input:
100000 274636624 85254712 42070779 286046712 162155860 286062359 179354465 241649208 283829307 2913041 46003783 94184796 323073671 265708895 21061098 26861766 379525057 196937978 169833413 11645062 16475593 121104738 52759372 174346497 389297198 209560452 306810452 243235764 146516554 335745631 1674...
output:
22915182368560
result:
ok single line: '22915182368560'
Test #72:
score: 0
Accepted
time: 9ms
memory: 3836kb
input:
100000 110 139 56 78 165 8 167 111 47 135 96 176 147 89 13 130 117 72 8 93 94 91 33 167 193 182 124 76 182 26 167 130 87 39 150 109 46 18 71 109 112 30 153 7 119 48 73 197 194 139 184 189 12 125 151 123 110 23 89 175 87 56 177 24 60 65 11 172 214 180 197 171 67 143 141 181 156 146 32 47 10 210 60 83...
output:
100537
result:
ok single line: '100537'
Test #73:
score: 0
Accepted
time: 11ms
memory: 3784kb
input:
100000 3367 1291 2238 4128 7889 5763 3997 7022 5443 2094 4577 2198 2041 65 7415 4171 6199 4088 1431 1336 7198 328 5590 4976 1635 1750 1873 3808 693 4644 33 5519 1541 3668 3977 7353 1601 7143 2490 5094 8188 2601 4837 5537 7351 6743 1901 3166 8065 7927 94 2910 8211 6252 4520 699 789 5069 5969 659 6778...
output:
94194698
result:
ok single line: '94194698'