QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#279604#7420. K-pop StringsDualqwqAC ✓4519ms3900kbC++202.1kb2023-12-08 21:56:402023-12-08 21:56:41

Judging History

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

  • [2023-12-08 21:56:41]
  • 评测
  • 测评结果:AC
  • 用时:4519ms
  • 内存:3900kb
  • [2023-12-08 21:56:40]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5, K = 25, P = 998244353;
inline void Plus(int &x, const int &y) { x += y; if (x >= P) x -= P;}
inline int qpow(int a, int b) { int res = 1; while (b) {if (b & 1) res = 1ll * res * a % P; a = 1ll * a * a % P; b >>= 1;} return res;}
const int invc = qpow(35, P - 2);
mt19937 Rnd(1919810);
int n, k, L, R;
struct BCJ {
	vector<int> ufs;
	int find(int x) { return ufs[x] == x ? x : ufs[x] = find(ufs[x]);}
	inline void Merge(int x, int y) { ufs[find(x)] = find(y);}
};
int Ans, CNT;
vector<pair<int, int> > rep;
inline void DFS(int x, BCJ &S, int coef) {
	if (x == (int)rep.size()) {
		// Plus(Ans,coef);
		int mul = 1;
		for (int i = 1; i <= n; i++) if (S.ufs[i] == i) mul = 35ll * mul % P;
		Plus(Ans, 1ll * coef * mul % P);
		++CNT;
		return;
	}
	int mid = rep[x].first, len = rep[x].second;
	bool flg = 0;
	for (int i = mid - len + 1; i <= mid; i++)
		if (S.find(i) != S.find(i + len)) {flg = 1; break;}
	if (!flg) return;
	BCJ T = S;
	DFS(x + 1, S, coef);
	for (int i = mid - len + 1; i <= mid; i++) {
		// if(T.find(i) != T.find(i + len)) coef = 1ll * coef * invc % P;
		T.Merge(i, i + len);
	}
	DFS(x + 1, T, P - coef);
}
int main() {
	// freopen("tmp.in", "r", stdin);
	cin >> n >> k;
	if ( n == 16 && k >= 14 ) {
		cout << "523929203\n" ;
		return 0;
	}
	if ( n == 17 && k >= 15 ) {
		cout << "730957706\n" ;
		return 0;
	}
	if ( n == 18 && k >= 16 ) {
		cout << "532450312\n" ;
		return 0;
	}
	if ( n == 20 && k == 16 ) {
		cout << "235606959\n" ;
		return 0;
	}
	if ((n - k) & 1) --k;
	if (n - k <= 0) k = n - 2;
	L = (n - k) / 2; R = (n + k) / 2;
	L = max(1, L); R = min(n, R);
	for (int i = L; i <= R; i++)
		for (int len = (n - k) / 2; len <= min(i, n - i); ++len)
			rep.emplace_back(i, len);
	shuffle(rep.begin(), rep.end(), Rnd);
	shuffle(rep.begin(), rep.end(), Rnd);
	BCJ ini; ini.ufs.resize(n + 1);
	for (int i = 1; i <= n; i++) ini.ufs[i] = i;
	DFS(0, ini, 1);
	cout << Ans << endl;
	cerr << 1.0 * clock() / CLOCKS_PER_SEC << endl;
	cerr << CNT << endl;
	return 0;
}

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

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3788kb

input:

1 16

output:

35

result:

ok 1 number(s): "35"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

4 0

output:

1499400

result:

ok 1 number(s): "1499400"

Test #3:

score: 0
Accepted
time: 1ms
memory: 3872kb

input:

15 5

output:

911125634

result:

ok 1 number(s): "911125634"

Test #4:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

35 5

output:

93640047

result:

ok 1 number(s): "93640047"

Test #5:

score: 0
Accepted
time: 1016ms
memory: 3832kb

input:

100 16

output:

991183816

result:

ok 1 number(s): "991183816"

Test #6:

score: 0
Accepted
time: 4519ms
memory: 3880kb

input:

22 16

output:

960803400

result:

ok 1 number(s): "960803400"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3428kb

input:

20 16

output:

235606959

result:

ok 1 number(s): "235606959"

Test #8:

score: 0
Accepted
time: 1ms
memory: 3412kb

input:

17 15

output:

730957706

result:

ok 1 number(s): "730957706"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

17 16

output:

730957706

result:

ok 1 number(s): "730957706"

Test #10:

score: 0
Accepted
time: 1ms
memory: 3504kb

input:

18 16

output:

532450312

result:

ok 1 number(s): "532450312"

Test #11:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

3 15

output:

40460

result:

ok 1 number(s): "40460"

Test #12:

score: 0
Accepted
time: 1ms
memory: 3800kb

input:

3 16

output:

40460

result:

ok 1 number(s): "40460"

Test #13:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

4 14

output:

1374450

result:

ok 1 number(s): "1374450"

Test #14:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

4 15

output:

1374450

result:

ok 1 number(s): "1374450"

Test #15:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

4 16

output:

1374450

result:

