QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#569514#9317. RivalsWilson_InversionAC ✓1054ms123884kbC++204.4kb2024-09-16 23:57:312024-09-16 23:57:32

Judging History

你现在查看的是最新测评结果

  • [2024-09-16 23:57:32]
  • 评测
  • 测评结果:AC
  • 用时:1054ms
  • 内存:123884kb
  • [2024-09-16 23:57:31]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
namespace Wilson_Inversion {
    void main();
}
int main() {
    return Wilson_Inversion::main(), 0;
}
namespace Wilson_Inversion {

typedef long long i64;

#define int long long

const int mod = 998244353;

int n, c, a[40], dp[2][310][40][310][2], fac[310], inv[310], ifac[310], pw[310], npw[310], mg[310];

void add(int& x, int y) {
    x += y;
    if (x >= mod) x -= mod;
}

int qp(int x, int y) {
    int res = 1;
    while (y) {
        if (y & 1) (res *= x) %= mod;
        (x *= x) %= mod;
        y >>= 1;
    }
    return res;
}

void solve() {
    cin >> n >> c;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    fac[0] = fac[1] = ifac[0] = ifac[1] = inv[1] = 1;
    pw[0] = npw[0] = 1;
    mg[0] = 1;
    for (int i = 2; i <= 300; ++i) {
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = (mod - mod / i) * inv[mod % i] % mod;
        ifac[i] = ifac[i - 1] * inv[i] % mod;
    }
    for (int i = 1; i <= 300; ++i) pw[i] = pw[i - 1] * n % mod, npw[i] = npw[i - 1] * inv[n] % mod, mg[i] = npw[i] * ifac[i] % mod;
    int t = 0;
    for (int i = 1; i <= c; ++i) t += a[i];
    for (int i = 1; i < t; ++i) cout << "0 ";
    int tot = 0;
    for (int i = 1; i <= n; ++i) tot += a[i];
    bool op = 0;
    dp[0][0][0][0][0] = 1;
    int ts = 0;
    for (int i = 1; i <= c; ++i) {
        op ^= 1;
        memset(dp[op], 0, sizeof(dp[op]));
        for (int j = ts; j <= ts; ++j) {
            for (int k = 0; k < i; ++k) {
                for(int l = 0; l <= tot; ++l) {
                    if (dp[op^1][j][k][l][0]) {
                        add(dp[op][j+a[i]][k+1][l][0], dp[op^1][j][k][l][0]);
                        for (int m = 0; m < a[i]; ++m) add(dp[op][j+a[i]][k][l+m][0], (mod - dp[op^1][j][k][l][0] * mg[m] % mod) % mod);
                        add(dp[op][j+a[i]][k][l+a[i]-1][1], dp[op^1][j][k][l][0] * mg[a[i]-1] % mod);
                    }
                    if (dp[op^1][j][k][l][1]) {
                        add(dp[op][j+a[i]][k+1][l][1], dp[op^1][j][k][l][1]);
                        for (int m = 0; m < a[i]; ++m) add(dp[op][j+a[i]][k][l+m][1], (mod - dp[op^1][j][k][l][1] * mg[m] % mod) % mod);
                    }
                }
            }
        }
        ts += a[i];
    }
    for (int i = c + 1; i <= n; ++i) {
        op ^= 1;
        memset(dp[op], 0, sizeof(dp[op]));
        for (int j = 0; j < a[i]; ++j) {
            for (int k = 0; k <= ts; ++k) {
                for (int l = 0; l < i; ++l) {
                    for (int m = 0; m <= tot; ++m) {
                        if (dp[op^1][k][l][m][0]) {
                            add(dp[op][k+j][l][m+j][0], dp[op^1][k][l][m][0] * mg[j] % mod);
                            if (j > 0) add(dp[op][k+j][l][m+j-1][1], dp[op^1][k][l][m][0] * mg[j-1] % mod);
                        }
                        if (dp[op^1][k][l][m][1]) add(dp[op][k+j][l][m+j][1], dp[op^1][k][l][m][1] * mg[j] % mod);
                    }
                }
            }
        }
        for (int j = 0; j <= ts; ++j) {
            for (int k = 0; k < i; ++k) {
                for(int l = 0; l <= tot; ++l) {
                    if (dp[op^1][j][k][l][0]) {
                        add(dp[op][j+a[i]][k+1][l][0], dp[op^1][j][k][l][0]);
                        for (int m = 0; m < a[i]; ++m) add(dp[op][j+a[i]][k][l+m][0], (mod - dp[op^1][j][k][l][0] * mg[m] % mod) % mod);
                        add(dp[op][j+a[i]][k][l+a[i]-1][1], dp[op^1][j][k][l][0] * mg[a[i]-1] % mod);
                    }
                    if (dp[op^1][j][k][l][1]) {
                        add(dp[op][j+a[i]][k+1][l][1], dp[op^1][j][k][l][1]);
                        for (int m = 0; m < a[i]; ++m) add(dp[op][j+a[i]][k][l+m][1], (mod - dp[op^1][j][k][l][1] * mg[m] % mod) % mod);
                    }
                }
            }
        }
        ts += a[i];
    }
    for (int i = t; i <= tot; ++i) {
        int ans = 0;
        for (int j = 0; j <= n; ++j) {
            for (int k = 0; k <= tot; ++k) {
                (ans += (dp[op][i][j][k][1] * qp(qp(mod + 1 - j * inv[n] % mod, mod - 2), k + 1)) % mod * fac[k]) %= mod;
            }
        }
        cout << ans * inv[n] % mod << ' ';
    }
}

void main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int T = 1;
    // cin >> T;
    while (T--) solve();
}

}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 21ms
memory: 123756kb

