QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#592283 | #7420. K-pop Strings | wsyear | AC ✓ | 3995ms | 3936kb | C++23 | 3.4kb | 2024-09-26 21:45:13 | 2024-09-26 21:45:13 |
Judging History
answer
// Author: Klay Thompson
// Problem: K. K-pop Strings
// Memory Limit: 2048 MB
// Time Limit: 7000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
#define rep(i, j, k) for (int i = (j); i <= (k); ++i)
#define per(i, j, k) for (int i = (j); i >= (k); --i)
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
using ll = long long;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
template<class T>inline void chkmn(T &x, T y) { if (y < x) x = y; }
template<class T>inline void chkmx(T &x, T y) { if (y > x) x = y; }
using namespace std;
template <int P>
class mod_int {
using Z = mod_int;
private:
static int mo(int x) { return x < 0 ? x + P : x; }
public:
int x;
int val() const { return x; }
mod_int() : x(0) {}
template <class T>
mod_int(const T &x_) : x(x_ >= 0 && x_ < P ? static_cast<int>(x_) : mo(static_cast<int>(x_ % P))) {}
bool operator==(const Z &rhs) const { return x == rhs.x; }
bool operator!=(const Z &rhs) const { return x != rhs.x; }
Z operator-() const { return Z(x ? P - x : 0); }
Z pow(long long k) const {
Z res = 1, t = *this;
while (k) {
if (k & 1) res *= t;
if (k >>= 1) t *= t;
}
return res;
}
Z &operator++() {
x < P - 1 ? ++x : x = 0;
return *this;
}
Z &operator--() {
x ? --x : x = P - 1;
return *this;
}
Z operator++(int) {
Z ret = x;
x < P - 1 ? ++x : x = 0;
return ret;
}
Z operator--(int) {
Z ret = x;
x ? --x : x = P - 1;
return ret;
}
Z inv() const { return pow(P - 2); }
Z &operator+=(const Z &rhs) {
(x += rhs.x) >= P && (x -= P);
return *this;
}
Z &operator-=(const Z &rhs) {
(x -= rhs.x) < 0 && (x += P);
return *this;
}
Z &operator*=(const Z &rhs) {
x = 1ULL * x * rhs.x % P;
return *this;
}
Z &operator/=(const Z &rhs) { return *this *= rhs.inv(); }
#define setO(T, o) \
friend T operator o(const Z &lhs, const Z &rhs) {\
Z res = lhs; \
return res o## = rhs; \
}
setO(Z, +) setO(Z, -) setO(Z, *) setO(Z, /)
#undef setO
};
const int P = 998244353;
using Z = mod_int<P>;
const int maxn = 110;
int n, k, fa[maxn], cnt;
vector<vector<pii>> vec;
Z ans;
mt19937 rnd(random_device{}());
int find(int x) {
return fa[x] == x ? x : fa[x] = find(fa[x]);
}
void dfs(int dep, Z coe) {
if (dep == SZ(vec)) return ans += coe * Z(35).pow(cnt), void();
int ok = 0;
for (auto [x, y] : vec[dep]) ok |= (find(x) != find(y));
if (!ok) return;
dfs(dep + 1, coe);
int cfa[maxn];
rep (i, 1, n) cfa[i] = fa[i];
int dlt = 0;
for (auto [x, y] : vec[dep]) if (find(x) != find(y)) dlt++, fa[find(x)] = find(y);
cnt -= dlt;
dfs(dep + 1, P - coe);
cnt += dlt;
rep (i, 1, n) fa[i] = cfa[i];
}
int main() {
cin.tie(nullptr) -> ios::sync_with_stdio(false);
cin >> n >> k;
rep (len, max(2, n - k), n) {
if (len & 1) continue;
rep (i, 1, n - len + 1) {
vector<pii> cur;
rep (j, 1, len / 2) cur.emplace_back(i + j - 1, i + len / 2 + j - 1);
vec.emplace_back(cur);
}
}
cerr << SZ(vec) << endl;
// shuffle(ALL(vec), rnd);
reverse(ALL(vec));
rep (i, 1, n) fa[i] = i;
cnt = n, dfs(0, 1);
cout << ans.val() << '\n';
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
1 16
output:
35
result:
ok 1 number(s): "35"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
4 0
output:
1499400
result:
ok 1 number(s): "1499400"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
15 5
output:
911125634
result:
ok 1 number(s): "911125634"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
35 5
output:
93640047
result:
ok 1 number(s): "93640047"
Test #5:
score: 0
Accepted
time: 3995ms
memory: 3692kb
input:
100 16
output:
991183816
result:
ok 1 number(s): "991183816"
Test #6:
score: 0
Accepted
time: 1192ms
memory: 3712kb
input:
22 16
output:
960803400
result:
ok 1 number(s): "960803400"
Test #7:
score: 0
Accepted
time: 1351ms
memory: 3592kb
input:
20 16
output:
235606959
result:
ok 1 number(s): "235606959"
Test #8:
score: 0
Accepted
time: 640ms
memory: 3896kb
input:
17 15
output:
730957706
result:
ok 1 number(s): "730957706"
Test #9:
score: 0
Accepted
time: 606ms
memory: 3864kb
input:
17 16
output:
730957706
result:
ok 1 number(s): "730957706"
Test #10:
score: 0
Accepted
time: 1833ms
memory: 3596kb
input:
18 16
output:
532450312
result:
ok 1 number(s): "532450312"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3472kb
input:
3 15
output:
40460
result:
ok 1 number(s): "40460"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
3 16
output:
40460
result:
ok 1 number(s): "40460"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
4 14
output:
1374450
result:
ok 1 number(s): "1374450"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
4 15
output:
1374450
result:
ok 1 number(s): "1374450"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
4 16
output:
1374450
result:
ok 1 number(s): "1374450"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
5 14
output:
46692030
result:
ok 1 number(s): "46692030"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
5 15
output:
46692030
result:
ok 1 number(s): "46692030"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
5 16
output:
46692030
result:
ok 1 number(s): "46692030"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
6 14
output:
587910217
result:
ok 1 number(s): "587910217"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
6 15
output:
587910217
result:
ok 1 number(s): "587910217"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
6 16
output:
587910217
result:
ok 1 number(s): "587910217"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
7 14
output:
975651911
result:
ok 1 number(s): "975651911"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
7 15
output:
975651911
result:
ok 1 number(s): "975651911"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
7 16
output:
975651911
result:
ok 1 number(s): "975651911"
Test #25:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
8 14
output:
640435461
result:
ok 1 number(s): "640435461"
Test #26:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
8 15
output:
640435461
result:
ok 1 number(s): "640435461"
Test #27:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
8 16
output:
640435461
result:
ok 1 number(s): "640435461"
Test #28:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
9 14
output:
835601883
result:
ok 1 number(s): "835601883"
Test #29:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
9 15
output:
835601883
result:
ok 1 number(s): "835601883"
Test #30:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
9 16
output:
835601883
result:
ok 1 number(s): "835601883"
Test #31:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
10 14
output:
817470300
result:
ok 1 number(s): "817470300"
Test #32:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
10 15
output:
817470300
result:
ok 1 number(s): "817470300"
Test #33:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
10 16
output:
817470300
result:
ok 1 number(s): "817470300"
Test #34:
score: 0
Accepted
time: 1ms
memory: 3836kb
input:
11 14
output:
53700186
result:
ok 1 number(s): "53700186"
Test #35:
score: 0
Accepted
time: 1ms
memory: 3872kb
input:
11 15
output:
53700186
result:
ok 1 number(s): "53700186"
Test #36:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
11 16
output:
53700186
result:
ok 1 number(s): "53700186"
Test #37:
score: 0
Accepted
time: 3ms
memory: 3576kb
input:
12 14
output:
98056471
result:
ok 1 number(s): "98056471"
Test #38:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
12 15
output:
98056471
result:
ok 1 number(s): "98056471"
Test #39:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
12 16
output:
98056471
result:
ok 1 number(s): "98056471"
Test #40:
score: 0
Accepted
time: 8ms
memory: 3848kb
input:
13 14
output:
859256927
result:
ok 1 number(s): "859256927"
Test #41:
score: 0
Accepted
time: 8ms
memory: 3872kb
input:
13 15
output:
859256927
result:
ok 1 number(s): "859256927"
Test #42:
score: 0
Accepted
time: 8ms
memory: 3644kb
input:
13 16
output:
859256927
result:
ok 1 number(s): "859256927"
Test #43:
score: 0
Accepted
time: 22ms
memory: 3588kb
input:
14 14
output:
241086631
result:
ok 1 number(s): "241086631"
Test #44:
score: 0
Accepted
time: 22ms
memory: 3652kb
input:
14 15
output:
241086631
result:
ok 1 number(s): "241086631"
Test #45:
score: 0
Accepted
time: 22ms
memory: 3580kb
input:
14 16
output:
241086631
result:
ok 1 number(s): "241086631"
Test #46:
score: 0
Accepted
time: 65ms
memory: 3816kb
input:
15 14
output:
518906901
result:
ok 1 number(s): "518906901"
Test #47:
score: 0
Accepted
time: 62ms
memory: 3644kb
input:
15 15
output:
518906901
result:
ok 1 number(s): "518906901"
Test #48:
score: 0
Accepted
time: 65ms
memory: 3580kb
input:
15 16
output:
518906901
result:
ok 1 number(s): "518906901"
Test #49:
score: 0
Accepted
time: 188ms
memory: 3660kb
input:
16 14
output:
523929203
result:
ok 1 number(s): "523929203"
Test #50:
score: 0
Accepted
time: 184ms
memory: 3652kb
input:
16 15
output:
523929203
result:
ok 1 number(s): "523929203"
Test #51:
score: 0
Accepted
time: 251ms
memory: 3576kb
input:
16 16
output:
523929203
result:
ok 1 number(s): "523929203"
Test #52:
score: 0
Accepted
time: 61ms
memory: 3816kb
input:
17 14
output:
283163356
result:
ok 1 number(s): "283163356"
Test #53:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
2 15
output:
1190
result:
ok 1 number(s): "1190"
Test #54:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
2 16
output:
1190
result:
ok 1 number(s): "1190"
Test #55:
score: 0
Accepted
time: 173ms
memory: 3660kb
input:
18 14
output:
856842771
result:
ok 1 number(s): "856842771"
Test #56:
score: 0
Accepted
time: 171ms
memory: 3856kb
input:
18 15
output:
856842771
result:
ok 1 number(s): "856842771"
Test #57:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
3 14
output:
40460
result:
ok 1 number(s): "40460"
Test #58:
score: 0
Accepted
time: 68ms
memory: 3648kb
input:
19 14
output:
7934790
result:
ok 1 number(s): "7934790"
Test #59:
score: 0
Accepted
time: 499ms
memory: 3600kb
input:
19 15
output:
200270800
result:
ok 1 number(s): "200270800"
Test #60:
score: 0
Accepted
time: 483ms
memory: 3632kb
input:
19 16
output:
200270800
result:
ok 1 number(s): "200270800"
Test #61:
score: 0
Accepted
time: 174ms
memory: 3628kb
input:
20 14
output:
548507915
result:
ok 1 number(s): "548507915"
Test #62:
score: 0
Accepted
time: 179ms
memory: 3596kb
input:
20 15
output:
548507915
result:
ok 1 number(s): "548507915"
Test #63:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
2 14
output:
1190
result:
ok 1 number(s): "1190"
Test #64:
score: 0
Accepted
time: 67ms
memory: 3584kb
input:
21 14
output:
870542379
result:
ok 1 number(s): "870542379"
Test #65:
score: 0
Accepted
time: 457ms
memory: 3892kb
input:
21 15
output:
772538126
result:
ok 1 number(s): "772538126"
Test #66:
score: 0
Accepted
time: 459ms
memory: 3588kb
input:
21 16
output:
772538126
result:
ok 1 number(s): "772538126"
Test #67:
score: 0
Accepted
time: 170ms
memory: 3592kb
input:
22 14
output:
367190876
result:
ok 1 number(s): "367190876"
Test #68:
score: 0
Accepted
time: 167ms
memory: 3696kb
input:
22 15
output:
367190876
result:
ok 1 number(s): "367190876"
Test #69:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
1 15
output:
35
result:
ok 1 number(s): "35"
Test #70:
score: 0
Accepted
time: 69ms
memory: 3632kb
input:
23 14
output:
926139921
result:
ok 1 number(s): "926139921"
Test #71:
score: 0
Accepted
time: 430ms
memory: 3632kb
input:
23 15
output:
837524370
result:
ok 1 number(s): "837524370"
Test #72:
score: 0
Accepted
time: 427ms
memory: 3604kb
input:
23 16
output:
837524370
result:
ok 1 number(s): "837524370"
Test #73:
score: 0
Accepted
time: 181ms
memory: 3592kb
input:
24 14
output:
653211440
result:
ok 1 number(s): "653211440"
Test #74:
score: 0
Accepted
time: 180ms
memory: 3860kb
input:
24 15
output:
653211440
result:
ok 1 number(s): "653211440"
Test #75:
score: 0
Accepted
time: 1060ms
memory: 3708kb
input:
24 16
output:
625596476
result:
ok 1 number(s): "625596476"
Test #76:
score: 0
Accepted
time: 71ms
memory: 3896kb
input:
25 14
output:
210481423
result:
ok 1 number(s): "210481423"
Test #77:
score: 0
Accepted
time: 452ms
memory: 3664kb
input:
25 15
output:
459501483
result:
ok 1 number(s): "459501483"
Test #78:
score: 0
Accepted
time: 449ms
memory: 3664kb
input:
25 16
output:
459501483
result:
ok 1 number(s): "459501483"
Test #79:
score: 0
Accepted
time: 176ms
memory: 3600kb
input:
26 14
output:
700174844
result:
ok 1 number(s): "700174844"
Test #80:
score: 0
Accepted
time: 179ms
memory: 3592kb
input:
26 15
output:
700174844
result:
ok 1 number(s): "700174844"
Test #81:
score: 0
Accepted
time: 1117ms
memory: 3608kb
input:
26 16
output:
122186674
result:
ok 1 number(s): "122186674"
Test #82:
score: 0
Accepted
time: 84ms
memory: 3592kb
input:
27 14
output:
913367039
result:
ok 1 number(s): "913367039"
Test #83:
score: 0
Accepted
time: 431ms
memory: 3904kb
input:
27 15
output:
186251380
result:
ok 1 number(s): "186251380"
Test #84:
score: 0
Accepted
time: 425ms
memory: 3712kb
input:
27 16
output:
186251380
result:
ok 1 number(s): "186251380"
Test #85:
score: 0
Accepted
time: 213ms
memory: 3892kb
input:
28 14
output:
983307681
result:
ok 1 number(s): "983307681"
Test #86:
score: 0
Accepted
time: 209ms
memory: 3532kb
input:
28 15
output:
983307681
result:
ok 1 number(s): "983307681"
Test #87:
score: 0
Accepted
time: 1034ms
memory: 3908kb
input:
28 16
output:
927000585
result:
ok 1 number(s): "927000585"
Test #88:
score: 0
Accepted
time: 81ms
memory: 3824kb
input:
29 14
output:
882936948
result:
ok 1 number(s): "882936948"
Test #89:
score: 0
Accepted
time: 505ms
memory: 3536kb
input:
29 15
output:
722751349
result:
ok 1 number(s): "722751349"
Test #90:
score: 0
Accepted
time: 505ms
memory: 3668kb
input:
29 16
output:
722751349
result:
ok 1 number(s): "722751349"
Test #91:
score: 0
Accepted
time: 200ms
memory: 3856kb
input:
30 14
output:
108117242
result:
ok 1 number(s): "108117242"
Test #92:
score: 0
Accepted
time: 199ms
memory: 3648kb
input:
30 15
output:
108117242
result:
ok 1 number(s): "108117242"
Test #93:
score: 0
Accepted
time: 1212ms
memory: 3604kb
input:
30 16
output:
193651384
result:
ok 1 number(s): "193651384"
Test #94:
score: 0
Accepted
time: 95ms
memory: 3620kb
input:
31 14
output:
513230800
result:
ok 1 number(s): "513230800"
Test #95:
score: 0
Accepted
time: 476ms
memory: 3604kb
input:
31 15
output:
674328439
result:
ok 1 number(s): "674328439"
Test #96:
score: 0
Accepted
time: 482ms
memory: 3896kb
input:
31 16
output:
674328439
result:
ok 1 number(s): "674328439"
Test #97:
score: 0
Accepted
time: 235ms
memory: 3532kb
input:
32 14
output:
416220793
result:
ok 1 number(s): "416220793"
Test #98:
score: 0
Accepted
time: 233ms
memory: 3528kb
input:
32 15
output:
416220793
result:
ok 1 number(s): "416220793"
Test #99:
score: 0
Accepted
time: 1166ms
memory: 3572kb
input:
32 16
output:
320541366
result:
ok 1 number(s): "320541366"
Test #100:
score: 0
Accepted
time: 98ms
memory: 3896kb
input:
33 14
output:
621313042
result:
ok 1 number(s): "621313042"
Test #101:
score: 0
Accepted
time: 574ms
memory: 3540kb
input:
33 15
output:
344434925
result:
ok 1 number(s): "344434925"
Test #102:
score: 0
Accepted
time: 572ms
memory: 3608kb
input:
33 16
output:
344434925
result:
ok 1 number(s): "344434925"
Test #103:
score: 0
Accepted
time: 237ms
memory: 3828kb
input:
34 14
output:
456772536
result:
ok 1 number(s): "456772536"
Test #104:
score: 0
Accepted
time: 240ms
memory: 3860kb
input:
34 15
output:
456772536
result:
ok 1 number(s): "456772536"
Test #105:
score: 0
Accepted
time: 1368ms
memory: 3608kb
input:
34 16
output:
41377116
result:
ok 1 number(s): "41377116"
Test #106:
score: 0
Accepted
time: 112ms
memory: 3588kb
input:
35 14
output:
19615141
result:
ok 1 number(s): "19615141"
Test #107:
score: 0
Accepted
time: 570ms
memory: 3668kb
input:
35 15
output:
746309694
result:
ok 1 number(s): "746309694"
Test #108:
score: 0
Accepted
time: 566ms
memory: 3640kb
input:
35 16
output:
746309694
result:
ok 1 number(s): "746309694"
Test #109:
score: 0
Accepted
time: 270ms
memory: 3828kb
input:
36 14
output:
393489643
result:
ok 1 number(s): "393489643"
Test #110:
score: 0
Accepted
time: 270ms
memory: 3700kb
input:
36 15
output:
393489643
result:
ok 1 number(s): "393489643"
Test #111:
score: 0
Accepted
time: 1366ms
memory: 3680kb
input:
36 16
output:
441641679
result:
ok 1 number(s): "441641679"
Test #112:
score: 0
Accepted
time: 100ms
memory: 3592kb
input:
37 14
output:
46923435
result:
ok 1 number(s): "46923435"
Test #113:
score: 0
Accepted
time: 641ms
memory: 3604kb
input:
37 15
output:
886630375
result:
ok 1 number(s): "886630375"
Test #114:
score: 0
Accepted
time: 642ms
memory: 3672kb
input:
37 16
output:
886630375
result:
ok 1 number(s): "886630375"
Test #115:
score: 0
Accepted
time: 251ms
memory: 3648kb
input:
38 14
output:
449547036
result:
ok 1 number(s): "449547036"
Test #116:
score: 0
Accepted
time: 251ms
memory: 3596kb
input:
38 15
output:
449547036
result:
ok 1 number(s): "449547036"
Test #117:
score: 0
Accepted
time: 1528ms
memory: 3716kb
input:
38 16
output:
812627363
result:
ok 1 number(s): "812627363"
Test #118:
score: 0
Accepted
time: 133ms
memory: 3852kb
input:
39 14
output:
719463683
result:
ok 1 number(s): "719463683"
Test #119:
score: 0
Accepted
time: 596ms
memory: 3612kb
input:
39 15
output:
741109614
result:
ok 1 number(s): "741109614"
Test #120:
score: 0
Accepted
time: 595ms
memory: 3668kb
input:
39 16
output:
741109614
result:
ok 1 number(s): "741109614"
Test #121:
score: 0
Accepted
time: 321ms
memory: 3704kb
input:
40 14
output:
578267772
result:
ok 1 number(s): "578267772"
Test #122:
score: 0
Accepted
time: 316ms
memory: 3656kb
input:
40 15
output:
578267772
result:
ok 1 number(s): "578267772"
Test #123:
score: 0
Accepted
time: 1394ms
memory: 3936kb
input:
40 16
output:
87606680
result:
ok 1 number(s): "87606680"
Test #124:
score: 0
Accepted
time: 120ms
memory: 3892kb
input:
41 14
output:
236787740
result:
ok 1 number(s): "236787740"
Test #125:
score: 0
Accepted
time: 769ms
memory: 3604kb
input:
41 15
output:
38008293
result:
ok 1 number(s): "38008293"
Test #126:
score: 0
Accepted
time: 770ms
memory: 3596kb
input:
41 16
output:
38008293
result:
ok 1 number(s): "38008293"
Test #127:
score: 0
Accepted
time: 290ms
memory: 3704kb
input:
42 14
output:
733637961
result:
ok 1 number(s): "733637961"
Test #128:
score: 0
Accepted
time: 300ms
memory: 3668kb
input:
42 15
output:
733637961
result:
ok 1 number(s): "733637961"
Test #129:
score: 0
Accepted
time: 1807ms
memory: 3604kb
input:
42 16
output:
434859171
result:
ok 1 number(s): "434859171"
Test #130:
score: 0
Accepted
time: 134ms
memory: 3656kb
input:
43 14
output:
47849093
result:
ok 1 number(s): "47849093"
Test #131:
score: 0
Accepted
time: 683ms
memory: 3716kb
input:
43 15
output:
193064473
result:
ok 1 number(s): "193064473"
Test #132:
score: 0
Accepted
time: 687ms
memory: 3600kb
input:
43 16
output:
193064473
result:
ok 1 number(s): "193064473"
Test #133:
score: 0
Accepted
time: 327ms
memory: 3672kb
input:
44 14
output:
686919557
result:
ok 1 number(s): "686919557"
Test #134:
score: 0
Accepted
time: 327ms
memory: 3904kb
input:
44 15
output:
686919557
result:
ok 1 number(s): "686919557"
Test #135:
score: 0
Accepted
time: 1618ms
memory: 3876kb
input:
44 16
output:
566574323
result:
ok 1 number(s): "566574323"
Test #136:
score: 0
Accepted
time: 136ms
memory: 3904kb
input:
45 14
output:
260321674
result:
ok 1 number(s): "260321674"
Test #137:
score: 0
Accepted
time: 784ms
memory: 3668kb
input:
45 15
output:
506139919
result:
ok 1 number(s): "506139919"
Test #138:
score: 0
Accepted
time: 779ms
memory: 3672kb
input:
45 16
output:
506139919
result:
ok 1 number(s): "506139919"
Test #139:
score: 0
Accepted
time: 329ms
memory: 3604kb
input:
46 14
output:
511432655
result:
ok 1 number(s): "511432655"
Test #140:
score: 0
Accepted
time: 329ms
memory: 3596kb
input:
46 15
output:
511432655
result:
ok 1 number(s): "511432655"
Test #141:
score: 0
Accepted
time: 1849ms
memory: 3624kb
input:
46 16
output:
481315001
result:
ok 1 number(s): "481315001"
Test #142:
score: 0
Accepted
time: 156ms
memory: 3592kb
input:
47 14
output:
384592237
result:
ok 1 number(s): "384592237"
Test #143:
score: 0
Accepted
time: 783ms
memory: 3712kb
input:
47 15
output:
567984582
result:
ok 1 number(s): "567984582"
Test #144:
score: 0
Accepted
time: 786ms
memory: 3708kb
input:
47 16
output:
567984582
result:
ok 1 number(s): "567984582"
Test #145:
score: 0
Accepted
time: 379ms
memory: 3836kb
input:
48 14
output:
892965619
result:
ok 1 number(s): "892965619"
Test #146:
score: 0
Accepted
time: 380ms
memory: 3664kb
input:
48 15
output:
892965619
result:
ok 1 number(s): "892965619"
Test #147:
score: 0
Accepted
time: 1838ms
memory: 3920kb
input:
48 16
output:
212857460
result:
ok 1 number(s): "212857460"
Test #148:
score: 0
Accepted
time: 142ms
memory: 3588kb
input:
49 14
output:
556984122
result:
ok 1 number(s): "556984122"
Test #149:
score: 0
Accepted
time: 910ms
memory: 3608kb
input:
49 15
output:
742291499
result:
ok 1 number(s): "742291499"
Test #150:
score: 0
Accepted
time: 917ms
memory: 3908kb
input:
49 16
output:
742291499
result:
ok 1 number(s): "742291499"
Test #151:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
50 0
output:
28839309
result:
ok 1 number(s): "28839309"
Test #152:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
50 1
output:
28839309
result:
ok 1 number(s): "28839309"
Test #153:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
50 2
output:
978420101
result:
ok 1 number(s): "978420101"
Test #154:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
50 3
output:
978420101
result:
ok 1 number(s): "978420101"
Test #155:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
50 4
output:
874479757
result:
ok 1 number(s): "874479757"
Test #156:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
50 5
output:
874479757
result:
ok 1 number(s): "874479757"
Test #157:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
50 6
output:
552575330
result:
ok 1 number(s): "552575330"
Test #158:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
50 7
output:
552575330
result:
ok 1 number(s): "552575330"
Test #159:
score: 0
Accepted
time: 2ms
memory: 3868kb
input:
50 8
output:
987131197
result:
ok 1 number(s): "987131197"
Test #160:
score: 0
Accepted
time: 2ms
memory: 3504kb
input:
50 9
output:
987131197
result:
ok 1 number(s): "987131197"
Test #161:
score: 0
Accepted
time: 10ms
memory: 3648kb
input:
50 10
output:
167332917
result:
ok 1 number(s): "167332917"
Test #162:
score: 0
Accepted
time: 10ms
memory: 3520kb
input:
50 11
output:
167332917
result:
ok 1 number(s): "167332917"
Test #163:
score: 0
Accepted
time: 70ms
memory: 3584kb
input:
50 12
output:
8338708
result:
ok 1 number(s): "8338708"
Test #164:
score: 0
Accepted
time: 70ms
memory: 3896kb
input:
50 13
output:
8338708
result:
ok 1 number(s): "8338708"
Test #165:
score: 0
Accepted
time: 342ms
memory: 3604kb
input:
50 14
output:
350736024
result:
ok 1 number(s): "350736024"
Test #166:
score: 0
Accepted
time: 342ms
memory: 3664kb
input:
50 15
output:
350736024
result:
ok 1 number(s): "350736024"
Test #167:
score: 0
Accepted
time: 2153ms
memory: 3616kb
input:
50 16
output:
547343798
result:
ok 1 number(s): "547343798"
Test #168:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
99 0
output:
288066947
result:
ok 1 number(s): "288066947"
Test #169:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
99 1
output:
407223503
result:
ok 1 number(s): "407223503"
Test #170:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
99 2
output:
407223503
result:
ok 1 number(s): "407223503"
Test #171:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
99 3
output:
180967522
result:
ok 1 number(s): "180967522"
Test #172:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
99 4
output:
180967522
result:
ok 1 number(s): "180967522"
Test #173:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
99 5
output:
115126923
result:
ok 1 number(s): "115126923"
Test #174:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
99 6
output:
115126923
result:
ok 1 number(s): "115126923"
Test #175:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
99 7
output:
756367923
result:
ok 1 number(s): "756367923"
Test #176:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
99 8
output:
756367923
result:
ok 1 number(s): "756367923"
Test #177:
score: 0
Accepted
time: 8ms
memory: 3880kb
input:
99 9
output:
348304157
result:
ok 1 number(s): "348304157"
Test #178:
score: 0
Accepted
time: 8ms
memory: 3844kb
input:
99 10
output:
348304157
result:
ok 1 number(s): "348304157"
Test #179:
score: 0
Accepted
time: 49ms
memory: 3700kb
input:
99 11
output:
919024542
result:
ok 1 number(s): "919024542"
Test #180:
score: 0
Accepted
time: 54ms
memory: 3592kb
input:
99 12
output:
919024542
result:
ok 1 number(s): "919024542"
Test #181:
score: 0
Accepted
time: 381ms
memory: 3712kb
input:
99 13
output:
618568674
result:
ok 1 number(s): "618568674"
Test #182:
score: 0
Accepted
time: 345ms
memory: 3836kb
input:
99 14
output:
618568674
result:
ok 1 number(s): "618568674"
Test #183:
score: 0
Accepted
time: 1675ms
memory: 3888kb
input:
99 15
output:
161030851
result:
ok 1 number(s): "161030851"
Test #184:
score: 0
Accepted
time: 1673ms
memory: 3692kb
input:
99 16
output:
161030851
result:
ok 1 number(s): "161030851"
Test #185:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
100 0
output:
681164487
result:
ok 1 number(s): "681164487"
Test #186:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
100 1
output:
681164487
result:
ok 1 number(s): "681164487"
Test #187:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
100 2
output:
656785158
result:
ok 1 number(s): "656785158"
Test #188:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
100 3
output:
656785158
result:
ok 1 number(s): "656785158"
Test #189:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
100 4
output:
645848758
result:
ok 1 number(s): "645848758"
Test #190:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
100 5
output:
645848758
result:
ok 1 number(s): "645848758"
Test #191:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
100 6
output:
63066030
result:
ok 1 number(s): "63066030"
Test #192:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
100 7
output:
63066030
result:
ok 1 number(s): "63066030"
Test #193:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
100 8
output:
15459138
result:
ok 1 number(s): "15459138"
Test #194:
score: 0
Accepted
time: 3ms
memory: 3844kb
input:
100 9
output:
15459138
result:
ok 1 number(s): "15459138"
Test #195:
score: 0
Accepted
time: 18ms
memory: 3640kb
input:
100 10
output:
552094543
result:
ok 1 number(s): "552094543"
Test #196:
score: 0
Accepted
time: 24ms
memory: 3892kb
input:
100 11
output:
552094543
result:
ok 1 number(s): "552094543"
Test #197:
score: 0
Accepted
time: 124ms
memory: 3704kb
input:
100 12
output:
436446274
result:
ok 1 number(s): "436446274"
Test #198:
score: 0
Accepted
time: 122ms
memory: 3604kb
input:
100 13
output:
436446274
result:
ok 1 number(s): "436446274"
Test #199:
score: 0
Accepted
time: 840ms
memory: 3680kb
input:
100 14
output:
721859177
result:
ok 1 number(s): "721859177"
Test #200:
score: 0
Accepted
time: 872ms
memory: 3640kb
input:
100 15
output:
721859177
result:
ok 1 number(s): "721859177"
Test #201:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
1 14
output:
35
result:
ok 1 number(s): "35"
Test #202:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1 0
output:
35
result:
ok 1 number(s): "35"
Test #203:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
2 0
output:
1190
result:
ok 1 number(s): "1190"
Test #204:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
3 0
output:
42875
result:
ok 1 number(s): "42875"
Test #205:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
4 0
output:
1499400
result:
ok 1 number(s): "1499400"
Test #206:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
1 1
output:
35
result:
ok 1 number(s): "35"
Test #207:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 1
output:
1190
result:
ok 1 number(s): "1190"
Test #208:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
3 1
output:
40460
result:
ok 1 number(s): "40460"
Test #209:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
4 1
output:
1499400
result:
ok 1 number(s): "1499400"
Test #210:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
5 1
output:
52437350
result:
ok 1 number(s): "52437350"
Test #211:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
2 2
output:
1190
result:
ok 1 number(s): "1190"
Test #212:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
3 2
output:
40460
result:
ok 1 number(s): "40460"
Test #213:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
4 2
output:
1374450
result:
ok 1 number(s): "1374450"
Test #214:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
5 2
output:
52437350
result:
ok 1 number(s): "52437350"
Test #215:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
6 2
output:
835562307
result:
ok 1 number(s): "835562307"
Test #216:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
3 3
output:
40460
result:
ok 1 number(s): "40460"
Test #217:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
4 3
output:
1374450
result:
ok 1 number(s): "1374450"
Test #218:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
5 3
output:
46692030
result:
ok 1 number(s): "46692030"
Test #219:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
6 3
output:
835562307
result:
ok 1 number(s): "835562307"
Test #220:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
7 3
output:
243160728
result:
ok 1 number(s): "243160728"
Test #221:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
4 4
output:
1374450
result:
ok 1 number(s): "1374450"
Test #222:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
5 4
output:
46692030
result:
ok 1 number(s): "46692030"
Test #223:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
6 4
output:
587910217
result:
ok 1 number(s): "587910217"
Test #224:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
7 4
output:
243160728
result:
ok 1 number(s): "243160728"
Test #225:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
8 4
output:
685973492
result:
ok 1 number(s): "685973492"
Test #226:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
5 5
output:
46692030
result:
ok 1 number(s): "46692030"
Test #227:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
6 5
output:
587910217
result:
ok 1 number(s): "587910217"
Test #228:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
7 5
output:
975651911
result:
ok 1 number(s): "975651911"
Test #229:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
8 5
output:
685973492
result:
ok 1 number(s): "685973492"
Test #230:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
9 5
output:
759563643
result:
ok 1 number(s): "759563643"
Test #231:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
6 6
output:
587910217
result:
ok 1 number(s): "587910217"
Test #232:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
7 6
output:
975651911
result:
ok 1 number(s): "975651911"
Test #233:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
8 6
output:
640435461
result:
ok 1 number(s): "640435461"
Test #234:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
9 6
output:
759563643
result:
ok 1 number(s): "759563643"
Test #235:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
10 6
output:
254435821
result:
ok 1 number(s): "254435821"
Test #236:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
7 7
output:
975651911
result:
ok 1 number(s): "975651911"
Test #237:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
8 7
output:
640435461
result:
ok 1 number(s): "640435461"
Test #238:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
9 7
output:
835601883
result:
ok 1 number(s): "835601883"
Test #239:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
10 7
output:
254435821
result:
ok 1 number(s): "254435821"
Test #240:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
11 7
output:
132182305
result:
ok 1 number(s): "132182305"
Test #241:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
8 8
output:
640435461
result:
ok 1 number(s): "640435461"
Test #242:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
9 8
output:
835601883
result:
ok 1 number(s): "835601883"
Test #243:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
10 8
output:
817470300
result:
ok 1 number(s): "817470300"
Test #244:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
11 8
output:
132182305
result:
ok 1 number(s): "132182305"
Test #245:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
12 8
output:
266655880
result:
ok 1 number(s): "266655880"
Test #246:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
9 9
output:
835601883
result:
ok 1 number(s): "835601883"
Test #247:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
10 9
output:
817470300
result:
ok 1 number(s): "817470300"
Test #248:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
11 9
output:
53700186
result:
ok 1 number(s): "53700186"
Test #249:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
12 9
output:
266655880
result:
ok 1 number(s): "266655880"
Test #250:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
13 9
output:
287356847
result:
ok 1 number(s): "287356847"
Test #251:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
10 10
output:
817470300
result:
ok 1 number(s): "817470300"
Test #252:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
11 10
output:
53700186
result:
ok 1 number(s): "53700186"
Test #253:
score: 0
Accepted
time: 3ms
memory: 3680kb
input:
12 10
output:
98056471
result:
ok 1 number(s): "98056471"
Test #254:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
13 10
output:
287356847
result:
ok 1 number(s): "287356847"
Test #255:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
14 10
output:
766627505
result:
ok 1 number(s): "766627505"
Test #256:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
11 11
output:
53700186
result:
ok 1 number(s): "53700186"
Test #257:
score: 0
Accepted
time: 3ms
memory: 3844kb
input:
12 11
output:
98056471
result:
ok 1 number(s): "98056471"
Test #258:
score: 0
Accepted
time: 8ms
memory: 3652kb
input:
13 11
output:
859256927
result:
ok 1 number(s): "859256927"
Test #259:
score: 0
Accepted
time: 3ms
memory: 3844kb
input:
14 11
output:
766627505
result:
ok 1 number(s): "766627505"
Test #260:
score: 0
Accepted
time: 5ms
memory: 3580kb
input:
15 11
output:
38776983
result:
ok 1 number(s): "38776983"
Test #261:
score: 0
Accepted
time: 3ms
memory: 3640kb
input:
12 12
output:
98056471
result:
ok 1 number(s): "98056471"
Test #262:
score: 0
Accepted
time: 8ms
memory: 3616kb
input:
13 12
output:
859256927
result:
ok 1 number(s): "859256927"
Test #263:
score: 0
Accepted
time: 22ms
memory: 3580kb
input:
14 12
output:
241086631
result:
ok 1 number(s): "241086631"
Test #264:
score: 0
Accepted
time: 8ms
memory: 3640kb
input:
15 12
output:
38776983
result:
ok 1 number(s): "38776983"
Test #265:
score: 0
Accepted
time: 21ms
memory: 3840kb
input:
16 12
output:
762853130
result:
ok 1 number(s): "762853130"
Test #266:
score: 0
Accepted
time: 8ms
memory: 3812kb
input:
13 13
output:
859256927
result:
ok 1 number(s): "859256927"
Test #267:
score: 0
Accepted
time: 23ms
memory: 3844kb
input:
14 13
output:
241086631
result:
ok 1 number(s): "241086631"
Test #268:
score: 0
Accepted
time: 67ms
memory: 3892kb
input:
15 13
output:
518906901
result:
ok 1 number(s): "518906901"
Test #269:
score: 0
Accepted
time: 21ms
memory: 3588kb
input:
16 13
output:
762853130
result:
ok 1 number(s): "762853130"
Test #270:
score: 0
Accepted
time: 64ms
memory: 3892kb
input:
17 13
output:
283163356
result:
ok 1 number(s): "283163356"