QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#655613 | #9483. Maximize Array | ucup-team4770# | AC ✓ | 38ms | 23604kb | C++17 | 1.2kb | 2024-10-19 08:51:26 | 2024-10-19 08:51:27 |
Judging History
answer
#include <bits/stdc++.h>
#define PR(x) printf(x ? "YES\n" : "NO\n")
#define pr(x) printf(x ? "Yes\n" : "No\n")
#define mk make_pair
#define pb emplace_back
#define fi first
#define se second
#define pii pair<int, int>
#define fore(i, u, v) for (int i = h[u], v = e[i].v; i; v = e[i = e[i].nxt].v)
#define all(x) x.begin(), x.end()
using namespace std;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (! isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
while (isdigit(ch)) { x = x * 10 + ch - 48; ch = getchar(); }
return x * f;
}
const int maxn = 3e5 + 10;
int n, k, a[maxn], pt[maxn];
vector<pii> vec[maxn];
int main() {
n = read(), k = read();
for (int i = 0; i < n; i ++) vec[i % k].pb(mk(read(), i));
for (int i = 0; i < k; i ++) sort(all(vec[i]), [](pii x, pii y) {
return x.fi > y.fi || x.fi == y.fi && x.se < y.se; });
vector<int> ans; ans.clear();
int ls = 0;
for (int i = 0; i < n; i ++) {
vector<pii> &v = vec[i % k];
while (pt[i % k] < v.size() && v[pt[i % k]].se < ls) pt[i % k] ++;
if (pt[i % k] == v.size()) break;
ans.pb(v[pt[i % k]].fi), ls = v[pt[i % k]].se, pt[i % k] ++;
}
for (int x : ans) cout << x << ' ';
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 10672kb
input:
9 3 1 2 3 4 1 2 3 4 1
output:
4 4 1
result:
ok 3 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 11748kb
input:
6 1 1 6 4 2 3 5
output:
6 5
result:
ok 2 tokens
Test #3:
score: 0
Accepted
time: 2ms
memory: 10732kb
input:
6 5 6 5 4 3 2 1
output:
6 5 4 3 2 1
result:
ok 6 tokens
Test #4:
score: 0
Accepted
time: 0ms
memory: 12488kb
input:
1392 5 915 798 656 1252 1170 691 1298 205 254 1334 622 1090 1081 617 365 477 362 1306 35 432 744 144 1277 259 80 410 317 983 916 1089 700 1030 135 156 1102 945 1021 63 251 1173 485 1261 1305 219 1190 151 142 288 795 984 1324 417 1235 1295 374 1091 434 596 553 1298 244 1179 115 767 973 315 603 180 10...
output:
1385 1386 1388 1296 1065 1332 1139 288 828 749 1214 1089
result:
ok 12 tokens
Test #5:
score: 0
Accepted
time: 2ms
memory: 12076kb
input:
1235 294 496 705 855 832 681 885 857 35 617 356 164 22 982 1095 448 671 532 600 906 781 328 288 424 1162 505 170 804 1131 856 658 151 636 828 876 892 293 302 63 846 1140 528 1231 332 910 458 1208 481 1107 1121 928 579 1061 465 633 1171 1044 983 62 40 707 573 899 967 416 1208 31 1187 119 1035 1180 30...
output:
1057 731 575 815 1094 1051 979 737 338 100 236 125 1185 163 265 336 1 953 716 258 378 494 1131 539 771 762 377 52 332 463 1079 1217 937 425 1106 584 218 761 658 1124 428 1158 1213 506 978 181 95 380 704 458 346 1004 371 582 260 569 64 181 4
result:
ok 59 tokens
Test #6:
score: 0
Accepted
time: 2ms
memory: 11540kb
input:
1731 3 1304 1034 1285 402 1110 691 1544 1520 57 657 860 806 278 539 112 347 323 1170 757 769 841 1364 412 68 596 11 654 1523 1536 87 59 644 1165 1421 1095 796 684 463 769 296 409 1510 1595 645 1260 115 939 1054 857 89 1660 1473 355 1586 1219 1375 673 909 430 246 1273 497 955 1408 1593 1475 142 315 1...
output:
1731 1728 1722 1731 1722 1709 1455 1211 1215
result:
ok 9 tokens
Test #7:
score: 0
Accepted
time: 0ms
memory: 12556kb
input:
1176 4 277 1016 570 780 509 107 308 302 621 653 942 824 935 268 157 38 125 483 345 437 198 591 216 975 221 1084 89 1086 229 982 565 89 756 1159 401 151 362 702 49 1161 874 89 648 435 704 713 7 8 170 1061 1035 273 171 56 947 755 681 1030 680 652 1039 368 805 847 433 714 1068 1104 137 785 928 22 497 3...
output:
1170 1174 1175 853 763 1005 512 716
result:
ok 8 tokens
Test #8:
score: 0
Accepted
time: 2ms
memory: 11912kb
input:
1203 188 597 1061 959 940 742 1186 832 336 1023 1029 915 1006 839 448 239 22 415 1109 214 840 870 637 878 423 592 796 1159 856 26 1079 83 1071 653 857 470 329 69 721 265 1085 1000 139 978 301 501 890 167 1009 554 1138 341 97 187 1081 140 813 343 708 1088 175 223 633 10 1173 150 324 964 45 1071 203 4...
output:
1016 1127 1180 1131 997 1042 436 771 1004 475 715 280 161 217 1087 122 427 534 772 1127 863 972 618 956 461 593 837 155 110 719 606 652 1155 756 438 1074 197 755 590 642 682 799 696 768 486 257 21 911 605 95 429 244 1150 1119 828 412 378 668 1080 583 882 276 1137 991 464 445 22 872 1114 856 320 275 ...
result:
ok 75 tokens
Test #9:
score: 0
Accepted
time: 19ms
memory: 15600kb
input:
292698 7988 38966 51135 180900 142779 200531 16032 97627 4255 139157 272333 247330 46654 147980 129717 56541 99997 114424 281779 142869 285322 120906 3166 37893 110895 287423 104300 251540 42149 183273 39833 70543 172743 91359 41122 201955 89642 66677 238846 221199 118614 115464 154333 173145 270965...
output:
285283 205274 55516 277203 214606 38546 290836 70250 20359 261937 62240 221392 225355 11986 184572 250960 194401 98596 214785 85047 236821 100729 206002 140956 281157 209549 28779 113441 12657 174757 160898 121707 131549 98390 226701 105359 52503 4258 136955 245411 114497 48625 181371 106661 155342 ...
result:
ok 5130 tokens
Test #10:
score: 0
Accepted
time: 28ms
memory: 14044kb
input:
291303 6 265139 260987 49817 234725 69742 218237 8480 50119 4566 98039 156829 237292 6975 289521 24992 132135 34712 125564 116315 195098 105855 78338 62166 248028 37677 170952 245323 14102 256685 233124 106400 287252 232105 193020 126840 212703 76342 48522 290794 182463 72782 106077 195627 5884 2287...
output:
291297 291300 291299 291301 291285 291220 266660 164522 130099
result:
ok 9 tokens
Test #11:
score: 0
Accepted
time: 16ms
memory: 15692kb
input:
291907 99403 135674 5812 210570 282043 56390 69747 35706 215210 55795 41977 264489 195878 131625 46941 25418 964 186415 267887 195414 206579 201602 148232 123995 141396 229074 280783 290425 232983 18329 193974 165947 43971 147681 43903 86138 212253 146789 37288 123539 173120 144757 245313 55867 2079...
output:
281769 266373 218744 252969 131803 44727 203393 7923 192979 250436 44593 170444 267950 66076 285334 263863 97196 104799 180490 73298 81944 263994 13808 174006 226092 82563 165316 77562 184027 206114 244140 291740 192346 107450 180926 108466 140735 27537 75107 156922 119200 157603 8260 126891 229895 ...
result:
ok 93101 tokens
Test #12:
score: 0
Accepted
time: 26ms
memory: 14564kb
input:
299677 6 261062 13439 136726 22592 101200 47981 21344 195972 105056 193700 144991 23089 214074 226411 123367 167914 261933 275171 245854 45847 31390 122896 262727 259940 187032 154188 162139 9754 52110 184554 10164 7036 275626 123225 157904 45801 95762 18391 228166 89574 242130 17399 224474 72032 28...
output:
299675 299670 299618 299602 299551 299593 299484 298913 298057 298060 291964 238000 279017
result:
ok 13 tokens
Test #13:
score: 0
Accepted
time: 29ms
memory: 13420kb
input:
297106 7 40936 187771 170679 293463 175060 140924 153981 53805 241999 249810 126488 39070 296424 121591 99881 95651 31911 254032 54230 119979 95618 251871 190191 140273 235621 267207 290382 232243 50476 202616 45787 126724 57066 83493 199396 238198 216906 23469 3409 46919 51538 292382 67957 255292 2...
output:
297105 297097 296888 296490 296761 293931 275941 277234 258977 284898 235240 120070 222948 74199 153204 90526 276230 230020 43894
result:
ok 19 tokens
Test #14:
score: 0
Accepted
time: 23ms
memory: 16152kb
input:
290785 944 32924 113386 171949 272508 122819 2845 190352 100062 167243 290075 172127 161008 85814 213822 166900 7715 120780 148939 26193 60913 258901 282445 167409 21137 49940 246549 282095 32403 227841 98072 275473 56496 39706 261569 288147 123629 176500 116660 194990 111841 118239 170967 49343 106...
output:
290779 284815 258293 78341 247726 125617 120060 85993 8631 285533 165152 104076 63783 36553 46308 234310 188112 186335 211650 128028 282908 249606 130409 89898 149967 263076 87811 250301 29578 187168 71626 62355 93062
result:
ok 33 tokens
Test #15:
score: 0
Accepted
time: 17ms
memory: 14128kb
input:
291795 39401 256425 106921 118174 276074 121223 196905 200867 147938 33882 248779 15970 12063 278685 172506 146404 111360 287628 161203 264071 234739 271997 176123 21340 98384 165814 51369 286308 195081 217186 254410 155594 30701 133358 95596 145358 79679 202575 112060 159300 58497 2442 122612 22983...
output:
256425 275853 278785 213768 79782 178637 287612 194352 280084 171747 143383 44654 10663 126880 115004 255724 217314 219399 201598 23514 127232 103766 62036 113630 227781 285148 32266 183772 197693 94470 85350 55380 123863 77766 122351 3812 18311 146572 104753 39862 192538 115628 289104 263780 189896...
result:
ok 15988 tokens
Test #16:
score: 0
Accepted
time: 19ms
memory: 16324kb
input:
298952 7165 98696 135828 269666 151690 62816 216807 107821 136300 88638 191874 22017 296807 76825 260933 186984 252590 294878 225867 225389 150025 245255 215610 90369 142698 270917 238488 45155 2369 96823 4948 187965 116150 227165 122465 27100 57317 199223 127022 92535 75604 80419 116415 12479 53288...
output:
295549 278682 275359 243749 36617 253642 20703 147125 290113 61962 64438 172879 201015 258427 291349 199194 5562 181021 93745 210939 56165 12208 191945 230850 219022 140109 255941 296788 278039 281446 19967 286404 191606 62041 120076 192161 176894 187438 179903 258891 161592 69098 26110 13099 292337...
result:
ok 5187 tokens
Test #17:
score: 0
Accepted
time: 22ms
memory: 14500kb
input:
296092 29 99390 69522 162849 246204 86902 71452 201864 105431 78788 155706 215885 241564 272611 238234 179147 230062 113232 88643 112412 154865 238873 33462 292353 219772 253353 115897 205969 259679 84176 290316 251685 236759 190130 201964 76555 162509 261765 277167 196074 121798 266693 165833 14730...
output:
296055 296082 291775 278179 293826 293366 290605 274975 206917 191539 223150 142009 139513 86838 59188 137061 255900 166840 190863 241574 236218 121489 110402 68103 57537 102510 160174 187528 281535 261651 1053
result:
ok 31 tokens
Test #18:
score: 0
Accepted
time: 20ms
memory: 14916kb
input:
299253 6499 140130 96110 208818 293711 101740 116400 128673 283373 282817 280105 141691 163411 77956 197841 140743 13818 192615 69182 75772 123631 274449 271504 11512 277407 170395 142533 5463 123301 110930 279511 267123 29714 216292 266340 102885 88122 66666 203187 31871 95187 167412 196507 297015 ...
output:
285360 289426 165928 216916 122874 215816 25274 98397 213683 79958 283093 182774 139637 16034 218133 155846 205362 296643 224338 83470 201732 24261 96713 263131 157131 272291 8343 52440 170456 34090 237678 214512 62412 280875 139881 219533 168949 156571 178068 233970 269732 192752 269685 233822 1197...
result:
ok 299 tokens
Test #19:
score: 0
Accepted
time: 26ms
memory: 13912kb
input:
299514 11 201413 271984 83174 25778 294445 147547 34371 26968 3518 5954 12696 101083 184545 285312 165849 89017 155002 215182 157026 56461 88330 220294 73538 184876 127572 188738 180015 193031 112186 206225 294867 250338 84908 203371 241505 132411 292821 161903 256250 70903 71822 98796 132633 12362 ...
output:
298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 298621 295352 296779 297155 295545 295545 189361 264415 99078 232027 282057 3069 71383
result:
ok 39 tokens
Test #20:
score: 0
Accepted
time: 30ms
memory: 13228kb
input:
299148 6 279827 34873 145767 239892 299124 207794 76802 51282 297159 233994 176399 79073 21101 176914 166087 225713 136359 190147 236855 49759 101114 218416 297120 281858 104734 186157 152303 30054 163511 150489 285270 36018 228895 75621 207862 237270 57515 248857 97765 152250 183977 245347 248514 1...
output:
299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124 299124...
result:
ok 66 tokens
Test #21:
score: 0
Accepted
time: 32ms
memory: 14532kb
input:
299313 3 281295 155548 88808 5117 254661 25148 247722 218649 96122 277657 63998 161136 21350 149123 241425 197090 60988 15200 241425 285052 242479 277657 189168 298981 119595 11105 196226 31474 215849 7259 251905 296056 216738 47457 196226 215374 96412 162958 200461 290960 81285 306 101472 13966 412...
output:
299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116 299116...
result:
ok 105 tokens
Test #22:
score: 0
Accepted
time: 36ms
memory: 14808kb
input:
299487 2 268767 89879 93970 5144 229235 222743 27777 269688 168200 88861 166438 93216 94566 25449 85602 7030 245235 293274 107152 91102 71611 185786 65783 89292 87489 177390 131506 174718 279466 91460 100056 229252 15592 229212 47473 66279 36185 177877 14704 100056 64588 197279 229999 201262 43193 2...
output:
298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866 298866...
result:
ok 189 tokens
Test #23:
score: 0
Accepted
time: 31ms
memory: 17804kb
input:
299998 1 136488 74793 129484 127064 8906 20407 69071 84005 63609 115244 156837 8713 16047 272669 112703 292981 143157 21006 191296 20139 268254 226940 206717 212130 13321 182397 129484 87020 128367 156178 117994 98878 255032 201 68982 231304 185231 148933 284773 11175 227378 45556 204743 273226 8576...
output:
299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726 299726...
result:
ok 308 tokens
Test #24:
score: 0
Accepted
time: 29ms
memory: 12828kb
input:
299108 9 54151 102121 241179 250126 272209 109511 216513 217350 29719 126875 212185 215313 272209 217350 11010 4557 277662 95321 252566 246617 4557 292380 274066 161832 102121 197375 162757 102121 161832 218940 11010 280671 257496 277662 217350 186570 44331 121643 210443 241179 215313 230273 27873 2...
output:
299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015 299015...
result:
ok 317 tokens
Test #25:
score: 0
Accepted
time: 34ms
memory: 14108kb
input:
299394 5 47584 5744 100663 238332 247552 179636 126806 241163 2897 211472 68677 65085 17187 247552 211472 238332 134231 173544 209917 6197 234904 186430 249582 224762 139540 215643 88467 273071 153169 272000 99277 126806 295862 102727 32702 197964 65085 219397 281969 38363 236195 88467 36026 236195 ...
output:
295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862 295862...
result:
ok 574 tokens
Test #26:
score: 0
Accepted
time: 34ms
memory: 14416kb
input:
299150 3 289570 163895 56341 222261 177192 118909 209371 85880 9997 284460 295202 40034 95881 65253 88956 126680 275164 275664 48268 198292 40034 56341 65253 40034 185117 137641 115639 295202 5417 56341 191443 189698 118909 209371 124823 191443 25366 56264 57552 145200 101876 177192 224172 65672 958...
output:
295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202 295202...
result:
ok 1133 tokens
Test #27:
score: 0
Accepted
time: 31ms
memory: 15088kb
input:
299470 2 219375 138367 17880 54568 172399 213007 117442 222881 98126 100803 286879 43671 214432 172399 88659 266228 276047 219375 5724 154766 212027 213007 100803 294998 276047 134353 104378 172399 236802 286879 259730 237358 267922 5724 194151 100803 235313 217864 11084 73894 294998 77251 154766 21...
output:
295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785 295785...
result:
ok 1628 tokens
Test #28:
score: 0
Accepted
time: 29ms
memory: 17028kb
input:
299063 1 43555 123588 78325 123495 254 276012 166974 51380 72497 218109 213412 63856 207536 197302 226247 21565 19086 149490 254 108981 141672 218109 261085 21430 100314 21565 77290 50133 99911 75924 110340 70298 72497 125475 50133 15572 60933 143796 107855 263643 207536 190963 93764 222967 742 1447...
output:
294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667 294667...
result:
ok 2880 tokens
Test #29:
score: 0
Accepted
time: 27ms
memory: 14104kb
input:
299533 11 245553 245553 18737 18737 18653 177824 292689 224787 115519 115519 115519 115519 18737 19878 224787 82151 245553 82151 18737 19878 292689 18653 19878 177824 177824 292689 292689 82151 76998 18737 88490 177824 224787 82151 115519 18737 18737 224787 292689 292689 115519 177824 88490 19878 88...
output:
292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689 292689...
result:
ok 2643 tokens
Test #30:
score: 0
Accepted
time: 32ms
memory: 13216kb
input:
299765 6 236781 236781 19486 168541 19486 19486 133187 19486 168541 242074 145952 212388 247061 212388 145952 133187 145952 19486 145952 133187 133187 182090 182090 212388 145952 168541 212388 212388 133187 133187 19486 242074 236781 236781 182090 145952 212388 182090 182090 212388 212388 247061 247...
output:
247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061 247061...
result:
ok 5927 tokens
Test #31:
score: 0
Accepted
time: 34ms
memory: 14156kb
input:
299033 3 12224 110737 136220 128020 9170 12224 138633 136220 136220 138633 136220 136220 138633 138633 220875 218966 110737 116982 12224 12224 136220 136220 9170 136220 9170 59097 12224 128020 218966 9170 136220 116982 9170 220875 128020 116982 138633 220875 110737 136220 110737 128020 220875 220875...
output:
220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875 220875...
result:
ok 10679 tokens
Test #32:
score: 0
Accepted
time: 30ms
memory: 15156kb
input:
299288 2 71045 203559 276935 266899 146767 46283 146767 46283 266899 276935 109656 216718 276935 276935 71045 266899 207856 46283 201391 71045 216718 207856 201391 109656 216718 71045 203559 146767 109656 216718 146767 109656 46283 203559 216718 276935 201391 216718 207856 216718 201391 201391 27693...
output:
282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427 282427...
result:
ok 14078 tokens
Test #33:
score: 0
Accepted
time: 36ms
memory: 15608kb
input:
299606 1 170906 8971 117012 117012 199467 137385 136404 170906 25652 190491 25652 137385 137385 117012 73792 199467 130551 8971 137385 136404 117012 137385 130551 8971 73792 253316 8971 137385 253316 170906 130551 190491 199467 137385 136404 73792 253316 73792 73792 199467 199467 117012 117012 25331...
output:
253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316 253316...
result:
ok 27010 tokens
Test #34:
score: 0
Accepted
time: 25ms
memory: 13404kb
input:
299130 11 235364 235364 227778 227778 235364 227778 57813 26323 227778 235364 235364 227778 26323 235364 57813 26323 235364 26323 227778 235364 57813 26323 57813 235364 227778 57813 227778 57813 227778 235364 235364 26323 235364 26323 57813 57813 235364 235364 57813 26323 227778 26323 227778 235364 ...
output:
235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364 235364...
result:
ok 8741 tokens
Test #35:
score: 0
Accepted
time: 32ms
memory: 14624kb
input:
299464 6 234970 104629 185194 88522 229554 185194 185194 229554 234970 88522 104629 185194 104629 229554 104629 185194 104629 185194 88522 185194 234970 88522 229554 234970 185194 88522 185194 104629 185194 229554 185194 185194 88522 185194 234970 229554 88522 234970 229554 88522 88522 185194 185194...
output:
234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970 234970...
result:
ok 12196 tokens
Test #36:
score: 0
Accepted
time: 29ms
memory: 14388kb
input:
299390 3 37353 195351 255027 255027 262540 262540 262540 255027 255027 37353 255027 45881 195351 151418 45881 151418 255027 195351 151418 195351 151418 195351 45881 255027 195351 195351 195351 195351 37353 195351 195351 255027 45881 262540 37353 195351 45881 45881 45881 45881 45881 37353 151418 4588...
output:
262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540 262540...
result:
ok 18620 tokens
Test #37:
score: 0
Accepted
time: 30ms
memory: 14372kb
input:
299863 2 269613 127035 109248 109248 127035 288197 127035 127035 269613 127035 73817 73817 127035 127035 127035 109248 127035 288197 127035 109248 73817 73817 127035 127035 73817 269613 73817 73817 269613 109248 127035 269613 269613 109248 288197 269613 109248 73817 109248 288197 73817 73817 269613 ...
output:
288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197 288197...
result:
ok 33005 tokens
Test #38:
score: 0
Accepted
time: 32ms
memory: 16228kb
input:
299191 1 222139 268472 82549 82549 82549 268472 222139 222139 227933 268472 235878 235878 82549 268472 268472 82549 222139 227933 82549 222139 82549 227933 227933 268472 82549 227933 235878 222139 235878 268472 227933 268472 268472 268472 235878 222139 227933 82549 268472 235878 222139 82549 82549 8...
output:
268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472 268472...
result:
ok 59644 tokens
Test #39:
score: 0
Accepted
time: 24ms
memory: 14156kb
input:
299187 10 102672 15507 102672 102672 51641 51641 102672 51641 102672 51641 102672 51641 102672 51641 51641 51641 51641 102672 51641 15507 51641 51641 102672 15507 51641 51641 51641 15507 51641 15507 51641 15507 51641 51641 51641 102672 15507 51641 15507 15507 15507 15507 51641 102672 15507 51641 516...
output:
102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672 102672...
result:
ok 14367 tokens
Test #40:
score: 0
Accepted
time: 28ms
memory: 13096kb
input:
299133 4 160968 8561 31006 160968 160968 31006 160968 31006 8561 160968 8561 160968 160968 31006 31006 160968 160968 8561 8561 31006 8561 31006 31006 8561 8561 31006 8561 160968 8561 31006 31006 31006 8561 160968 160968 160968 8561 31006 8561 160968 8561 8561 160968 160968 160968 8561 8561 8561 8561...
output:
160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968 160968...
result:
ok 33025 tokens
Test #41:
score: 0
Accepted
time: 31ms
memory: 13036kb
input:
299854 3 289029 289029 22430 289029 289029 289029 164594 22430 164594 164594 164594 289029 22430 289029 164594 289029 164594 22430 289029 22430 22430 164594 164594 289029 289029 22430 22430 22430 22430 164594 164594 164594 289029 164594 22430 22430 22430 164594 22430 289029 289029 164594 289029 2890...
output:
289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029 289029...
result:
ok 42856 tokens
Test #42:
score: 0
Accepted
time: 29ms
memory: 14896kb
input:
299318 2 175036 271858 175036 271858 271858 175036 271858 175036 277718 271858 175036 175036 271858 175036 277718 175036 277718 271858 271858 271858 175036 271858 271858 271858 175036 277718 271858 271858 175036 175036 277718 271858 271858 271858 271858 277718 277718 175036 175036 271858 175036 2777...
output:
277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718 277718...
result:
ok 59982 tokens
Test #43:
score: 0
Accepted
time: 32ms
memory: 17468kb
input:
299899 1 200506 200506 105621 200506 200506 36977 105621 105621 200506 36977 200506 36977 36977 200506 105621 105621 200506 200506 36977 200506 200506 105621 36977 200506 36977 36977 36977 36977 200506 105621 105621 200506 36977 105621 105621 200506 105621 200506 105621 200506 36977 36977 200506 105...
output:
200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506 200506...
result:
ok 100231 tokens
Test #44:
score: 0
Accepted
time: 24ms
memory: 14152kb
input:
299244 10 226213 293010 226213 226213 293010 293010 226213 293010 293010 226213 226213 226213 226213 226213 226213 293010 226213 226213 226213 226213 293010 226213 226213 293010 293010 293010 293010 226213 293010 293010 293010 226213 226213 293010 293010 293010 293010 293010 226213 293010 226213 293...
output:
293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010 293010...
result:
ok 27384 tokens
Test #45:
score: 0
Accepted
time: 26ms
memory: 14104kb
input:
299586 5 152739 117736 152739 152739 152739 117736 117736 117736 117736 152739 152739 117736 152739 117736 152739 117736 152739 152739 117736 152739 152739 152739 117736 117736 152739 152739 117736 117736 152739 152739 152739 117736 117736 152739 152739 152739 117736 117736 152739 152739 152739 1177...
output:
152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739 152739...
result:
ok 50091 tokens
Test #46:
score: 0
Accepted
time: 23ms
memory: 14604kb
input:
299474 3 134498 180905 134498 180905 180905 134498 134498 134498 180905 180905 134498 180905 134498 134498 134498 134498 180905 134498 134498 180905 134498 180905 180905 180905 134498 180905 134498 180905 180905 180905 180905 134498 134498 180905 180905 134498 134498 180905 180905 180905 180905 1809...
output:
180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905 180905...
result:
ok 75188 tokens
Test #47:
score: 0
Accepted
time: 27ms
memory: 14604kb
input:
299359 2 21149 83994 83994 83994 21149 21149 83994 83994 83994 83994 21149 83994 21149 21149 83994 21149 21149 21149 83994 21149 83994 83994 21149 83994 21149 83994 83994 83994 83994 21149 83994 83994 83994 21149 83994 21149 83994 21149 21149 83994 83994 83994 83994 83994 83994 83994 83994 83994 839...
output:
83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 83994 ...
result:
ok 99875 tokens
Test #48:
score: 0
Accepted
time: 38ms
memory: 16592kb
input:
299951 1 62822 62822 62822 62822 267174 62822 62822 267174 267174 267174 267174 62822 267174 62822 62822 62822 267174 62822 267174 62822 62822 62822 267174 62822 267174 62822 267174 62822 62822 267174 62822 62822 62822 267174 267174 267174 267174 62822 62822 267174 267174 267174 267174 62822 62822 2...
output:
267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174 267174...
result:
ok 150057 tokens
Test #49:
score: 0
Accepted
time: 29ms
memory: 13124kb
input:
299994 6 94139 6305 53864 83124 128172 240570 27696 160839 241607 63850 189454 178131 290029 200399 171852 26070 3041 248559 260488 133413 148365 125227 287308 57516 274214 29490 112174 46330 192021 173203 244596 199477 71297 244404 178949 279493 82026 230608 267270 259358 162109 161364 14753 139710...
output:
299993 299981 299976 299994 299991 299942 298408 292761 296508 289410 297914 287800 244616 155219 109114 17663 176455 247631
result:
ok 18 tokens
Test #50:
score: 0
Accepted
time: 32ms
memory: 13844kb
input:
299784 11 162350 20702 241243 269661 260487 168727 58216 276188 138928 121173 177578 25930 46605 97043 20595 37087 100905 181117 120055 267743 234186 256333 124689 296201 244338 136442 174395 254739 22889 132029 48170 235687 92257 139926 280771 252568 273409 226423 81497 50941 49463 194672 180391 86...
output:
299783 299781 299779 299775 299778 299659 299657 299763 299566 299704 299472 299660 298752 298713 296784 281015 237382 274399 196984 274600 173951 10735 44566
result:
ok 23 tokens
Test #51:
score: 0
Accepted
time: 24ms
memory: 14996kb
input:
299115 954 92371 60568 5786 258593 191212 241185 288691 247930 19853 128522 163867 218284 208182 266221 48103 126215 178940 227176 141387 244456 125103 268963 1822 221387 37604 205484 260357 54540 159212 212971 204112 245338 25173 21546 25006 185174 125261 156833 23987 149406 146597 236269 108319 11...
output:
294050 298452 295173 247104 232733 233013 210963 211599 192794 46870 95654 256404 40905 109016 256553 261364 72068 246198 217919 134128 276185 246922 265305 291226 43513 233617 51721 65539 219379 168222 252765 65044 295070 173351 183482 113227 30040 201688 107101 62267 296287 137078 263610 83754 286...
result:
ok 513 tokens
Test #52:
score: 0
Accepted
time: 19ms
memory: 14844kb
input:
299810 7770 199152 121490 14820 227610 37567 104357 197587 65553 245904 232938 31379 94455 40001 285637 121782 103670 99083 171942 15664 21483 264537 75464 24903 288970 287725 59689 193821 66846 213010 174743 132991 44759 60507 220104 297310 282335 258850 158599 127265 267464 16334 121488 23326 7429...
output:
290180 288939 250222 200468 186034 299551 161002 66337 207191 26080 175353 45003 9072 211918 150709 171834 89226 78111 116095 214468 282297 7845 37176 269351 17475 274290 66770 219300 62793 128747 46253 9976 243736 189070 296222 75882 239389 199594 35154 36343 163868 29417 186647 105385 67787 174339...
result:
ok 4550 tokens
Test #53:
score: 0
Accepted
time: 10ms
memory: 15688kb
input:
299744 25984 116953 31924 78948 139860 61867 29906 165459 89854 121919 147664 103788 205392 172170 104288 41298 40132 190449 71718 170907 7525 244895 69511 101183 34115 185872 27163 206452 190564 8671 47998 297265 157957 163314 100079 24603 162314 229055 193173 131921 110145 68772 198067 93092 15044...
output:
290974 270372 191110 17622 286666 258799 172114 119549 148424 147253 245473 55702 81602 263878 291790 163373 135594 267477 239972 208096 224635 226216 44623 177881 185198 266622 78254 21520 226829 97588 274793 91676 199291 152838 83513 297392 251854 261888 161546 67956 105280 148309 63668 103840 152...
result:
ok 13920 tokens
Test #54:
score: 0
Accepted
time: 2ms
memory: 11788kb
input:
2 1 1 1
output:
1 1
result:
ok 2 tokens
Test #55:
score: 0
Accepted
time: 2ms
memory: 10964kb
input:
2 1 1 2
output:
2
result:
ok "2"
Test #56:
score: 0
Accepted
time: 2ms
memory: 10804kb
input:
2 1 2 1
output:
2 1
result:
ok 2 tokens
Test #57:
score: 0
Accepted
time: 15ms
memory: 16840kb
input:
300000 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
output:
300000
result:
ok "300000"
Test #58:
score: 0
Accepted
time: 11ms
memory: 21624kb
input:
300000 299999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
300000
result:
ok "300000"
Test #59:
score: 0
Accepted
time: 28ms
memory: 17424kb
input:
300000 1 300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 299973 299972 299971 299970 299969 299968 299967 299966 299965 299964 299963 299962 299961 299960 2999...
output:
300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 299973 299972 299971 299970 299969 299968 299967 299966 299965 299964 299963 299962 299961 299960 299959 299958...
result:
ok 300000 tokens
Test #60:
score: 0
Accepted
time: 25ms
memory: 23604kb
input:
300000 299999 300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 299973 299972 299971 299970 299969 299968 299967 299966 299965 299964 299963 299962 299961 299960...
output:
300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 299973 299972 299971 299970 299969 299968 299967 299966 299965 299964 299963 299962 299961 299960 299959 299958...
result:
ok 300000 tokens
Extra Test:
score: 0
Extra Test Passed