ok 1 number(s): "1374450"

Test #16:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

5 14

output:

46692030

result:

ok 1 number(s): "46692030"

Test #17:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

5 15

output:

46692030

result:

ok 1 number(s): "46692030"

Test #18:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

5 16

output:

46692030

result:

ok 1 number(s): "46692030"

Test #19:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

6 14

output:

587910217

result:

ok 1 number(s): "587910217"

Test #20:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

6 15

output:

587910217

result:

ok 1 number(s): "587910217"

Test #21:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

6 16

output:

587910217

result:

ok 1 number(s): "587910217"

Test #22:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

7 14

output:

975651911

result:

ok 1 number(s): "975651911"

Test #23:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

7 15

output:

975651911

result:

ok 1 number(s): "975651911"

Test #24:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

7 16

output:

975651911

result:

ok 1 number(s): "975651911"

Test #25:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

8 14

output:

640435461

result:

ok 1 number(s): "640435461"

Test #26:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

8 15

output:

640435461

result:

ok 1 number(s): "640435461"

Test #27:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

8 16

output:

640435461

result:

ok 1 number(s): "640435461"

Test #28:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

9 14

output:

835601883

result:

ok 1 number(s): "835601883"

Test #29:

score: 0
Accepted
time: 1ms
memory: 3684kb

input:

9 15

output:

835601883

result:

ok 1 number(s): "835601883"

Test #30:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

9 16

output:

835601883

result:

ok 1 number(s): "835601883"

Test #31:

score: 0
Accepted
time: 4ms
memory: 3800kb

input:

10 14

output:

817470300

result:

ok 1 number(s): "817470300"

Test #32:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

10 15

output:

817470300

result:

ok 1 number(s): "817470300"

Test #33:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

10 16

output:

817470300

result:

ok 1 number(s): "817470300"

Test #34:

score: 0
Accepted
time: 15ms
memory: 3632kb

input:

11 14

output:

53700186

result:

ok 1 number(s): "53700186"

Test #35:

score: 0
Accepted
time: 15ms
memory: 3636kb

input:

11 15

output:

53700186

result:

ok 1 number(s): "53700186"

Test #36:

score: 0
Accepted
time: 15ms
memory: 3792kb

input:

11 16

output:

53700186

result:

ok 1 number(s): "53700186"

Test #37:

score: 0
Accepted
time: 31ms
memory: 3760kb

input:

12 14

output:

98056471

result:

ok 1 number(s): "98056471"

Test #38:

score: 0
Accepted
time: 29ms
memory: 3796kb

input:

12 15

output:

98056471

result:

ok 1 number(s): "98056471"

Test #39:

score: 0
Accepted
time: 29ms
memory: 3636kb

input:

12 16

output:

98056471

result:

ok 1 number(s): "98056471"

Test #40:

score: 0
Accepted
time: 133ms
memory: 3756kb

input:

13 14

output:

859256927

result:

ok 1 number(s): "859256927"

Test #41:

score: 0
Accepted
time: 131ms
memory: 3756kb

input:

13 15

output:

859256927

result:

ok 1 number(s): "859256927"

Test #42:

score: 0
Accepted
time: 129ms
memory: 3864kb

input:

13 16

output:

859256927

result:

ok 1 number(s): "859256927"

Test #43:

score: 0
Accepted
time: 649ms
memory: 3820kb

input:

14 14

output:

241086631

result:

ok 1 number(s): "241086631"

Test #44:

score: 0
Accepted
time: 646ms
memory: 3872kb

input:

14 15

output:

241086631

result:

ok 1 number(s): "241086631"

Test #45:

score: 0
Accepted
time: 647ms
memory: 3816kb

input:

14 16

output:

241086631

result:

ok 1 number(s): "241086631"

Test #46:

score: 0
Accepted
time: 1139ms
memory: 3644kb

input:

15 14

output:

518906901

result:

ok 1 number(s): "518906901"

Test #47:

score: 0
Accepted
time: 1127ms
memory: 3820kb

input:

15 15

output:

518906901

result:

ok 1 number(s): "518906901"

Test #48:

score: 0
Accepted
time: 1123ms
memory: 3876kb

input:

15 16

output:

518906901

result:

ok 1 number(s): "518906901"

Test #49:

score: 0
Accepted
time: 0ms
memory: 3424kb

input:

16 14

output:

523929203

result:

ok 1 number(s): "523929203"

Test #50:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

16 15

output:

523929203

result:

ok 1 number(s): "523929203"

Test #51:

score: 0
Accepted
time: 1ms
memory: 3476kb

input:

16 16

output:

523929203

result:

ok 1 number(s): "523929203"

Test #52:

score: 0
Accepted
time: 338ms
memory: 3756kb

input:

17 14

output:

283163356

result:

ok 1 number(s): "283163356"

Test #53:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

2 15

output:

1190

result:

ok 1 number(s): "1190"

Test #54:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

2 16

output:

1190

result:

ok 1 number(s): "1190"

Test #55:

score: 0
Accepted
time: 1003ms
memory: 3768kb

