QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#65702 | #4835. Mode | YaoBIG | TL | 2714ms | 18876kb | C++17 | 3.4kb | 2022-12-03 01:26:54 | 2022-12-03 01:26:57 |
Judging History
answer
#include "bits/stdc++.h"
#define rep(i, a, n) for (auto i = a; i <= (n); ++i)
#define revrep(i, a, n) for (auto i = n; i >= (a); --i)
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a).size()
template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
using namespace std;
template<class A, class B> string to_string(const pair<A, B> &p);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string) s); }
string to_string(char c) { return "'" + string(1, c) + "'"; }
string to_string(bool x) { return x ? "true" : "false"; }
template<class A> string to_string(const A &v) {
bool first = 1;
string res = "{";
for (const auto &x: v) {
if (!first) res += ", ";
first = 0;
res += to_string(x);
}
res += "}";
return res;
}
template<class A, class B> string to_string(const pair<A, B> &p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug_out() { cerr << endl; }
template<class H, class... T> void debug_out(const H& h, const T&... t) {
cerr << " " << to_string(h);
debug_out(t...);
}
#ifndef ONLINE_JUDGE
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) if(0) puts("No effect.")
#endif
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int cas; cin >> cas; while (cas--) {
int n; cin >> n;
vi as(n);
for (auto &x: as) cin >> x;
vi nums = as;
sort(all(nums)); nums.erase(unique(all(nums)), nums.end());
for (auto &x: as) x = lower_bound(all(nums), x) - nums.begin();
int tot = sz(nums);
vi cnt(tot);
for (auto x: as) cnt[x]++;
vi ans = cnt;
int thr = sqrt(n) + 0.5;
rep(occ, 1, thr) {
vi ocnt = cnt, icnt(tot);
vi times(n + 1);
times[0] = tot;
int mx = 0;
auto add = [&](int x) {
times[icnt[x]]--;
icnt[x]++;
ocnt[x]--;
times[icnt[x]]++;
chmax(mx, icnt[x]);
};
auto remove = [&](int x) {
times[icnt[x]]--;
icnt[x]--;
ocnt[x]++;
times[icnt[x]]++;
if (times[mx] == 0) mx--;
};
int ptr = 0;
auto seq_add = [&]() {
while (ptr < n && mx != occ) {
add(as[ptr]);
ptr++;
}
};
seq_add();
if (mx != occ) break;
rep(i, 0, tot - 1) chmax(ans[i], ocnt[i] + occ);
rep(i, 0, n - 1) {
int x = as[i];
remove(x);
seq_add();
if (mx != occ) break;
chmax(ans[x], ocnt[x] + occ);
}
}
static vi pls[200000];
rep(i, 0, tot - 1) pls[i].clear();
rep(i, 0, n - 1) {
int x = as[i];
pls[x].push_back(i);
}
rep(x, 0, tot - 1) if (sz(pls[x]) > thr) {
vi pres(n + 1);
for (auto p: pls[x]) pres[p + 1] = 1;
rep(i, 0, sz(pres) - 2) pres[i + 1] += pres[i];
rep(y, 0, tot - 1) if (y != x) {
int mnpre = 0;
int mx = 0;
rep(ind, 0, sz(pls[y]) - 1) {
int p = pls[y][ind];
int cur = pres[p] - ind;
chmax(mx, cur - mnpre + sz(pls[y]));
chmin(mnpre, pres[p + 1] - (ind + 1));
}
chmax(ans[y], mx);
}
}
int maxans = *max_element(all(ans));
printf("%d\n", maxans);
rep(i, 0, sz(ans) - 1) {
int val = nums[i];
if (ans[i] == maxans) printf("%d\n", val);
}
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 4ms
memory: 8200kb
input:
4 5 1 2 3 2 1 5 1 1 3 1 1 6 2 4 2 4 8 8 5 1 2 3 4 5
output:
4 1 5 1 4 2 4 8 2 1 2 3 4 5
result:
ok 14 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 8228kb
input:
10 300 336470888 634074578 642802746 167959139 642802746 481199252 481199252 481199252 167959139 634074578 634074578 336470888 336470888 481199252 642802746 481199252 481199252 167959139 642802746 634074578 167959139 336470888 634074578 642802746 167959139 481199252 167959139 167959139 167959139 481...
output:
80 481199252 634074578 46 153774342 39 846318354 30 937534594 27 698063951 27 419330425 20 603780410 706588687 801036056 20 541308492 19 352404708 16 187061768 428773075
result:
ok 24 numbers
Test #3:
score: 0
Accepted
time: 4ms
memory: 8404kb
input:
10 300 641009859 804928248 804928248 804928248 804928248 641009859 476927808 641009859 641009859 641009859 75475634 804928248 804928248 641009859 804928248 54748096 75475634 75475634 54748096 75475634 54748096 54748096 476927808 476927808 75475634 476927808 641009859 75475634 476927808 476927808 754...
output:
84 75475634 47 173884819 253838924 593535580 37 119584259 29 66715052 671541499 706982083 25 683509776 23 145885283 637691905 26 968506132 18 277852473 891198181 954696748 18 967045702 19 493331319
result:
ok 27 numbers
Test #4:
score: 0
Accepted
time: 4ms
memory: 8112kb
input:
10 300 923264237 524125987 524125987 524125987 923264237 751244358 374288891 923264237 923264237 923264237 535590429 524125987 374288891 751244358 524125987 923264237 751244358 751244358 923264237 751244358 535590429 535590429 751244358 923264237 751244358 524125987 751244358 923264237 524125987 923...
output:
85 524125987 50 475906689 38 802613215 28 824887911 28 506836893 754648411 23 708438632 731263599 20 210467639 284624362 746100908 806519500 980100704 21 797383894 21 156438550 977566828 17 111777754
result:
ok 27 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 8208kb
input:
10 300 702209411 496813081 561219907 702209411 702209411 561219907 730593611 496813081 702209411 561219907 673102149 702209411 496813081 702209411 673102149 496813081 730593611 496813081 673102149 702209411 673102149 673102149 496813081 496813081 702209411 673102149 561219907 702209411 561219907 561...
output:
81 496813081 53 675266630 38 767363622 32 404396525 27 118275344 195136790 21 422498140 522949042 869477976 887728896 998214353 22 611458649 20 298642883 618165181 853396846 18 510545542 18 41119063 42804963 383659701
result:
ok 29 numbers
Test #6:
score: 0
Accepted
time: 2690ms
memory: 12072kb
input:
6 200000 564718673 564718673 291882089 291882089 412106895 291882089 291882089 412106895 564718673 564718673 412106895 412106895 412106895 564718673 291882089 564718673 412106895 291882089 564718673 291882089 564718673 291882089 291882089 564718673 291882089 412106895 564718673 291882089 564718673 5...
output:
72021 564718673 40464 764450551 14267 485362070 14627 904735088 4168 647351267 2097 876938652
result:
ok 12 numbers
Test #7:
score: 0
Accepted
time: 2659ms
memory: 11676kb
input:
6 200000 757703054 544067926 5887448 544067926 757703054 757703054 544067926 757703054 544067926 544067926 643910770 544067926 5887448 544067926 757703054 544067926 5887448 544067926 5887448 643910770 5887448 757703054 544067926 544067926 544067926 544067926 544067926 544067926 757703054 757703054 5...
output:
72009 544067926 40553 532894160 14507 280401558 14661 652613244 4149 954112179 2118 387281831
result:
ok 12 numbers
Test #8:
score: 0
Accepted
time: 2714ms
memory: 11704kb
input:
6 200000 941492387 378192988 783332532 378192988 378192988 72235422 378192988 378192988 378192988 783332532 783332532 783332532 378192988 378192988 783332532 378192988 783332532 72235422 378192988 449924898 378192988 783332532 941492387 449924898 72235422 72235422 72235422 378192988 378192988 378192...
output:
72125 378192988 40566 204258647 14420 679764421 14458 621315231 4176 283127255 2125 379004468
result:
ok 12 numbers
Test #9:
score: 0
Accepted
time: 2568ms
memory: 11808kb
input:
6 200000 652509537 513994713 513994713 513994713 940751563 652509537 652509537 43705451 513994713 652509537 43705451 513994713 513994713 652509537 652509537 43705451 513994713 940751563 513994713 652509537 43705451 940751563 43705451 43705451 652509537 513994713 513994713 652509537 513994713 5139947...
output:
72040 652509537 40565 33034714 14364 848061415 14689 972643361 4192 106061785 2110 861238489
result:
ok 12 numbers
Test #10:
score: 0
Accepted
time: 158ms
memory: 10092kb
input:
9 50000 264178469 144383292 725622388 29492121 605488152 580675905 55883389 390555088 441004197 831609975 438791943 987615719 859267729 743196568 55883389 39388076 959436397 876153780 45621610 363531956 977960026 782710197 106874917 807199457 562810007 715666999 743196568 538628510 824046493 1893675...
output:
432 752268030 91 254698774 3 12093 60583 90748 127514 236374 353911 368891 378263 400779 470972 478812 494946 510827 581713 599252 615790 629984 637246 701304 786939 829043 829312 845188 889918 916550 959344 965105 1017725 1049787 1062654 1070749 1080286 1081671 1166002 1169723 1181573 1183208 12207...
result:
ok 25213 numbers
Test #11:
score: 0
Accepted
time: 137ms
memory: 10104kb
input:
9 50000 962118480 224422012 530689910 598196518 780267148 621837875 609026662 572394174 7897785 147043779 266397628 168565069 996408310 102067050 634382639 349570916 116002772 879226371 885888570 327981393 627552028 237784764 96204862 620985129 565390129 447700005 116002772 631413076 653535984 20424...
output:
416 62611196 983359971 90 107074781 643264242 3 23227 45992 77973 82516 88807 165433 168782 196483 329750 379946 434404 476061 484239 514555 515876 595779 609792 610877 636970 751634 779432 789743 857129 895585 912839 1076739 1166389 1258455 1310282 1337130 1420860 1499159 1570380 1579613 1592225 17...
result:
ok 25218 numbers
Test #12:
score: 0
Accepted
time: 695ms
memory: 12492kb
input:
9 200000 135784616 930376306 84361809 985295444 851292970 269236805 856798091 271181548 762217893 856798091 462749196 120755595 531571129 604211010 493908907 940486169 604211010 283516964 762217893 407741671 990711947 205335962 178685515 360234468 964851431 992963178 261895625 812267178 990711947 17...
output:
1519 6962495 106 284854399 36 72700176 625030539 998418613 20 4708984 21638247 25944554 311172186 357325474 670434401 773565295 1015 406948177 2501 99440824 107215326 375570744 387799976 55 11588682 12972610 20897063 26205844 37106836 45190049 55821994 58636324 79987571 82666901 90477975 91080230 95...
result:
ok 45168 numbers
Test #13:
score: 0
Accepted
time: 695ms
memory: 12784kb
input:
9 200000 725743030 30028136 108363704 132541583 233129596 19219689 856407544 987503539 172639782 153113856 729626528 341033928 156410721 482750975 678092074 494457330 258978219 146102138 709650431 274969460 59820892 664720419 990219478 322188987 901999530 675880331 943159603 423585569 272812766 1743...
output:
1538 343342034 106 317511752 539940990 725124952 35 768762226 20 6523560 60432456 114843736 126398351 156670961 283509084 371703512 426837279 436686342 468890936 473003550 504146483 554659729 835413643 1019 987463849 5001 396357249 404217765 56 10939303 11521641 13992263 17225651 24816521 28990577 3...
result:
ok 45201 numbers
Test #14:
score: 0
Accepted
time: 688ms
memory: 12512kb
input:
9 200000 259924440 482843646 698405858 81829609 668643035 120115078 465713378 795525066 468586155 869487013 464799976 872257813 729091232 158103417 939650978 204652647 729091232 948940622 284430414 575073865 259924440 668643035 668643035 81829609 450236911 129772276 812967691 305614847 729091232 877...
output:
1513 22499636 109 723253814 34 235430243 20 6390485 16439594 84871695 90637215 105894856 111732401 114485810 115322402 135713539 172295642 198914375 307517989 319720950 330982551 424398819 485917637 494352242 542747394 580755161 606211322 646568947 724021598 736789363 766748367 776946075 792336125 8...
result:
ok 45117 numbers
Test #15:
score: 0
Accepted
time: 685ms
memory: 12756kb
input:
9 200000 888134619 66269133 509900976 163810765 143703759 163810765 854756227 146141988 888134619 183817154 978602533 5192585 715910077 5192585 567678137 774920273 470853832 368687845 368799527 203971504 240701357 644793984 183817154 774920273 653069289 180071384 978602533 408839201 183817154 171420...
output:
1511 448599941 107 926889556 35 184205986 306398259 526309676 747903041 20 42810625 100223221 107274411 111942280 124998844 131893527 149445814 154380679 169672593 177752769 186703689 238905954 285690681 360707994 381030191 388106329 389961350 485320672 533728043 537938022 557774659 583518077 593019...
result:
ok 45236 numbers
Test #16:
score: 0
Accepted
time: 715ms
memory: 12708kb
input:
9 200000 73842336 136680216 621080695 666865318 160471107 546318047 6426671 382252749 368317095 556784178 162093547 261854484 843033743 258790234 484537901 158560673 908579552 102513046 765800986 190705915 355958959 660867016 560507758 73842336 459238545 919716424 739715261 99349978 946879386 592356...
output:
1513 182330345 115 924866239 35 473421507 544286978 20 27578725 69995657 96254998 108343444 130958890 148622143 161397629 188299191 256845517 288071428 322808295 341013782 348676074 405252151 417261444 423000440 509097231 522038777 571201755 579809652 593380535 600545884 648569241 691095316 70265638...
result:
ok 45125 numbers
Test #17:
score: 0
Accepted
time: 699ms
memory: 12484kb
input:
9 200000 317786155 96515847 222493722 70967262 888446782 779886867 638247548 338875831 172030458 78054611 767171259 127409208 837418741 736004147 458027028 580568152 462603834 875136891 686756569 436879176 857115203 886678205 172030458 819971755 530735129 747661596 363495802 654860294 279397774 1274...
output:
1497 548228514 110 244545335 32 19180303 48171730 66461630 320868401 410993082 573856318 639377421 719064833 784665837 936236452 20 10204603 32434499 60092661 64234622 164436517 224151388 261203787 303689062 323180625 348100475 371038641 391283497 408543592 452957601 465602602 485938740 488269740 57...
result:
ok 45140 numbers
Test #18:
score: 0
Accepted
time: 693ms
memory: 12724kb
input:
9 200000 45409652 235649445 235649445 549349991 458256339 790761728 328822538 625672915 164800546 599197383 72261464 754382508 216022244 777618263 381586476 29613623 678393925 224602191 207229582 11988400 25203298 233596921 815509812 305555972 48953130 707869688 216022244 64999512 862759972 78793927...
output:
1508 843116152 106 118864836 35 380920549 20 10282409 42159790 63145970 70091816 152051075 177868106 190621579 355548478 361587442 435572107 436289783 445885116 467186436 473242102 503654443 520957056 542819238 578606653 593074719 599679913 627545388 695163335 702826276 745014921 759849791 777728998...
result:
ok 45186 numbers
Test #19:
score: 0
Accepted
time: 700ms
memory: 12504kb
input:
9 200000 962636738 659949746 990724893 374392733 418160283 432681473 280790303 990724893 479162773 255124409 525244419 449144296 869729807 401182818 599473018 60606166 663226971 418160283 235756777 286461965 249699420 179944793 60606166 642879999 371616484 173351006 753434266 107173713 718880383 249...
output:
1502 453595703 105 278346314 386832331 37 365936735 382124501 20 24669726 105664496 356210646 531168236 603403566 644042701 686072325 790180830 955137028 996520483 1017 248599916 3335 298072584 67 19993925 20652289 33823722 86416159 86935428 95705174 96591200 106100027 145327727 149208966 167933457 ...
result:
ok 45135 numbers
Test #20:
score: 0
Accepted
time: 692ms
memory: 12588kb
input:
9 200000 115209394 576447346 547139308 261969202 914539062 20101580 356150426 467908848 232758068 818725993 467908848 159595153 590951729 282436814 758315712 193787527 408916833 738307717 479489724 764655030 338589400 454338516 818725993 483456905 276843270 363467715 965696474 239862203 590951729 36...
output:
1495 214911410 102 462891101 38 57040259 20 5378814 173349077 230192561 336434984 399643086 426558780 440657144 559123439 585280058 585877393 603956467 626298919 685558179 741260520 831109430 905506922 1017 755021310 2501 129390957 297826679 435587260 460940731 63 10654436 21766107 40937212 42479069...
result:
ok 45144 numbers
Test #21:
score: 0
Accepted
time: 703ms
memory: 12604kb
input:
9 200000 199661234 217496893 475351765 102844764 801878032 280362149 382292455 862407789 919571086 237784464 396909705 717802881 798684788 51795969 586588704 694385934 427833657 422130608 661699500 903631686 610613187 730980950 382292455 234429745 81507010 811254995 935958538 148658854 694385934 724...
output:
1517 668774730 112 790429610 35 599135129 20 5099691 13151910 26320111 43761826 53238162 53859450 61867865 81043710 99510236 116965675 119782176 124281900 124750791 170506037 205834874 231072926 285760927 294631038 301802212 373554157 384765556 386390796 391457725 447883817 461393830 463501811 48391...
result:
ok 45135 numbers
Test #22:
score: 0
Accepted
time: 1115ms
memory: 11144kb
input:
12 200000 621837875 912591234 690846426 701317769 546816240 116002772 466097892 466097892 25203351 303640854 102467451 463278943 998133227 642911606 5764908 420188705 500165093 521027619 870739178 164353437 831452391 472379315 121227049 885888570 343766215 455613697 192568336 598196518 267884026 559...
output:
567 555021253 553 999556574 146 464481495 506807243 996793562 146 260946585 149 163152318 145 10589735 151 464276585 910383052 153 247651600 153 209289768 143 312865595 149 281040524 163 308903629
result:
ok 27 numbers
Test #23:
score: 0
Accepted
time: 1143ms
memory: 11020kb
input:
12 200000 370603489 664428413 691221020 404550937 397553759 212099144 1183950 394723686 965842615 186541210 366609304 922325388 986843824 607462718 337347676 142309830 556784178 459697693 959563567 594698736 220554376 504358725 671621196 190705915 961764255 179312193 700870788 906247500 812641396 25...
output:
560 160471107 556 269683414 147 969493461 149 953182231 151 989695857 160 498389163 146 375562325 823788952 935194886 142 529558126 158 517611126 145 9522523 151 441868349 147 507118209 735024584
result:
ok 27 numbers
Test #24:
score: 0
Accepted
time: 1079ms
memory: 11184kb
input:
12 200000 263108134 410798836 954188127 288981803 987402045 284628200 777325374 954188127 105222291 680203324 291882089 843867422 772384081 342221155 141752547 168640248 832493514 825909652 27589620 239494556 116162344 272975891 956047973 124220868 570815250 753287868 182345928 783004249 460325662 1...
output:
561 415766154 571 902696644 147 692733732 150 3088356 145 609346651 143 424017125 144 269193777 156 250757955 147 401968727 746209387 153 176955662 143 916184024 149 993559822
result:
ok 25 numbers
Test #25:
score: 0
Accepted
time: 193ms
memory: 18876kb
input:
3 200000 768070489 155646510 300222152 304313790 394030369 248760595 213928971 424543469 526157364 268491550 145165784 698582889 688484496 349667237 793586464 173350515 624538053 835180131 931297606 263074510 289730398 48996865 222976981 437128689 698533623 705010454 730665089 241461147 737200279 54...
output:
10 176477369 10 393685379 505935648 982669127 8 258969950
result:
ok 8 numbers
Test #26:
score: 0
Accepted
time: 182ms
memory: 14464kb
input:
3 200000 548392630 974674906 687038678 720699810 249052516 1843732 978586994 450089092 100213111 968651658 69130250 6350530 470762974 924157835 83187512 685486146 50668241 163108137 430677841 974341714 226627270 617059334 572463556 878701340 932096423 601879459 944737648 743586316 382628235 27542126...
output:
18 63865282 67209431 697584428 17 104953088 172526757 375829226 487660122 911428360 14 371637312 580448494
result:
ok 13 numbers
Test #27:
score: 0
Accepted
time: 222ms
memory: 12360kb
input:
3 200000 947515860 537968727 261308895 436373577 220203016 755212333 551935282 663434334 544448529 99802614 461870120 750193071 515384217 192772436 375797389 189941996 343232011 823404747 560632061 367679666 817871090 137258084 71902916 13497792 735494742 870943688 556347834 448986475 594518494 4260...
output:
55 958295208 53 681406334 37 424351822
result:
ok 6 numbers
Test #28:
score: 0
Accepted
time: 245ms
memory: 11940kb
input:
3 200000 602393101 171463264 823283321 105499743 501602707 223716628 47569478 391848325 619411117 785336636 407390141 767006283 896190429 462505745 90803226 728653849 792437640 465691977 785108626 69736839 471194135 79911922 241085287 867961430 541680726 699088728 987839363 981987455 940251674 28053...
output:
81 842645468 83 514555899 748856612 50 237512619 813210256
result:
ok 8 numbers
Test #29:
score: 0
Accepted
time: 368ms
memory: 11632kb
input:
3 200000 397255490 90335256 477760767 56582319 182905910 476408691 108276441 538025264 706455387 950701291 277466189 738513678 236628977 478527202 391596733 788666283 381957415 57564490 635810211 919404375 730492847 502194925 8404368 923141319 318848649 385633420 824126231 617426000 961291679 404803...
output:
165 191837368 164 435560644 97 75567459
result:
ok 6 numbers
Test #30:
score: 0
Accepted
time: 430ms
memory: 12132kb
input:
3 200000 669874625 678859295 889658269 916298811 383995766 621423825 911627349 916776543 138384113 549165027 45670078 195595951 297836448 138384113 922794845 314160860 314528311 794716218 95633919 851782428 980998805 732983857 33878278 545925883 272160644 407498113 51404709 657954354 383665690 91044...
output:
202 984963674 208 951260658 116 41316651
result:
ok 6 numbers
Test #31:
score: 0
Accepted
time: 559ms
memory: 11324kb
input:
3 200000 220273039 19951732 253391982 277100719 195213880 57312560 866195953 2016338 837928371 991986022 767455898 729289682 357750527 249663396 251035618 468925871 9813023 534200288 159252242 121000761 835180568 824487513 868324576 203323461 474617059 304308281 871505596 444152299 542170240 2988246...
output:
282 109147879 275 996838593 158 354294691 542189233 652967622 653079452 687244441
result:
ok 10 numbers
Test #32:
score: 0
Accepted
time: 666ms
memory: 11400kb
input:
3 200000 409535090 117857201 935577830 593092100 622494855 312431575 211382521 455955390 704837361 823614796 846812765 526081690 801380164 457805638 898744353 976192110 783286874 124958803 448660895 183100469 449701943 460021975 334440680 15918576 788171795 163740227 276813126 213315965 787189340 19...
output:
343 298746830 337 807616755 189 807071879
result:
ok 6 numbers
Test #33:
score: 0
Accepted
time: 951ms
memory: 11296kb
input:
3 200000 839434251 547629264 97995429 533039140 902079972 816953479 101405180 714259588 453676646 809160713 331553509 494745649 827758961 381842503 714259588 403311180 293596797 425604363 60078265 634887213 989616129 459259771 83887625 851812474 726182086 781752747 149520909 649628707 289061887 8112...
output:
510 616562494 512 420327404 282 205264396
result:
ok 6 numbers
Test #34:
score: 0
Accepted
time: 1392ms
memory: 11656kb
input:
3 200000 483499915 593762592 224616388 768801762 651375573 541445552 223728335 947765877 839292000 975678275 712614637 53008529 953425815 433378013 947765877 950842442 789033059 553477685 28883799 438601900 101228973 526821031 845209987 313441109 236976788 953425815 471006086 471006086 556590178 541...
output:
1151 426239073 1151 86194435 611 82808828
result:
ok 6 numbers
Test #35:
score: 0
Accepted
time: 1391ms
memory: 11476kb
input:
3 200000 756817592 541498332 542816550 695577097 878307836 964851095 16105849 504097203 7588783 24267327 693521941 615698608 594008733 710666324 674773157 112500912 72014851 756817592 283385445 541498332 497801211 122650612 497801211 511891388 878307836 990051085 850699824 842132762 695577097 541498...
output:
2252 105991457 2242 529588387 1140 755664920
result:
ok 6 numbers
Test #36:
score: 0
Accepted
time: 1466ms
memory: 10972kb
input:
3 200000 493209391 850742532 493209391 85102688 346947701 953493193 303441516 303441516 910108604 912653754 313149241 953493193 137282325 567819709 416298988 682083520 86208858 750252685 86208858 85102688 911878476 770048418 910108604 950335557 399456789 853089428 677451896 303441516 750252685 44104...
output:
4291 183160045 4262 90791701 2195 923114227
result:
ok 6 numbers
Test #37:
score: 0
Accepted
time: 1716ms
memory: 11248kb
input:
3 200000 782470456 70128557 230528928 326709580 387892542 782470456 20397056 387892542 70128557 230528928 270819075 714260443 752254363 752254363 528945347 782470456 610007037 714260443 326709580 20397056 782470456 20397056 778867809 326709580 249365844 270819075 249365844 782470456 270819075 778867...
output:
10306 782470456 10357 216192812 5300 406132233
result:
ok 6 numbers
Test #38:
score: 0
Accepted
time: 1986ms
memory: 11340kb
input:
3 200000 729851566 960408645 676334657 67234301 729851566 676334657 960408645 67234301 421680081 451284888 676334657 676334657 351852473 40471253 67234301 67234301 40471253 676334657 421680081 676334657 205047695 960408645 451284888 67234301 40471253 207592314 351852473 421680081 676334657 676334657...
output:
20464 351852473 20371 180769235 10349 133066999
result:
ok 6 numbers
Test #39:
score: -100
Time Limit Exceeded
input:
3 200000 209352850 321923464 209352850 321923464 321923464 209352850 209352850 209352850 209352850 321923464 209352850 321923464 321923464 209352850 321923464 209352850 209352850 321923464 209352850 321923464 321923464 321923464 209352850 209352850 321923464 209352850 321923464 321923464 321923464 3...