input:

5 3
1 1 1 1 1

output:

0 0 299473306 199648871 1 

result:

ok 5 tokens

Test #2:

score: 0
Accepted
time: 30ms
memory: 123828kb

input:

8 5
3 5 3 2 2 5 4 4

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 851829480 293319617 603094447 451112091 433952646 112377604 425219038 332689344 62257787 407546627 163509571 467949711 235335868 1 

result:

ok 28 tokens

Test #3:

score: 0
Accepted
time: 248ms
memory: 123816kb

input:

30 17
1 8 9 3 2 6 6 9 5 9 1 2 1 3 3 1 1 5 7 1 2 5 5 7 3 3 4 7 5 6

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 447486792 435664782 192289330 927851817 610835375 240199921 954404690 368032120 126246490 646683498 959653535 111169893 486702262 177564172 129608751 316471586 15...

result:

ok 130 tokens

Test #4:

score: 0
Accepted
time: 138ms
memory: 123832kb

input:

30 30
10 6 2 10 9 8 7 7 6 3 2 10 3 1 7 3 10 5 7 8 1 2 6 9 4 10 7 2 4 6

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 175 tokens

Test #5:

score: 0
Accepted
time: 342ms
memory: 123804kb

input:

30 7
1 9 9 3 4 10 10 5 1 7 4 8 4 6 5 3 10 2 9 1 7 8 9 5 3 2 8 9 2 3

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 311496820 499666765 630363357 200815652 478731250 563563105 904410939 359168424 159921516 730782365 533649576 466554126 613409778 366032974 368023629 180857116 312368663 648502485 56431638 486226992 358007354 6...

result:

ok 167 tokens

Test #6:

score: 0
Accepted
time: 184ms
memory: 123820kb

input:

30 27
10 4 3 9 2 2 5 2 10 7 2 6 7 5 6 5 6 7 9 5 8 8 5 6 4 7 3 7 8 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 178 tokens

Test #7:

score: 0
Accepted
time: 406ms
memory: 123760kb

input:

30 3
4 9 4 5 10 8 6 10 4 6 4 6 2 2 5 4 2 6 6 8 9 9 4 5 5 2 8 4 8 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 551627658 476758103 20713911 713661666 289585584 661351456 949896193 135296607 800281711 316368950 365875349 754011197 764188129 358123873 682559259 996711429 117612995 254713355 916779199 653868710 36434508 631499492 596522864 765406164 292607513 883610913 347046723 ...

result:

ok 175 tokens

Test #8:

score: 0
Accepted
time: 166ms
memory: 123748kb

input:

30 27
2 10 4 9 5 6 9 4 5 2 7 5 8 5 5 6 9 6 10 6 3 6 8 8 5 8 9 7 2 5

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 184 tokens

Test #9:

score: 0
Accepted
time: 410ms
memory: 123836kb

input:

30 1
5 7 6 6 3 4 5 4 3 4 10 6 4 4 4 3 6 5 6 4 5 10 5 10 8 3 10 8 8 7

output:

0 0 0 0 382782877 70037351 959915161 218622398 248509455 139984326 256819542 406888868 965183760 752781498 624493330 609556130 412499423 477282458 956054367 310640551 782555851 419457807 892978125 232701409 799777023 768536441 819211398 713808031 531781933 627712700 575014071 258363792 682704840 864...

result:

ok 173 tokens

Test #10:

score: 0
Accepted
time: 230ms
memory: 123804kb

input:

30 24
5 3 6 8 6 8 9 6 7 4 3 4 8 9 5 4 5 3 4 8 8 10 9 3 5 7 10 9 4 7

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 234828639 87...

result:

ok 187 tokens

Test #11:

score: 0
Accepted
time: 509ms
memory: 123832kb

input:

30 6
3 3 8 6 4 8 10 6 3 6 4 3 10 6 9 10 3 9 10 8 8 3 7 10 9 9 7 4 8 8

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 319892531 68430074 910198666 121268889 171669007 711189879 771790292 326409722 18272281 902397744 180033684 192241313 185136257 793039882 782650786 791643453 875820452 262188156 103150416 604650668 708171740 93125131 708895592 140273579 7...

result:

ok 202 tokens

Test #12:

score: 0
Accepted
time: 552ms
memory: 123876kb

input:

30 5
7 9 10 5 4 7 9 4 6 10 4 10 6 4 4 10 9 4 6 5 8 8 10 10 7 9 10 4 5 7

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 811266735 618056498 797849613 182676338 207956047 57079934 590529409 25963140 115687367 372946288 587249452 451588512 390683822 743109044 718754565 295996422 75798614 85395425 685713518 588385389 44884495 119856368 116030099 5327317...

result:

ok 211 tokens

Test #13:

score: 0
Accepted
time: 294ms
memory: 123816kb

input:

30 24
8 5 10 9 10 10 5 10 9 7 9 8 8 9 9 8 6 9 6 4 8 6 10 4 9 9 7 6 7 8

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 233 tokens

Test #14:

score: 0
Accepted
time: 368ms
memory: 123804kb

input:

30 16
10 9 8 10 6 4 5 6 5 10 5 7 6 6 6 7 7 5 8 9 7 6 5 7 10 4 5 8 5 5

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 741215437 674604005 362402114 554911338 873897763 513722379 445027498 263555975 13...

result:

ok 201 tokens

Test #15:

score: 0
Accepted
time: 236ms
memory: 123836kb

input:

30 26
9 6 8 5 5 7 9 6 10 8 5 6 9 6 9 5 6 6 10 10 5 6 8 9 8 10 10 9 7 6

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 223 tokens

Test #16:

score: 0
Accepted
time: 554ms
memory: 123876kb

input:

30 7
6 8 5 8 6 5 5 7 9 6 5 9 8 5 10 5 10 10 9 8 6 5 8 9 8 5 9 6 7 6

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 120014486 387528422 900687061 367179564 725919234 839181478 168026598 76267256 248308001 742564647 606523209 188147390 24678933 85523200 529677524 646577608 154473150 544131238 252260853 355196669 669267589 597554021...

result:

ok 213 tokens

Test #17:

score: 0
Accepted
time: 557ms
memory: 123820kb

input:

30 9
6 8 10 6 10 5 9 9 7 8 5 8 6 8 8 5 10 7 5 10 9 5 8 10 5 10 6 5 7 8

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 52185470 137583355 808616284 161088504 559671658 77973461 828436413 695100926 590157749 765398276 457842001 164834230 435815043 218421346 198837133 186034109 2464...

result:

ok 223 tokens

Test #18:

score: 0
Accepted
time: 417ms
memory: 123884kb

input:

30 20
6 8 8 10 7 6 10 10 7 9 6 9 8 10 8 7 10 6 10 9 7 10 8 9 8 6 7 6 9 7

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 241 tokens

Test #19:

score: 0
Accepted
time: 681ms
memory: 123836kb

input:

30 3
8 9 8 7 9 6 7 7 9 6 6 9 6 10 6 10 10 9 9 7 10 8 8 8 6 7 9 6 7 8

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 195627681 146543243 545084188 538685335 178451565 100436201 580123887 751418583 418816374 345428930 847802885 115087636 408769973 170951560 561578742 607219571 880487956 918062657 618053645 427041436 741510184 451779117 262757043 134070326 261442241 21...

result:

ok 235 tokens

Test #20:

score: 0
Accepted
time: 545ms
memory: 123732kb

input:

30 18
10 10 10 10 10 10 9 6 9 9 10 7 9 8 6 9 10 6 10 7 9 9 9 9 8 10 10 9 7 6

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 261 tokens

Test #21:

score: 0
Accepted
time: 779ms
memory: 123812kb

input:

30 2
10 8 9 9 7 7 10 7 9 7 7 8 10 9 8 8 10 9 7 7 8 10 7 7 10 7 8 8 8 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 559190402 590909428 277036637 957034433 989793942 9210686 634172879 526230344 709529805 893863736 569125798 164424607 877281061 328188027 636906769 744002892 792495178 265477808 316703740 530414448 576387299 37808344 582705830 929136756 725579948 21743034 745713779 ...

result:

ok 249 tokens

Test #22:

score: 0
Accepted
time: 729ms
memory: 123816kb

input:

30 7
9 8 9 8 9 10 10 7 10 8 10 8 7 9 7 7 8 10 10 7 7 9 7 10 7 9 10 7 8 7

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 894396662 32606647 847488151 672568142 396431552 18592253 496101956 797327389 553083927 929386416 309685402 728511545 358757451 510115161 914478605 789205363 831958008 12436520...

result:

ok 252 tokens

Test #23:

score: 0
Accepted
time: 617ms
memory: 123800kb

input:

30 16
9 10 7 10 10 8 9 7 8 9 7 7 7 8 7 9 10 8 8 7 10 10 10 10 7 8 10 9 8 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 751824431 537425942 853408085 28877066...

result:

ok 257 tokens

Test #24:

score: 0
Accepted
time: 176ms
memory: 123808kb

input:

30 29
8 10 8 10 8 8 10 9 9 10 10 10 9 8 9 8 8 9 9 8 8 9 9 10 9 10 10 9 10 8

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 270 tokens

Test #25:

score: 0
Accepted
time: 243ms
memory: 123808kb

input:

30 27
10 9 9 8 8 8 8 9 8 8 8 10 9 9 8 9 8 9 10 9 10 8 8 9 9 9 9 8 9 9

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 262 tokens

Test #26:

score: 0
Accepted
time: 779ms
memory: 123828kb

input:

30 10
10 9 8 10 9 10 8 10 8 8 8 8 10 9 10 10 9 8 9 8 9 9 8 8 8 10 9 8 10 8

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 708567150 824663493 976594397 138161071 562314120 294566307 300891204 848596426 490814883 97617704 574767639 525764274 479...

result:

ok 266 tokens

Test #27:

score: 0
Accepted
time: 830ms
memory: 123872kb

input:

30 13
9 10 10 10 9 10 9 9 9 10 10 10 10 9 10 10 9 10 10 10 9 10 10 10 9 10 9 9 9 9

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 567784354 577039244 626009358 123914333 607022074 25...

result:

ok 287 tokens

Test #28:

score: 0
Accepted
time: 509ms
memory: 123804kb

input:

30 22
9 10 9 9 9 9 9 10 9 10 9 9 9 10 10 10 10 10 10 9 10 10 10 9 10 9 10 10 10 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 287 tokens

Test #29:

score: 0
Accepted
time: 316ms
memory: 123828kb

input:

30 26
10 9 9 9 10 10 9 9 9 10 9 10 10 10 10 10 10 10 10 9 9 10 9 9 9 9 10 10 9 9

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 285 tokens

Test #30:

score: 0
Accepted
time: 637ms
memory: 123812kb

input:

30 20
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 300 tokens

Test #31:

score: 0
Accepted
time: 1054ms
memory: 123760kb

input:

30 9
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 492210536 498259261 557229146 875267115 985435937 209446446 176766370 453884819 488532245 417980453 420676331 240576557 95...

result:

ok 300 tokens

Test #32:

score: 0
Accepted
time: 340ms
memory: 123832kb

input:

30 26
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 300 tokens

Extra Test:

score: 0
Extra Test Passed