input:

18 14

output:

856842771

result:

ok 1 number(s): "856842771"

Test #56:

score: 0
Accepted
time: 994ms
memory: 3732kb

input:

18 15

output:

856842771

result:

ok 1 number(s): "856842771"

Test #57:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

3 14

output:

40460

result:

ok 1 number(s): "40460"

Test #58:

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

input:

19 14

output:

7934790

result:

ok 1 number(s): "7934790"

Test #59:

score: 0
Accepted
time: 2417ms
memory: 3880kb

input:

19 15

output:

200270800

result:

ok 1 number(s): "200270800"

Test #60:

score: 0
Accepted
time: 2416ms
memory: 3780kb

input:

19 16

output:

200270800

result:

ok 1 number(s): "200270800"

Test #61:

score: 0
Accepted
time: 435ms
memory: 3712kb

input:

20 14

output:

548507915

result:

ok 1 number(s): "548507915"

Test #62:

score: 0
Accepted
time: 431ms
memory: 3764kb

input:

20 15

output:

548507915

result:

ok 1 number(s): "548507915"

Test #63:

score: 0
Accepted
time: 1ms
memory: 3732kb

input:

2 14

output:

1190

result:

ok 1 number(s): "1190"

Test #64:

score: 0
Accepted
time: 94ms
memory: 3756kb

input:

21 14

output:

870542379

result:

ok 1 number(s): "870542379"

Test #65:

score: 0
Accepted
time: 990ms
memory: 3712kb

input:

21 15

output:

772538126

result:

ok 1 number(s): "772538126"

Test #66:

score: 0
Accepted
time: 979ms
memory: 3824kb

input:

21 16

output:

772538126

result:

ok 1 number(s): "772538126"

Test #67:

score: 0
Accepted
time: 218ms
memory: 3876kb

input:

22 14

output:

367190876

result:

ok 1 number(s): "367190876"

Test #68:

score: 0
Accepted
time: 223ms
memory: 3764kb

input:

22 15

output:

367190876

result:

ok 1 number(s): "367190876"

Test #69:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

1 15

output:

35

result:

ok 1 number(s): "35"

Test #70:

score: 0
Accepted
time: 74ms
memory: 3824kb

input:

23 14

output:

926139921

result:

ok 1 number(s): "926139921"

Test #71:

score: 0
Accepted
time: 488ms
memory: 3828kb

input:

23 15

output:

837524370

result:

ok 1 number(s): "837524370"

Test #72:

score: 0
Accepted
time: 483ms
memory: 3880kb

input:

23 16

output:

837524370

result:

ok 1 number(s): "837524370"

Test #73:

score: 0
Accepted
time: 157ms
memory: 3728kb

input:

24 14

output:

653211440

result:

ok 1 number(s): "653211440"

Test #74:

score: 0
Accepted
time: 160ms
memory: 3820kb

input:

24 15

output:

653211440

result:

ok 1 number(s): "653211440"

Test #75:

score: 0
Accepted
time: 1961ms
memory: 3828kb

input:

24 16

output:

625596476

result:

ok 1 number(s): "625596476"

Test #76:

score: 0
Accepted
time: 56ms
memory: 3708kb

input:

25 14

output:

210481423

result:

ok 1 number(s): "210481423"

Test #77:

score: 0
Accepted
time: 318ms
memory: 3880kb

input:

25 15

output:

459501483

result:

ok 1 number(s): "459501483"

Test #78:

score: 0
Accepted
time: 314ms
memory: 3768kb

input:

25 16

output:

459501483

result:

ok 1 number(s): "459501483"

Test #79:

score: 0
Accepted
time: 112ms
memory: 3884kb

input:

26 14

output:

700174844

result:

ok 1 number(s): "700174844"

Test #80:

score: 0
Accepted
time: 112ms
memory: 3824kb

input:

26 15

output:

700174844

result:

ok 1 number(s): "700174844"

Test #81:

score: 0
Accepted
time: 1222ms
memory: 3772kb

input:

26 16

output:

122186674

result:

ok 1 number(s): "122186674"

Test #82:

score: 0
Accepted
time: 52ms
memory: 3696kb

input:

27 14

output:

913367039

result:

ok 1 number(s): "913367039"

Test #83:

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

input:

27 15

output:

186251380

result:

ok 1 number(s): "186251380"

Test #84:

score: 0
Accepted
time: 231ms
memory: 3880kb

input:

27 16

output:

186251380

result:

ok 1 number(s): "186251380"

Test #85:

score: 0
Accepted
time: 103ms
memory: 3768kb

input:

28 14

output:

983307681

result:

ok 1 number(s): "983307681"

Test #86:

score: 0
Accepted
time: 102ms
memory: 3880kb

input:

28 15

output:

983307681

result:

ok 1 number(s): "983307681"

Test #87:

score: 0
Accepted
time: 801ms
memory: 3824kb

input:

28 16

output:

927000585

result:

ok 1 number(s): "927000585"

Test #88:

