QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#628166 | #9249. Elimination Series Once More | njupt_zy# | TL | 1406ms | 306416kb | C++20 | 2.3kb | 2024-10-10 18:58:45 | 2024-10-10 18:58:46 |
Judging History
answer
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
constexpr int M = 21, N = (1 << M) + 9;
int a[N], rt[N], cnt[21 * N], ls[21 * N], rs[21 * N], rtl[(1 << (M + 1)) + 10], rtr[(1 << (M + 1)) + 10], b[N];
int n, k, idx;
inline int read() {
int x = 0; char c = getchar(), fs = 0; while(! isdigit(c)) fs |= (c == '-'), c = getchar();
while(isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
return fs ? -x : x;
}
void build(int p, int l, int r) {
rtl[p] = l, rtr[p] = r;
if (l == r) {
b[l] = p;
return;
}
int m = (l + r) >> 1;
build(2 * p, l, m);
build(2 * p + 1, m + 1, r);
}
void add(int p, int &q, int l, int r, int x, int v) {
cnt[q = ++idx] = cnt[p];
ls[q] = ls[p];
rs[q] = rs[p];
if (l == r) {
cnt[q] += v;
return;
}
int m = l + r >> 1;
if (x <= m) {
add(ls[p], ls[q], l, m, x, v);
} else {
add(rs[p], rs[q], m + 1, r, x, v);
}
cnt[q] = cnt[ls[q]] + cnt[rs[q]];
}
int query(int p, int q, int l, int r, int x, int y) {
if (l > y || r < x) {
return 0;
}
if (l >= x && r <= y) {
return cnt[q] - cnt[p];
}
int m = l + r >> 1;
return query(ls[p], ls[q], l, m, x, y) + query(rs[p], rs[q], m + 1, r, x, y);
}
bool check(int i, int x) {
int now = b[i] / (1 << x);
int l = rtl[now], r = rtr[now], cnt = query(rt[l - 1], rt[r], 1, (1 << n), a[i] + 1, (1 << n));
int len = r - l + 1, has = a[i] - 1, use = len - cnt - 1;
has -= use;
if (cnt <= k && has >= cnt) {
return true;
}
return false;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
n = read(), k = read();
const int m = (1 << n);
for (int i = 1; i <= (1 << n); i++) {
a[i] = read();
add(rt[i - 1], rt[i], 1, m, a[i], 1);
}
build(1, 1, m);
for (int i = 1; i <= m; i++) {
int lo = 0, hi = n;
while (lo < hi) {
int m = (lo + hi + 1) / 2;
if (check(i, m)) {
lo = m;
} else {
hi = m - 1;
}
}
cout << lo << " \n"[i == (1 << n)];
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 9816kb
input:
2 1 1 2 3 4
output:
0 1 1 2
result:
ok 4 number(s): "0 1 1 2"
Test #2:
score: 0
Accepted
time: 2ms
memory: 9792kb
input:
3 5 2 4 7 5 3 8 6 1
output:
1 2 2 2 1 3 2 0
result:
ok 8 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 9876kb
input:
3 0 1 2 7 4 5 8 3 6
output:
0 1 2 0 0 3 0 1
result:
ok 8 numbers
Test #4:
score: 0
Accepted
time: 2ms
memory: 9896kb
input:
3 5 3 7 1 2 4 8 5 6
output:
1 2 0 1 2 3 2 2
result:
ok 8 numbers
Test #5:
score: 0
Accepted
time: 2ms
memory: 9896kb
input:
3 3 3 4 8 2 7 6 1 5
output:
1 2 3 1 2 2 0 2
result:
ok 8 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 9744kb
input:
3 3 4 2 6 8 3 5 1 7
output:
2 1 2 3 1 2 0 2
result:
ok 8 numbers
Test #7:
score: 0
Accepted
time: 2ms
memory: 9820kb
input:
3 4 5 8 1 3 2 4 6 7
output:
2 3 0 1 1 2 2 2
result:
ok 8 numbers
Test #8:
score: 0
Accepted
time: 1ms
memory: 9788kb
input:
3 1 7 3 8 6 5 2 4 1
output:
2 1 3 1 2 1 2 0
result:
ok 8 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 9812kb
input:
3 4 1 2 5 3 6 7 4 8
output:
0 1 2 1 2 2 2 3
result:
ok 8 numbers
Test #10:
score: 0
Accepted
time: 2ms
memory: 9864kb
input:
3 2 2 4 8 6 3 7 5 1
output:
1 2 3 2 1 2 2 0
result:
ok 8 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 10016kb
input:
10 780 495 929 348 345 426 543 187 419 839 812 320 1018 251 284 944 258 721 640 730 528 316 247 313 195 809 948 261 615 805 213 388 894 1005 77 599 636 881 444 144 923 240 520 592 465 96 455 563 943 237 860 531 269 106 989 740 506 23 224 84 475 108 718 3 16 731 436 591 627 672 300 573 613 253 637 46...
output:
8 9 8 8 8 9 7 8 9 9 8 9 7 8 9 8 9 9 9 9 8 7 8 7 9 9 8 9 9 7 8 9 9 6 9 9 9 8 7 9 7 9 9 8 6 8 9 9 7 9 9 8 6 9 9 8 4 7 6 8 6 9 1 4 9 8 9 9 9 8 9 9 7 9 8 9 9 9 6 7 6 7 9 9 9 9 9 7 6 8 8 8 9 9 6 6 9 9 9 8 9 9 6 9 9 8 6 7 8 8 3 8 8 9 6 9 7 8 8 9 9 9 9 8 7 9 8 8 7 7 9 9 9 9 9 8 8 9 6 9 9 9 9 9 9 6 9 8 8 9 ...
result:
ok 1024 numbers
Test #12:
score: 0
Accepted
time: 2ms
memory: 9956kb
input:
10 175 10 301 861 580 539 53 822 97 923 133 952 870 438 265 55 825 557 784 976 584 993 897 981 259 875 18 106 399 1019 692 336 485 491 9 565 114 738 128 678 23 562 538 869 787 768 385 494 640 655 666 332 930 798 418 801 266 1009 846 54 37 967 139 394 802 168 503 233 848 340 329 240 898 251 1023 779 ...
output:
3 7 9 8 8 5 9 6 9 7 9 9 8 7 5 9 8 9 9 8 9 9 9 7 9 4 6 8 9 9 8 8 8 3 8 6 9 7 9 4 8 8 9 9 9 8 8 8 8 8 8 9 9 8 9 7 9 9 5 5 9 7 8 9 7 8 7 9 8 8 7 9 7 9 9 9 8 8 9 9 8 7 9 7 8 6 8 5 5 9 9 7 8 9 6 5 8 9 8 5 7 8 9 7 6 9 8 9 8 2 6 9 8 9 9 8 8 5 9 8 9 7 9 9 9 6 9 9 7 10 9 8 9 9 9 7 8 7 8 8 8 6 7 6 7 4 8 9 9 8...
result:
ok 1024 numbers
Test #13:
score: 0
Accepted
time: 0ms
memory: 9956kb
input:
10 15 829 331 590 799 39 456 888 779 60 411 796 148 678 930 101 653 81 429 4 457 455 703 780 260 251 21 291 122 366 177 665 326 114 96 445 123 154 340 522 113 895 170 144 857 447 865 874 891 679 541 867 731 436 219 871 596 285 1008 435 263 881 798 16 275 14 97 845 269 974 782 343 404 561 540 443 482...
output:
6 4 5 6 4 5 7 5 4 4 6 4 5 7 4 5 4 5 2 5 5 5 6 4 4 4 4 4 4 4 5 4 4 4 4 4 4 4 5 4 7 4 4 6 5 6 7 7 5 5 6 5 4 4 6 5 4 9 4 4 7 6 4 4 3 4 6 4 8 6 4 4 5 5 4 5 7 7 4 4 4 4 4 5 9 4 4 7 5 8 4 4 6 4 6 9 6 4 8 5 5 4 4 4 5 4 5 5 4 4 4 4 5 4 5 5 4 5 4 4 5 4 4 6 4 9 5 6 8 6 5 6 6 7 4 4 4 4 4 4 4 3 4 4 4 4 6 7 7 5 ...
result:
ok 1024 numbers
Test #14:
score: 0
Accepted
time: 2ms
memory: 9952kb
input:
10 215 910 367 1011 675 689 697 604 665 730 306 743 225 210 1008 546 439 411 475 529 640 54 505 420 481 213 406 1012 933 392 121 751 554 265 550 621 537 212 908 49 918 768 125 16 927 507 863 1000 44 900 7 645 543 784 461 569 669 984 249 189 727 497 994 719 282 666 691 58 795 119 515 682 150 53 494 6...
output:
9 8 9 9 9 9 9 9 9 8 9 7 7 9 8 8 8 8 8 9 5 8 8 8 7 8 9 9 8 6 9 8 8 8 9 8 7 9 5 9 9 6 4 9 8 9 9 5 9 2 9 8 9 8 8 9 9 7 7 9 8 9 9 8 9 9 5 9 6 8 9 7 5 8 9 8 9 9 7 9 8 9 9 9 8 9 7 5 8 7 9 8 8 6 9 9 8 6 5 9 8 8 9 8 7 9 9 8 6 4 9 6 9 8 8 9 7 8 9 8 5 8 8 9 8 9 8 9 9 8 8 7 5 9 9 9 9 9 8 8 9 9 6 8 6 8 6 9 9 9 ...
result:
ok 1024 numbers
Test #15:
score: 0
Accepted
time: 0ms
memory: 9960kb
input:
10 358 714 252 544 999 507 766 720 169 379 856 698 40 910 610 564 125 278 426 285 205 746 43 23 284 81 525 848 540 827 604 630 741 27 313 452 724 9 745 762 263 44 901 864 445 418 596 310 719 988 536 799 625 202 895 412 153 847 145 353 297 133 260 717 893 158 314 90 356 108 315 1016 510 1015 1007 747...
output:
9 7 9 9 8 9 9 7 8 9 9 5 9 9 9 6 8 8 8 7 9 5 4 8 6 9 9 9 9 9 9 9 4 8 8 9 3 9 9 8 5 9 9 8 8 9 8 9 9 9 9 9 7 9 8 7 9 7 8 8 7 8 9 9 7 8 6 8 6 8 9 8 9 9 9 7 9 9 7 9 6 9 9 7 8 7 9 7 8 7 9 9 7 9 9 4 8 9 8 9 9 9 7 9 6 9 8 9 9 9 8 9 9 9 8 3 8 9 4 7 8 8 8 8 8 8 9 6 8 6 9 7 9 9 8 7 9 9 9 9 7 8 9 8 9 8 9 7 8 9 ...
result:
ok 1024 numbers
Test #16:
score: 0
Accepted
time: 0ms
memory: 9972kb
input:
10 409 720 603 348 938 361 756 506 176 661 192 318 599 115 548 681 692 915 148 721 93 424 707 404 392 695 342 247 799 743 814 82 120 365 428 461 355 184 372 224 810 225 569 630 800 480 226 802 867 136 592 723 412 248 619 817 67 891 72 74 315 624 250 1001 73 536 397 859 553 647 143 575 733 468 298 71...
output:
9 9 8 9 8 9 8 7 9 7 8 9 6 9 9 9 9 7 9 6 8 9 8 8 9 8 7 9 9 9 6 6 8 8 8 8 7 8 7 9 7 9 9 9 8 7 9 9 7 9 9 8 7 9 9 6 9 6 6 8 9 7 9 6 9 8 9 9 9 7 9 9 8 8 9 6 9 9 8 9 9 9 7 8 8 9 5 9 7 7 7 9 9 9 8 7 8 9 8 8 8 8 4 8 8 9 9 8 6 9 9 9 2 9 7 9 8 9 8 7 8 7 9 6 6 9 9 9 7 9 9 8 9 9 9 9 8 9 8 8 8 9 9 9 8 9 6 9 8 9 ...
result:
ok 1024 numbers
Test #17:
score: 0
Accepted
time: 2ms
memory: 9972kb
input:
10 700 469 249 763 385 977 949 423 11 825 442 744 993 553 908 410 860 465 291 751 234 50 897 64 346 481 1010 444 88 605 268 531 167 853 367 389 191 784 723 783 277 916 649 418 932 516 972 714 905 358 364 334 293 391 337 785 837 721 568 555 102 456 554 165 141 253 852 43 109 699 963 915 611 16 156 83...
output:
8 7 9 8 9 9 8 3 9 8 9 9 9 9 8 9 8 8 9 7 5 9 6 8 8 9 8 6 9 8 9 7 9 8 8 7 9 9 9 8 9 9 8 9 9 9 9 9 8 8 8 8 8 8 9 9 9 9 9 6 8 9 7 7 7 9 5 6 9 9 9 9 4 7 6 8 9 9 9 7 6 5 8 8 9 8 8 8 9 7 8 9 8 8 7 9 7 9 6 6 8 9 5 9 9 8 9 8 9 9 9 8 9 8 8 9 7 9 8 6 8 6 9 9 6 9 9 5 8 7 8 9 8 8 9 6 7 7 9 8 9 9 9 9 9 6 9 9 7 6 ...
result:
ok 1024 numbers
Test #18:
score: 0
Accepted
time: 0ms
memory: 9944kb
input:
10 655 971 111 296 479 453 490 163 686 195 492 1014 762 1021 15 351 618 137 181 853 758 876 598 703 486 125 35 41 266 603 682 733 294 391 967 373 508 860 501 1018 1003 642 365 531 883 89 674 869 311 442 734 886 165 701 139 447 271 540 190 983 474 816 769 1015 101 896 904 692 627 643 750 615 20 406 5...
output:
9 6 8 8 8 8 7 9 7 8 9 9 9 3 8 9 7 7 9 9 9 9 9 8 6 5 5 8 9 9 9 8 8 9 8 8 9 8 9 9 9 8 9 9 6 9 9 8 8 9 9 7 9 7 8 8 9 7 9 8 9 9 9 6 9 9 9 9 9 9 9 4 8 8 7 8 7 9 9 8 2 9 9 9 9 9 9 5 8 7 9 9 7 8 8 6 7 7 7 8 9 9 9 9 9 7 9 9 9 5 9 9 7 7 9 9 8 9 7 6 7 8 9 8 4 9 8 9 9 9 8 9 8 8 9 5 8 7 4 9 9 9 6 8 8 9 8 9 9 8 ...
result:
ok 1024 numbers
Test #19:
score: 0
Accepted
time: 2ms
memory: 9888kb
input:
10 827 692 816 52 570 178 260 248 531 852 777 232 378 955 632 325 256 328 599 802 165 966 493 166 125 488 942 965 716 947 276 156 894 194 742 933 185 384 152 277 333 991 424 487 435 423 504 113 106 307 205 745 155 654 226 16 518 884 757 1009 133 401 392 451 510 682 717 922 608 148 206 854 355 728 51...
output:
9 9 5 9 7 8 7 9 9 9 7 8 9 9 8 8 8 9 9 7 9 8 7 6 8 9 9 9 9 8 7 9 7 9 9 7 8 7 8 8 9 8 8 8 8 8 6 6 8 7 9 7 9 7 4 9 9 9 9 7 8 8 8 8 9 9 9 9 7 7 9 8 9 8 7 7 5 7 8 9 8 8 8 9 9 7 9 6 9 8 6 6 4 9 8 5 9 6 9 9 7 9 9 6 9 9 8 8 9 9 9 9 9 9 8 2 6 9 9 9 7 8 9 9 2 8 7 8 8 8 7 9 9 8 9 8 4 9 9 8 9 8 8 9 4 8 9 9 9 6 ...
result:
ok 1024 numbers
Test #20:
score: 0
Accepted
time: 0ms
memory: 9952kb
input:
10 328 454 408 810 540 254 321 33 682 91 53 398 761 1023 243 581 545 825 892 100 356 17 326 487 878 787 756 996 707 770 924 945 272 428 686 339 908 390 645 238 337 517 364 717 404 533 394 849 435 894 947 482 806 657 39 781 946 75 656 129 476 676 984 456 412 463 160 562 592 345 141 145 501 921 991 21...
output:
8 8 9 9 7 8 5 9 6 5 8 9 9 7 9 9 9 9 6 8 4 8 8 9 9 9 9 9 9 9 9 8 8 9 8 9 8 9 7 8 9 8 9 8 9 8 9 8 9 9 8 9 9 5 9 9 6 9 7 8 9 9 8 8 8 7 9 9 8 7 7 8 9 9 7 8 6 5 9 9 3 9 9 6 9 9 6 9 1 9 9 8 8 8 8 8 8 9 8 9 8 5 8 9 7 9 8 7 8 9 9 8 8 2 9 7 8 9 7 9 8 9 9 9 8 8 9 9 9 8 9 6 7 9 9 8 8 9 7 9 9 9 9 9 9 9 9 4 6 9 ...
result:
ok 1024 numbers
Test #21:
score: 0
Accepted
time: 2ms
memory: 9896kb
input:
10 825 601 142 625 471 287 405 117 857 340 984 863 530 575 994 436 394 529 25 141 332 735 966 1 831 673 896 89 272 649 81 384 242 864 817 174 382 145 469 577 715 893 275 914 455 667 169 179 521 305 925 976 213 40 380 659 499 918 725 561 616 948 924 1022 721 235 485 85 781 540 52 892 982 254 461 381 ...
output:
9 7 9 8 8 8 6 9 8 9 9 9 9 9 8 8 9 4 7 8 9 9 0 9 9 9 6 8 9 6 8 7 9 9 7 8 7 8 9 9 9 8 9 8 9 7 7 9 8 9 9 7 5 8 9 8 9 9 9 9 9 9 9 9 7 8 6 9 9 5 9 9 7 8 8 9 9 6 9 9 9 9 8 4 5 7 9 9 8 5 9 9 9 7 9 6 8 9 2 6 9 8 9 7 7 9 9 9 9 9 9 7 8 8 9 9 9 6 9 8 7 9 9 6 9 9 9 4 9 8 9 9 9 8 7 8 7 8 7 8 9 8 4 9 9 9 6 7 7 9 ...
result:
ok 1024 numbers
Test #22:
score: 0
Accepted
time: 1338ms
memory: 296944kb
input:
20 0 179487 921757 700836 1026745 871114 487101 416568 943369 555729 702080 475044 257810 489454 716476 879881 237658 884615 645342 654881 754504 537330 488794 60810 581898 627225 134547 267586 35544 535278 202909 1006004 182486 863804 12271 705426 1000913 315415 495258 494119 323180 59354 347058 62...
output:
0 1 0 5 1 0 0 2 0 2 1 0 0 1 3 0 3 0 0 1 1 0 0 2 2 0 1 0 1 0 4 0 1 0 0 3 0 2 1 0 0 1 0 2 1 0 6 0 4 0 0 1 0 1 0 2 2 0 0 1 0 3 0 1 4 0 0 1 2 0 0 1 0 1 0 3 0 1 2 0 2 0 1 0 3 0 0 1 1 0 12 0 2 0 1 0 0 1 4 0 0 1 2 0 0 3 0 1 0 1 0 2 1 0 2 0 0 1 3 0 0 1 0 5 0 1 2 0 1 0 0 3 1 0 0 2 1 0 4 0 2 0 0 1 1 0 2 0 0 5...
result:
ok 1048576 numbers
Test #23:
score: 0
Accepted
time: 1315ms
memory: 300236kb
input:
20 0 423991 752898 398498 684927 789044 263019 482251 912839 731501 161924 299043 221772 386164 726231 81052 522548 2147 664063 669633 811292 646801 487230 645801 231433 697608 767873 119403 655574 294512 625240 464604 171777 37789 989183 13473 24697 1013507 285860 816836 313163 256565 724812 246357...
output:
0 2 0 1 1 0 0 5 3 0 1 0 0 2 0 1 0 1 0 4 2 0 1 0 0 3 0 1 0 2 1 0 0 2 0 1 3 0 1 0 0 2 1 0 0 1 0 6 4 0 1 0 0 2 0 1 1 0 0 3 1 0 0 2 0 1 2 0 0 3 1 0 0 5 1 0 0 1 2 0 2 0 1 0 1 0 4 0 0 3 0 1 2 0 1 0 0 1 3 0 2 0 0 1 8 0 0 1 1 0 2 0 1 0 0 3 0 1 2 0 4 0 1 0 0 2 1 0 6 0 1 0 1 0 2 0 1 0 0 2 1 0 3 0 0 1 0 4 2 0 ...
result:
ok 1048576 numbers
Test #24:
score: 0
Accepted
time: 1387ms
memory: 302632kb
input:
20 0 983530 824894 353093 559444 613542 519778 1010412 455455 935622 219374 221225 1002197 688110 472174 221344 689249 527925 36045 510374 449980 724144 993684 416271 594751 888484 336792 425268 493926 392740 391689 841678 822738 12764 433848 349413 450603 182285 354617 758953 176599 70237 340919 10...
output:
2 0 0 1 1 0 6 0 1 0 0 3 1 0 0 2 2 0 1 0 0 4 0 1 3 0 0 1 1 0 2 0 0 1 0 2 0 1 4 0 0 1 0 3 0 1 0 2 0 3 0 1 1 0 2 0 0 5 0 1 0 2 0 1 1 0 2 0 0 1 0 4 1 0 0 2 0 1 0 3 0 2 1 0 7 0 1 0 0 3 1 0 0 1 2 0 0 1 2 0 1 0 0 4 0 2 0 1 1 0 0 3 0 2 0 1 0 1 0 3 0 5 1 0 1 0 2 0 4 0 0 1 0 2 0 1 2 0 1 0 3 0 1 0 1 0 6 0 0 2 ...
result:
ok 1048576 numbers
Test #25:
score: 0
Accepted
time: 1406ms
memory: 306416kb
input:
20 0 473443 822631 836606 745020 669384 831958 929557 812459 979454 261979 335172 118201 544502 229223 877541 915721 504368 226689 582157 166448 910835 805293 989769 735782 836472 212234 901652 203944 246343 341883 923372 761793 496413 774045 10709 822705 804842 393237 234688 760980 575433 264037 29...
output:
0 1 2 0 0 1 3 0 4 0 1 0 1 0 0 2 1 0 2 0 1 0 5 0 1 0 2 0 0 1 3 0 0 1 0 3 2 0 0 1 1 0 0 6 2 0 0 1 0 1 0 2 0 1 0 3 1 0 2 0 0 4 0 1 0 1 8 0 2 0 1 0 1 0 0 3 2 0 0 1 0 1 0 3 0 2 1 0 2 0 0 1 1 0 0 4 1 0 3 0 1 0 2 0 2 0 0 1 4 0 0 1 2 0 1 0 1 0 3 0 0 2 1 0 0 1 5 0 2 0 1 0 0 4 1 0 3 0 0 1 1 0 0 2 0 6 0 1 2 0 ...
result:
ok 1048576 numbers
Test #26:
score: 0
Accepted
time: 1403ms
memory: 306116kb
input:
20 0 379980 596897 473700 685210 871737 592347 265581 99773 654162 711671 796026 221716 77951 211806 1016499 68541 105291 832026 37890 741817 787 338525 847057 564452 291439 25137 796527 274136 516811 336906 65693 431115 565546 913432 505987 731031 411514 962171 317881 69424 7338 181350 326333 89987...
output:
0 1 0 2 3 0 1 0 0 1 2 0 0 1 5 0 0 2 0 1 0 1 4 0 1 0 3 0 2 0 0 1 0 2 0 1 0 4 1 0 0 1 0 3 1 0 2 0 0 6 0 1 2 0 1 0 0 1 2 0 0 3 1 0 0 3 1 0 0 1 2 0 0 2 0 1 4 0 1 0 0 3 0 1 2 0 1 0 1 0 0 2 1 0 5 0 2 0 0 1 1 0 4 0 0 1 0 3 2 0 1 0 1 0 0 2 1 0 3 0 0 1 2 0 1 0 0 8 0 3 1 0 0 2 1 0 1 0 0 2 5 0 1 0 0 1 0 2 1 0 ...
result:
ok 1048576 numbers
Test #27:
score: -100
Time Limit Exceeded
input:
20 966077 920272 22829 905052 391939 529694 220017 113245 305146 1033496 776070 372388 649193 372732 578999 535089 376914 300958 674096 713438 294435 185108 175377 843411 186645 326129 937577 777304 855769 317353 63291 166972 152975 982092 882338 296632 371732 94559 247688 915006 853946 1012694 9336...
output:
19 14 19 18 19 17 16 18 19 19 18 19 18 19 19 18 18 19 19 18 17 17 19 17 18 19 19 19 18 15 17 17 19 19 18 18 16 17 19 19 19 19 19 18 19 19 18 18 17 19 18 19 8 19 17 19 18 15 18 18 19 19 18 19 18 18 19 19 18 19 18 15 19 19 19 19 19 19 19 19 18 19 19 19 18 19 19 19 19 19 18 19 19 19 19 18 19 19 17 10 1...