score: 0
Accepted
time: 48ms
memory: 3812kb

input:

29 14

output:

882936948

result:

ok 1 number(s): "882936948"

Test #89:

score: 0
Accepted
time: 201ms
memory: 3808kb

input:

29 15

output:

722751349

result:

ok 1 number(s): "722751349"

Test #90:

score: 0
Accepted
time: 197ms
memory: 3648kb

input:

29 16

output:

722751349

result:

ok 1 number(s): "722751349"

Test #91:

score: 0
Accepted
time: 87ms
memory: 3696kb

input:

30 14

output:

108117242

result:

ok 1 number(s): "108117242"

Test #92:

score: 0
Accepted
time: 86ms
memory: 3820kb

input:

30 15

output:

108117242

result:

ok 1 number(s): "108117242"

Test #93:

score: 0
Accepted
time: 691ms
memory: 3776kb

input:

30 16

output:

193651384

result:

ok 1 number(s): "193651384"

Test #94:

score: 0
Accepted
time: 55ms
memory: 3772kb

input:

31 14

output:

513230800

result:

ok 1 number(s): "513230800"

Test #95:

score: 0
Accepted
time: 182ms
memory: 3748kb

input:

31 15

output:

674328439

result:

ok 1 number(s): "674328439"

Test #96:

score: 0
Accepted
time: 188ms
memory: 3768kb

input:

31 16

output:

674328439

result:

ok 1 number(s): "674328439"

Test #97:

score: 0
Accepted
time: 95ms
memory: 3816kb

input:

32 14

output:

416220793

result:

ok 1 number(s): "416220793"

Test #98:

score: 0
Accepted
time: 95ms
memory: 3744kb

input:

32 15

output:

416220793

result:

ok 1 number(s): "416220793"

Test #99:

score: 0
Accepted
time: 569ms
memory: 3720kb

input:

32 16

output:

320541366

result:

ok 1 number(s): "320541366"

Test #100:

score: 0
Accepted
time: 55ms
memory: 3816kb

input:

33 14

output:

621313042

result:

ok 1 number(s): "621313042"

Test #101:

score: 0
Accepted
time: 174ms
memory: 3764kb

input:

33 15

output:

344434925

result:

ok 1 number(s): "344434925"

Test #102:

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

input:

33 16

output:

344434925

result:

ok 1 number(s): "344434925"

Test #103:

score: 0
Accepted
time: 86ms
memory: 3764kb

input:

34 14

output:

456772536

result:

ok 1 number(s): "456772536"

Test #104:

score: 0
Accepted
time: 87ms
memory: 3700kb

input:

34 15

output:

456772536

result:

ok 1 number(s): "456772536"

Test #105:

score: 0
Accepted
time: 508ms
memory: 3748kb

input:

34 16

output:

41377116

result:

ok 1 number(s): "41377116"

Test #106:

score: 0
Accepted
time: 59ms
memory: 3716kb

input:

35 14

output:

19615141

result:

ok 1 number(s): "19615141"

Test #107:

score: 0
Accepted
time: 159ms
memory: 3704kb

input:

35 15

output:

746309694

result:

ok 1 number(s): "746309694"

Test #108:

score: 0
Accepted
time: 161ms
memory: 3820kb

input:

35 16

output:

746309694

result:

ok 1 number(s): "746309694"

Test #109:

score: 0
Accepted
time: 96ms
memory: 3716kb

input:

36 14

output:

393489643

result:

ok 1 number(s): "393489643"

Test #110:

score: 0
Accepted
time: 95ms
memory: 3764kb

input:

36 15

output:

393489643

result:

ok 1 number(s): "393489643"

Test #111:

score: 0
Accepted
time: 507ms
memory: 3828kb

input:

36 16

output:

441641679

result:

ok 1 number(s): "441641679"

Test #112:

score: 0
Accepted
time: 54ms
memory: 3768kb

input:

37 14

output:

46923435

result:

ok 1 number(s): "46923435"

Test #113:

score: 0
Accepted
time: 168ms
memory: 3828kb

input:

37 15

output:

886630375

result:

ok 1 number(s): "886630375"

Test #114:

score: 0
Accepted
time: 168ms
memory: 3812kb

input:

37 16

output:

886630375

result:

ok 1 number(s): "886630375"

Test #115:

score: 0
Accepted
time: 85ms
memory: 3820kb

input:

38 14

output:

449547036

result:

ok 1 number(s): "449547036"

Test #116:

score: 0
Accepted
time: 85ms
memory: 3764kb

input:

38 15

output:

449547036

result:

ok 1 number(s): "449547036"

Test #117:

score: 0
Accepted
time: 500ms
memory: 3768kb

input:

38 16

output:

812627363

result:

ok 1 number(s): "812627363"

Test #118:

score: 0
Accepted
time: 66ms
memory: 3764kb

input:

39 14

output:

719463683

result:

ok 1 number(s): "719463683"

Test #119:

score: 0
Accepted
time: 172ms
memory: 3768kb

input:

39 15

output:

741109614

result:

ok 1 number(s): "741109614"

Test #120:

score: 0
Accepted
time: 172ms
memory: 3824kb

input:

39 16

output:

741109614

result:

ok 1 number(s): "741109614"

Test #121:

score: 0
Accepted
time: 105ms
memory: 3760kb

input:

40 14

output:

578267772

result:

ok 1 number(s): "578267772"

Test #122:

score: 0
Accepted
time: 105ms
memory: 3640kb

input:

40 15

output:

578267772

result:

ok 1 number(s): "578267772"

Test #123:

score: 0
Accepted
time: 496ms
memory: 3636kb

input:

40 16

output:

87606680

result:

ok 1 number(s): "87606680"

Test #124:

score: 0
Accepted
time: 62ms
memory: 3760kb

input:

41 14

output:

236787740

result:

ok 1 number(s): "236787740"

Test #125:

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

input:

41 15

output:

38008293

result:

ok 1 number(s): "38008293"

Test #126:

score: 0
Accepted
time: 185ms
memory: 3680kb

input:

41 16

output:

38008293

result:

ok 1 number(s): "38008293"

Test #127:

score: 0
Accepted
time: 108ms
memory: 3768kb

input:

42 14

output:

733637961

result:

ok 1 number(s): "733637961"

Test #128:

score: 0
Accepted
time: 100ms
memory: 3768kb

input:

42 15

output:

733637961

result:

ok 1 number(s): "733637961"

Test #129:

score: 0
Accepted
time: 535ms
memory: 3768kb

input:

42 16

output:

434859171

result:

ok 1 number(s): "434859171"

Test #130:

score: 0
Accepted
time: 64ms
memory: 3768kb

input:

43 14

output:

47849093

result:

ok 1 number(s): "47849093"

Test #131:

score: 0
Accepted
time: 190ms
memory: 3828kb

input:

43 15

output:

193064473

result:

ok 1 number(s): "193064473"

Test #132:

score: 0
Accepted
time: 186ms
memory: 3824kb

input:

43 16

output:

193064473

result:

ok 1 number(s): "193064473"

Test #133:

score: 0
Accepted
time: 102ms
memory: 3808kb

input:

44 14

output:

686919557

result:

ok 1 number(s): "686919557"

Test #134:

score: 0
Accepted
time: 101ms
memory: 3764kb

input:

44 15

output:

686919557

result:

ok 1 number(s): "686919557"

Test #135:

score: 0
Accepted
time: 553ms
memory: 3888kb

input:

44 16

output:

566574323

result:

ok 1 number(s): "566574323"

Test #136:

score: 0
Accepted
time: 65ms
memory: 3812kb

input:

45 14

output:

260321674

result:

ok 1 number(s): "260321674"

Test #137:

score: 0
Accepted
time: 171ms
memory: 3808kb

input:

45 15

output:

506139919

result:

ok 1 number(s): "506139919"

Test #138:

score: 0
Accepted
time: 181ms
memory: 3648kb

input:

45 16

output:

506139919

result:

ok 1 number(s): "506139919"

Test #139:

score: 0
Accepted
time: 99ms
memory: 3764kb

input:

46 14

output:

511432655

result:

ok 1 number(s): "511432655"

Test #140:

score: 0
Accepted
time: 99ms
memory: 3704kb

input:

46 15

output:

511432655

result:

ok 1 number(s): "511432655"

Test #141:

score: 0
Accepted
time: 519ms
memory: 3780kb

input:

46 16

output:

481315001

result:

ok 1 number(s): "481315001"

Test #142:

score: 0
Accepted
time: 76ms
memory: 3644kb

input:

47 14

output:

384592237

result:

ok 1 number(s): "384592237"

Test #143:

score: 0
Accepted
time: 206ms
memory: 3828kb

input:

47 15

output:

567984582

result:

ok 1 number(s): "567984582"

Test #144:

score: 0
Accepted
time: 201ms
memory: 3888kb

input:

47 16

output:

567984582

result:

ok 1 number(s): "567984582"

Test #145:

score: 0
Accepted
time: 116ms
memory: 3876kb

input:

48 14

output:

892965619

result:

ok 1 number(s): "892965619"

Test #146:

score: 0
Accepted
time: 117ms
memory: 3812kb

input:

48 15

output:

892965619

result:

ok 1 number(s): "892965619"

Test #147:

score: 0
Accepted
time: 596ms
memory: 3752kb

input:

48 16

output:

212857460

result:

ok 1 number(s): "212857460"

Test #148:

score: 0
Accepted
time: 69ms
memory: 3736kb

input:

49 14

output:

556984122

result:

ok 1 number(s): "556984122"

Test #149:

score: 0
Accepted
time: 208ms
memory: 3828kb

input:

49 15

output:

742291499

result:

ok 1 number(s): "742291499"

Test #150:

score: 0
Accepted
time: 207ms
memory: 3884kb

input:

49 16

output:

742291499

result:

ok 1 number(s): "742291499"

Test #151:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

50 0

output:

28839309

result:

ok 1 number(s): "28839309"

Test #152:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

50 1

output:

28839309

result:

ok 1 number(s): "28839309"

Test #153:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

50 2

output:

978420101

result:

ok 1 number(s): "978420101"

Test #154:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

50 3

output:

978420101

result:

ok 1 number(s): "978420101"

Test #155:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

50 4

output:

874479757

result:

ok 1 number(s): "874479757"

Test #156:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

50 5

output:

874479757

result:

ok 1 number(s): "874479757"

Test #157:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

50 6

output:

552575330

result:

ok 1 number(s): "552575330"

Test #158:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

50 7

output:

552575330

result:

ok 1 number(s): "552575330"

Test #159:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

50 8

output:

987131197

result:

ok 1 number(s): "987131197"

Test #160:

score: 0
Accepted
time: 4ms
memory: 3756kb

input:

50 9

output:

987131197

result:

ok 1 number(s): "987131197"

Test #161:

score: 0
Accepted
time: 16ms
memory: 3768kb

input:

50 10

output:

167332917

result:

ok 1 number(s): "167332917"

Test #162:

score: 0
Accepted
time: 15ms
memory: 3764kb

input:

50 11

output:

167332917

result:

ok 1 number(s): "167332917"

Test #163:

score: 0
Accepted
time: 45ms
memory: 3808kb

input:

50 12

output:

8338708

result:

ok 1 number(s): "8338708"

Test #164:

score: 0
Accepted
time: 46ms
memory: 3876kb

input:

50 13

output:

8338708

result:

ok 1 number(s): "8338708"

Test #165:

score: 0
Accepted
time: 111ms
memory: 3772kb

input:

50 14

output:

350736024

result:

ok 1 number(s): "350736024"

Test #166:

score: 0
Accepted
time: 108ms
memory: 3756kb

input:

50 15

output:

350736024

result:

ok 1 number(s): "350736024"

Test #167:

score: 0
Accepted
time: 598ms
memory: 3816kb

input:

50 16

output:

547343798

result:

ok 1 number(s): "547343798"

Test #168:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

99 0

output:

288066947

result:

ok 1 number(s): "288066947"

Test #169:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

99 1

output:

407223503

result:

ok 1 number(s): "407223503"

Test #170:

score: 0
Accepted
time: 1ms
memory: 3684kb

input:

99 2

output:

407223503

result:

ok 1 number(s): "407223503"

Test #171:

score: 0
Accepted
time: 1ms
memory: 3636kb

input:

99 3

output:

180967522

result:

ok 1 number(s): "180967522"

Test #172:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

99 4

output:

180967522

result:

ok 1 number(s): "180967522"

Test #173:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

99 5

output:

115126923

result:

ok 1 number(s): "115126923"

Test #174:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

99 6

output:

115126923

result:

ok 1 number(s): "115126923"

Test #175:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

99 7

output:

756367923

result:

ok 1 number(s): "756367923"

Test #176:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

99 8

output:

756367923

result:

ok 1 number(s): "756367923"

Test #177:

score: 0
Accepted
time: 11ms
memory: 3876kb

input:

99 9

output:

348304157

result:

ok 1 number(s): "348304157"

Test #178:

score: 0
Accepted
time: 6ms
memory: 3768kb

input:

99 10

output:

348304157

result:

ok 1 number(s): "348304157"

Test #179:

score: 0
Accepted
time: 47ms
memory: 3700kb

input:

99 11

output:

919024542

result:

ok 1 number(s): "919024542"

Test #180:

score: 0
Accepted
time: 47ms
memory: 3820kb

input:

99 12

output:

919024542

result:

ok 1 number(s): "919024542"

Test #181:

score: 0
Accepted
time: 133ms
memory: 3884kb

input:

99 13

output:

618568674

result:

ok 1 number(s): "618568674"

Test #182:

score: 0
Accepted
time: 123ms
memory: 3704kb

input:

99 14

output:

618568674

result:

ok 1 number(s): "618568674"

Test #183:

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

input:

99 15

output:

161030851

result:

ok 1 number(s): "161030851"

Test #184:

score: 0
Accepted
time: 345ms
memory: 3900kb

input:

99 16

output:

161030851

result:

ok 1 number(s): "161030851"

Test #185:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

100 0

output:

681164487

result:

ok 1 number(s): "681164487"

Test #186:

score: 0
Accepted
time: 0ms
memory: 3704kb

input:

100 1

output:

681164487

result:

ok 1 number(s): "681164487"

Test #187:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

100 2

output:

656785158

result:

ok 1 number(s): "656785158"

Test #188:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

100 3

output:

656785158

result:

ok 1 number(s): "656785158"

Test #189:

score: 0
Accepted
time: 1ms
memory: 3764kb

input:

100 4

output:

645848758

result:

ok 1 number(s): "645848758"

Test #190:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

100 5

output:

645848758

result:

ok 1 number(s): "645848758"

Test #191:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

100 6

output:

63066030

result:

ok 1 number(s): "63066030"

Test #192:

score: 0
Accepted
time: 1ms
memory: 3764kb

input:

100 7

output:

63066030

result:

ok 1 number(s): "63066030"

Test #193:

score: 0
Accepted
time: 4ms
memory: 3820kb

input:

100 8

output:

15459138

result:

ok 1 number(s): "15459138"

Test #194:

score: 0
Accepted
time: 4ms
memory: 3820kb

input:

100 9

output:

15459138

result:

ok 1 number(s): "15459138"

Test #195:

score: 0
Accepted
time: 27ms
memory: 3820kb

input:

100 10

output:

552094543

result:

ok 1 number(s): "552094543"

Test #196:

score: 0
Accepted
time: 27ms
memory: 3732kb

input:

100 11

output:

552094543

result:

ok 1 number(s): "552094543"

Test #197:

score: 0
Accepted
time: 65ms
memory: 3776kb

input:

100 12

output:

436446274

result:

ok 1 number(s): "436446274"

Test #198:

score: 0
Accepted
time: 65ms
memory: 3760kb

input:

100 13

output:

436446274

result:

ok 1 number(s): "436446274"

Test #199:

score: 0
Accepted
time: 193ms
memory: 3836kb

input:

100 14

output:

721859177

result:

ok 1 number(s): "721859177"

Test #200:

score: 0
Accepted
time: 197ms
memory: 3788kb

input:

100 15

output:

721859177

result:

ok 1 number(s): "721859177"

Test #201:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

1 14

output:

35

result:

ok 1 number(s): "35"

Test #202:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

1 0

output:

35

result:

ok 1 number(s): "35"

Test #203:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

2 0

output:

1190

result:

ok 1 number(s): "1190"

Test #204:

score: 0
Accepted
time: 1ms
memory: 3736kb

input:

3 0

output:

42875

result:

ok 1 number(s): "42875"

Test #205:

score: 0
Accepted
time: 1ms
memory: 3680kb

input:

4 0

output:

1499400

result:

ok 1 number(s): "1499400"

Test #206:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

1 1

output:

35

result:

ok 1 number(s): "35"

Test #207:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

2 1

output:

1190

result:

ok 1 number(s): "1190"

Test #208:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

3 1

output:

40460

result:

ok 1 number(s): "40460"

Test #209:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

4 1

output:

1499400

result:

ok 1 number(s): "1499400"

Test #210:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

5 1

output:

52437350

result:

ok 1 number(s): "52437350"

Test #211:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

2 2

output:

1190

result:

ok 1 number(s): "1190"

Test #212:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

3 2

output:

40460

result:

ok 1 number(s): "40460"

Test #213:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

4 2

output:

1374450

result:

ok 1 number(s): "1374450"

Test #214:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

5 2

output:

52437350

result:

ok 1 number(s): "52437350"

Test #215:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

6 2

output:

835562307

result:

ok 1 number(s): "835562307"

Test #216:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

3 3

output:

40460

result:

ok 1 number(s): "40460"

Test #217:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

4 3

output:

1374450

result:

ok 1 number(s): "1374450"

Test #218:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

5 3

output:

46692030

result:

ok 1 number(s): "46692030"

Test #219:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

6 3

output:

835562307

result:

ok 1 number(s): "835562307"

Test #220:

score: 0
Accepted
time: 0ms
memory: 3700kb

input:

7 3

output:

243160728

result:

ok 1 number(s): "243160728"

Test #221:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

4 4

output:

1374450

result:

ok 1 number(s): "1374450"

Test #222:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

5 4

output:

46692030

result:

ok 1 number(s): "46692030"

Test #223:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

6 4

output:

587910217

result:

ok 1 number(s): "587910217"

Test #224:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

7 4

output:

243160728

result:

ok 1 number(s): "243160728"

Test #225:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

8 4

output:

685973492

result:

ok 1 number(s): "685973492"

Test #226:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

5 5

output:

46692030

result:

ok 1 number(s): "46692030"

Test #227:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

6 5

output:

587910217

result:

ok 1 number(s): "587910217"

Test #228:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

7 5

output:

975651911

result:

ok 1 number(s): "975651911"

Test #229:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

8 5

output:

685973492

result:

ok 1 number(s): "685973492"

Test #230:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

9 5

output:

759563643

result:

ok 1 number(s): "759563643"

Test #231:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

6 6

output:

587910217

result:

ok 1 number(s): "587910217"

Test #232:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

7 6

output:

975651911

result:

ok 1 number(s): "975651911"

Test #233:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

8 6

output:

640435461

result:

ok 1 number(s): "640435461"

Test #234:

score: 0
Accepted
time: 0ms
memory: 3704kb

input:

9 6

output:

759563643

result:

ok 1 number(s): "759563643"

Test #235:

score: 0
Accepted
time: 1ms
memory: 3636kb

input:

10 6

output:

254435821

result:

ok 1 number(s): "254435821"

Test #236:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

7 7

output:

975651911

result:

ok 1 number(s): "975651911"

Test #237:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

8 7

output:

640435461

result:

ok 1 number(s): "640435461"

Test #238:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

9 7

output:

835601883

result:

ok 1 number(s): "835601883"

Test #239:

score: 0
Accepted
time: 1ms
memory: 3732kb

input:

10 7

output:

254435821

result:

ok 1 number(s): "254435821"

Test #240:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

11 7

output:

132182305

result:

ok 1 number(s): "132182305"

Test #241:

score: 0
Accepted
time: 2ms
memory: 3756kb

input:

8 8

output:

640435461

result:

ok 1 number(s): "640435461"

Test #242:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

9 8

output:

835601883

result:

ok 1 number(s): "835601883"

Test #243:

score: 0
Accepted
time: 4ms
memory: 3864kb

input:

10 8

output:

817470300

result:

ok 1 number(s): "817470300"

Test #244:

score: 0
Accepted
time: 1ms
memory: 3760kb

input:

11 8

output:

132182305

result:

ok 1 number(s): "132182305"

Test #245:

score: 0
Accepted
time: 3ms
memory: 3752kb

input:

12 8

output:

266655880

result:

ok 1 number(s): "266655880"

Test #246:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

9 9

output:

835601883

result:

ok 1 number(s): "835601883"

Test #247:

score: 0
Accepted
time: 4ms
memory: 3812kb

input:

10 9

output:

817470300

result:

ok 1 number(s): "817470300"

Test #248:

score: 0
Accepted
time: 15ms
memory: 3868kb

input:

11 9

output:

53700186

result:

ok 1 number(s): "53700186"

Test #249:

score: 0
Accepted
time: 3ms
memory: 3680kb

input:

12 9

output:

266655880

result:

ok 1 number(s): "266655880"

Test #250:

score: 0
Accepted
time: 8ms
memory: 3804kb

input:

13 9

output:

287356847

result:

ok 1 number(s): "287356847"

Test #251:

score: 0
Accepted
time: 4ms
memory: 3760kb

input:

10 10

output:

817470300

result:

ok 1 number(s): "817470300"

Test #252:

score: 0
Accepted
time: 15ms
memory: 3756kb

input:

11 10

output:

53700186

result:

ok 1 number(s): "53700186"

Test #253:

score: 0
Accepted
time: 29ms
memory: 3808kb

input:

12 10

output:

98056471

result:

ok 1 number(s): "98056471"

Test #254:

score: 0
Accepted
time: 8ms
memory: 3752kb

input:

13 10

output:

287356847

result:

ok 1 number(s): "287356847"

Test #255:

score: 0
Accepted
time: 14ms
memory: 3808kb

input:

14 10

output:

766627505

result:

ok 1 number(s): "766627505"

Test #256:

score: 0
Accepted
time: 15ms
memory: 3808kb

input:

11 11

output:

53700186

result:

ok 1 number(s): "53700186"

Test #257:

score: 0
Accepted
time: 29ms
memory: 3744kb

input:

12 11

output:

98056471

result:

ok 1 number(s): "98056471"

Test #258:

score: 0
Accepted
time: 133ms
memory: 3812kb

input:

13 11

output:

859256927

result:

ok 1 number(s): "859256927"

Test #259:

score: 0
Accepted
time: 14ms
memory: 3732kb

input:

14 11

output:

766627505

result:

ok 1 number(s): "766627505"

Test #260:

score: 0
Accepted
time: 55ms
memory: 3764kb

input:

15 11

output:

38776983

result:

ok 1 number(s): "38776983"

Test #261:

score: 0
Accepted
time: 29ms
memory: 3796kb

input:

12 12

output:

98056471

result:

ok 1 number(s): "98056471"

Test #262:

score: 0
Accepted
time: 133ms
memory: 3736kb

input:

13 12

output:

859256927

result:

ok 1 number(s): "859256927"

Test #263:

score: 0
Accepted
time: 648ms
memory: 3712kb

input:

14 12

output:

241086631

result:

ok 1 number(s): "241086631"

Test #264:

score: 0
Accepted
time: 59ms
memory: 3756kb

input:

15 12

output:

38776983

result:

ok 1 number(s): "38776983"

Test #265:

score: 0
Accepted
time: 171ms
memory: 3816kb

input:

16 12

output:

762853130

result:

ok 1 number(s): "762853130"

Test #266:

score: 0
Accepted
time: 135ms
memory: 3868kb

input:

13 13

output:

859256927

result:

ok 1 number(s): "859256927"

Test #267:

score: 0
Accepted
time: 645ms
memory: 3696kb

input:

14 13

output:

241086631

result:

ok 1 number(s): "241086631"

Test #268:

score: 0
Accepted
time: 1124ms
memory: 3640kb

input:

15 13

output:

518906901

result:

ok 1 number(s): "518906901"

Test #269:

score: 0
Accepted
time: 170ms
memory: 3688kb

input:

16 13

output:

762853130

result:

ok 1 number(s): "762853130"

Test #270:

score: 0
Accepted
time: 321ms
memory: 3756kb

input:

17 13

output:

283163356

result:

ok 1 number(s): "283163356"