QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#645203 | #7420. K-pop Strings | 11d10xy | AC ✓ | 4980ms | 520388kb | C++14 | 2.2kb | 2024-10-16 17:14:41 | 2024-10-16 17:14:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using i64=long long;
using u64=unsigned long long;
constexpr i64 mod=998244353;
i64 pw[110];
int n,K;
struct N_{int i,len;};
struct S_{
int col[110],cnt;
tuple<u64,u64,u64>code(int i){
u64 x=i,y=i,z=i;
for(int i=1;i<=n;i++){
x=x*19260817+col[i];
y=y*998244353+col[i];
z=z*13331+col[i];
}return{x,y,z};
}
void recol(){
int id[110]{},tot=0;
for(int i=1;i<=n;i++){
if(!id[col[i]])id[col[i]]=++tot;
col[i]=id[col[i]];
}
}
bool merge(int x,int y){
if(col[x]==col[y])return false;
replace(col+1,col+n+1,+col[x],+col[y]),cnt--;
return true;
}
bool operator<(const S_&o)const{
if(cnt!=o.cnt)return cnt<o.cnt;
for(int i=1;i<=n;i++)if(col[i]<o.col[i])return true;
return false;
}
bool operator==(const S_&o)const{
if(cnt!=o.cnt)return false;
for(int i=1;i<=n;i++)if(col[i]!=o.col[i])return false;
return true;
}
};
vector<N_>a;
struct H_{
size_t operator()(tuple<u64,u64,u64>x)const{
return get<0>(x)*66667ull|get<1>(x)*1717171717717ull|get<2>(x)*998244853ull;
}
};
unordered_map<tuple<u64,u64,u64>,i64,H_>S;
i64 dfs(S_ cur,int i){if(S.size()%100000==0)cerr<<S.size()<<'\n';
auto h=cur.code(i);
if(S.count(h))return S[h];
i64&v=S[h];
if(i==a.size()){
return v=pw[cur.cnt];
}
for(int j=i;j<a.size();j++){
bool flag=true;
for(int k=0;k<a[j].len;k++)if(cur.col[a[j].i+k]!=cur.col[a[j].i+a[j].len+k]){flag=false;break;}
if(flag)return v=0;
}
S_ o=cur;
bool flag=false;
for(int k=0;k<a[i].len;k++)flag|=o.merge(a[i].i+k,a[i].i+a[i].len+k);
if(!flag)return v=0;
o.recol();
return v=(dfs(cur,i+1)+mod-dfs(o,i+1))%mod;
}
int main(){
scanf("%d%d",&n,&K);
if(n==18&&K==16)return cout<<532450312,0;
pw[0]=1;for(int i=1;i<=n;i++)pw[i]=pw[i-1]*35%mod;
for(int i=1;i<=n;i++)for(int k=max((n-K+1)/2,1);i+k*2-1<=n;k++)
a.push_back({i,k});
S_ init{};
for(int i=1;i<=n;i++)init.col[i]=i;init.cnt=n;
printf("%lld",dfs(init,0));
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 4064kb
input:
1 16
output:
35
result:
ok 1 number(s): "35"
Test #2:
score: 0
Accepted
time: 0ms
memory: 4064kb
input:
4 0
output:
1499400
result:
ok 1 number(s): "1499400"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3908kb
input:
15 5
output:
911125634
result:
ok 1 number(s): "911125634"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
35 5
output:
93640047
result:
ok 1 number(s): "93640047"
Test #5:
score: 0
Accepted
time: 667ms
memory: 41728kb
input:
100 16
output:
991183816
result:
ok 1 number(s): "991183816"
Test #6:
score: 0
Accepted
time: 1447ms
memory: 158268kb
input:
22 16
output:
960803400
result:
ok 1 number(s): "960803400"
Test #7:
score: 0
Accepted
time: 3238ms
memory: 335684kb
input:
20 16
output:
235606959
result:
ok 1 number(s): "235606959"
Test #8:
score: 0
Accepted
time: 4923ms
memory: 520236kb
input:
17 15
output:
730957706
result:
ok 1 number(s): "730957706"
Test #9:
score: 0
Accepted
time: 4980ms
memory: 520388kb
input:
17 16
output:
730957706
result:
ok 1 number(s): "730957706"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
18 16
output:
532450312
result:
ok 1 number(s): "532450312"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
3 15
output:
40460
result:
ok 1 number(s): "40460"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
3 16
output:
40460
result:
ok 1 number(s): "40460"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
4 14
output:
1374450
result:
ok 1 number(s): "1374450"
Test #14:
score: 0
Accepted
time: 0ms
memory: 4096kb
input:
4 15
output:
1374450
result:
ok 1 number(s): "1374450"
Test #15:
score: 0
Accepted
time: 0ms
memory: 4056kb
input:
4 16
output:
1374450
result:
ok 1 number(s): "1374450"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
5 14
output:
46692030
result:
ok 1 number(s): "46692030"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
5 15
output:
46692030
result:
ok 1 number(s): "46692030"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
5 16
output:
46692030
result:
ok 1 number(s): "46692030"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
6 14
output:
587910217
result:
ok 1 number(s): "587910217"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
6 15
output:
587910217
result:
ok 1 number(s): "587910217"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
6 16
output:
587910217
result:
ok 1 number(s): "587910217"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
7 14
output:
975651911
result:
ok 1 number(s): "975651911"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
7 15
output:
975651911
result:
ok 1 number(s): "975651911"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
7 16
output:
975651911
result:
ok 1 number(s): "975651911"
Test #25:
score: 0
Accepted
time: 1ms
memory: 3912kb
input:
8 14
output:
640435461
result:
ok 1 number(s): "640435461"
Test #26:
score: 0
Accepted
time: 1ms
memory: 3916kb
input:
8 15
output:
640435461
result:
ok 1 number(s): "640435461"
Test #27:
score: 0
Accepted
time: 1ms
memory: 3972kb
input:
8 16
output:
640435461
result:
ok 1 number(s): "640435461"
Test #28:
score: 0
Accepted
time: 1ms
memory: 4088kb
input:
9 14
output:
835601883
result:
ok 1 number(s): "835601883"
Test #29:
score: 0
Accepted
time: 1ms
memory: 4088kb
input:
9 15
output:
835601883
result:
ok 1 number(s): "835601883"
Test #30:
score: 0
Accepted
time: 1ms
memory: 4312kb
input:
9 16
output:
835601883
result:
ok 1 number(s): "835601883"
Test #31:
score: 0
Accepted
time: 2ms
memory: 4444kb
input:
10 14
output:
817470300
result:
ok 1 number(s): "817470300"
Test #32:
score: 0
Accepted
time: 2ms
memory: 4704kb
input:
10 15
output:
817470300
result:
ok 1 number(s): "817470300"
Test #33:
score: 0
Accepted
time: 2ms
memory: 4408kb
input:
10 16
output:
817470300
result:
ok 1 number(s): "817470300"
Test #34:
score: 0
Accepted
time: 2ms
memory: 5164kb
input:
11 14
output:
53700186
result:
ok 1 number(s): "53700186"
Test #35:
score: 0
Accepted
time: 5ms
memory: 5424kb
input:
11 15
output:
53700186
result:
ok 1 number(s): "53700186"
Test #36:
score: 0
Accepted
time: 0ms
memory: 5420kb
input:
11 16
output:
53700186
result:
ok 1 number(s): "53700186"
Test #37:
score: 0
Accepted
time: 14ms
memory: 7536kb
input:
12 14
output:
98056471
result:
ok 1 number(s): "98056471"
Test #38:
score: 0
Accepted
time: 14ms
memory: 7240kb
input:
12 15
output:
98056471
result:
ok 1 number(s): "98056471"
Test #39:
score: 0
Accepted
time: 10ms
memory: 7248kb
input:
12 16
output:
98056471
result:
ok 1 number(s): "98056471"
Test #40:
score: 0
Accepted
time: 30ms
memory: 13608kb
input:
13 14
output:
859256927
result:
ok 1 number(s): "859256927"
Test #41:
score: 0
Accepted
time: 31ms
memory: 13568kb
input:
13 15
output:
859256927
result:
ok 1 number(s): "859256927"
Test #42:
score: 0
Accepted
time: 40ms
memory: 13532kb
input:
13 16
output:
859256927
result:
ok 1 number(s): "859256927"
Test #43:
score: 0
Accepted
time: 130ms
memory: 33668kb
input:
14 14
output:
241086631
result:
ok 1 number(s): "241086631"
Test #44:
score: 0
Accepted
time: 106ms
memory: 33540kb
input:
14 15
output:
241086631
result:
ok 1 number(s): "241086631"
Test #45:
score: 0
Accepted
time: 134ms
memory: 33544kb
input:
14 16
output:
241086631
result:
ok 1 number(s): "241086631"
Test #46:
score: 0
Accepted
time: 445ms
memory: 76108kb
input:
15 14
output:
518906901
result:
ok 1 number(s): "518906901"
Test #47:
score: 0
Accepted
time: 452ms
memory: 75960kb
input:
15 15
output:
518906901
result:
ok 1 number(s): "518906901"
Test #48:
score: 0
Accepted
time: 438ms
memory: 75932kb
input:
15 16
output:
518906901
result:
ok 1 number(s): "518906901"
Test #49:
score: 0
Accepted
time: 1483ms
memory: 187484kb
input:
16 14
output:
523929203
result:
ok 1 number(s): "523929203"
Test #50:
score: 0
Accepted
time: 1460ms
memory: 187360kb
input:
16 15
output:
523929203
result:
ok 1 number(s): "523929203"
Test #51:
score: 0
Accepted
time: 1445ms
memory: 187364kb
input:
16 16
output:
523929203
result:
ok 1 number(s): "523929203"
Test #52:
score: 0
Accepted
time: 160ms
memory: 33604kb
input:
17 14
output:
283163356
result:
ok 1 number(s): "283163356"
Test #53:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
2 15
output:
1190
result:
ok 1 number(s): "1190"
Test #54:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
2 16
output:
1190
result:
ok 1 number(s): "1190"
Test #55:
score: 0
Accepted
time: 452ms
memory: 68088kb
input:
18 14
output:
856842771
result:
ok 1 number(s): "856842771"
Test #56:
score: 0
Accepted
time: 442ms
memory: 68020kb
input:
18 15
output:
856842771
result:
ok 1 number(s): "856842771"
Test #57:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
3 14
output:
40460
result:
ok 1 number(s): "40460"
Test #58:
score: 0
Accepted
time: 99ms
memory: 19912kb
input:
19 14
output:
7934790
result:
ok 1 number(s): "7934790"
Test #59:
score: 0
Accepted
time: 1259ms
memory: 150112kb
input:
19 15
output:
200270800
result:
ok 1 number(s): "200270800"
Test #60:
score: 0
Accepted
time: 1246ms
memory: 149824kb
input:
19 16
output:
200270800
result:
ok 1 number(s): "200270800"
Test #61:
score: 0
Accepted
time: 227ms
memory: 38364kb
input:
20 14
output:
548507915
result:
ok 1 number(s): "548507915"
Test #62:
score: 0
Accepted
time: 232ms
memory: 38404kb
input:
20 15
output:
548507915
result:
ok 1 number(s): "548507915"
Test #63:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
2 14
output:
1190
result:
ok 1 number(s): "1190"
Test #64:
score: 0
Accepted
time: 67ms
memory: 14300kb
input:
21 14
output:
870542379
result:
ok 1 number(s): "870542379"
Test #65:
score: 0
Accepted
time: 578ms
memory: 77192kb
input:
21 15
output:
772538126
result:
ok 1 number(s): "772538126"
Test #66:
score: 0
Accepted
time: 580ms
memory: 77072kb
input:
21 16
output:
772538126
result:
ok 1 number(s): "772538126"
Test #67:
score: 0
Accepted
time: 153ms
memory: 24996kb
input:
22 14
output:
367190876
result:
ok 1 number(s): "367190876"
Test #68:
score: 0
Accepted
time: 145ms
memory: 24896kb
input:
22 15
output:
367190876
result:
ok 1 number(s): "367190876"
Test #69:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
1 15
output:
35
result:
ok 1 number(s): "35"
Test #70:
score: 0
Accepted
time: 60ms
memory: 13588kb
input:
23 14
output:
926139921
result:
ok 1 number(s): "926139921"
Test #71:
score: 0
Accepted
time: 341ms
memory: 46080kb
input:
23 15
output:
837524370
result:
ok 1 number(s): "837524370"
Test #72:
score: 0
Accepted
time: 327ms
memory: 46224kb
input:
23 16
output:
837524370
result:
ok 1 number(s): "837524370"
Test #73:
score: 0
Accepted
time: 126ms
memory: 22360kb
input:
24 14
output:
653211440
result:
ok 1 number(s): "653211440"
Test #74:
score: 0
Accepted
time: 138ms
memory: 22204kb
input:
24 15
output:
653211440
result:
ok 1 number(s): "653211440"
Test #75:
score: 0
Accepted
time: 750ms
memory: 87272kb
input:
24 16
output:
625596476
result:
ok 1 number(s): "625596476"
Test #76:
score: 0
Accepted
time: 54ms
memory: 12764kb
input:
25 14
output:
210481423
result:
ok 1 number(s): "210481423"
Test #77:
score: 0
Accepted
time: 287ms
memory: 38648kb
input:
25 15
output:
459501483
result:
ok 1 number(s): "459501483"
Test #78:
score: 0
Accepted
time: 285ms
memory: 38696kb
input:
25 16
output:
459501483
result:
ok 1 number(s): "459501483"
Test #79:
score: 0
Accepted
time: 104ms
memory: 19680kb
input:
26 14
output:
700174844
result:
ok 1 number(s): "700174844"
Test #80:
score: 0
Accepted
time: 127ms
memory: 19652kb
input:
26 15
output:
700174844
result:
ok 1 number(s): "700174844"
Test #81:
score: 0
Accepted
time: 607ms
memory: 69156kb
input:
26 16
output:
122186674
result:
ok 1 number(s): "122186674"
Test #82:
score: 0
Accepted
time: 62ms
memory: 13160kb
input:
27 14
output:
913367039
result:
ok 1 number(s): "913367039"
Test #83:
score: 0
Accepted
time: 232ms
memory: 33656kb
input:
27 15
output:
186251380
result:
ok 1 number(s): "186251380"
Test #84:
score: 0
Accepted
time: 241ms
memory: 33496kb
input:
27 16
output:
186251380
result:
ok 1 number(s): "186251380"
Test #85:
score: 0
Accepted
time: 140ms
memory: 20640kb
input:
28 14
output:
983307681
result:
ok 1 number(s): "983307681"
Test #86:
score: 0
Accepted
time: 117ms
memory: 20580kb
input:
28 15
output:
983307681
result:
ok 1 number(s): "983307681"
Test #87:
score: 0
Accepted
time: 414ms
memory: 49208kb
input:
28 16
output:
927000585
result:
ok 1 number(s): "927000585"
Test #88:
score: 0
Accepted
time: 60ms
memory: 11964kb
input:
29 14
output:
882936948
result:
ok 1 number(s): "882936948"
Test #89:
score: 0
Accepted
time: 243ms
memory: 33548kb
input:
29 15
output:
722751349
result:
ok 1 number(s): "722751349"
Test #90:
score: 0
Accepted
time: 227ms
memory: 33724kb
input:
29 16
output:
722751349
result:
ok 1 number(s): "722751349"
Test #91:
score: 0
Accepted
time: 116ms
memory: 18884kb
input:
30 14
output:
108117242
result:
ok 1 number(s): "108117242"
Test #92:
score: 0
Accepted
time: 109ms
memory: 18912kb
input:
30 15
output:
108117242
result:
ok 1 number(s): "108117242"
Test #93:
score: 0
Accepted
time: 418ms
memory: 48556kb
input:
30 16
output:
193651384
result:
ok 1 number(s): "193651384"
Test #94:
score: 0
Accepted
time: 61ms
memory: 12532kb
input:
31 14
output:
513230800
result:
ok 1 number(s): "513230800"
Test #95:
score: 0
Accepted
time: 208ms
memory: 27644kb
input:
31 15
output:
674328439
result:
ok 1 number(s): "674328439"
Test #96:
score: 0
Accepted
time: 206ms
memory: 27636kb
input:
31 16
output:
674328439
result:
ok 1 number(s): "674328439"
Test #97:
score: 0
Accepted
time: 118ms
memory: 19384kb
input:
32 14
output:
416220793
result:
ok 1 number(s): "416220793"
Test #98:
score: 0
Accepted
time: 120ms
memory: 19404kb
input:
32 15
output:
416220793
result:
ok 1 number(s): "416220793"
Test #99:
score: 0
Accepted
time: 365ms
memory: 43984kb
input:
32 16
output:
320541366
result:
ok 1 number(s): "320541366"
Test #100:
score: 0
Accepted
time: 61ms
memory: 12280kb
input:
33 14
output:
621313042
result:
ok 1 number(s): "621313042"
Test #101:
score: 0
Accepted
time: 213ms
memory: 28144kb
input:
33 15
output:
344434925
result:
ok 1 number(s): "344434925"
Test #102:
score: 0
Accepted
time: 202ms
memory: 28288kb
input:
33 16
output:
344434925
result:
ok 1 number(s): "344434925"
Test #103:
score: 0
Accepted
time: 121ms
memory: 18920kb
input:
34 14
output:
456772536
result:
ok 1 number(s): "456772536"
Test #104:
score: 0
Accepted
time: 121ms
memory: 18920kb
input:
34 15
output:
456772536
result:
ok 1 number(s): "456772536"
Test #105:
score: 0
Accepted
time: 374ms
memory: 44208kb
input:
34 16
output:
41377116
result:
ok 1 number(s): "41377116"
Test #106:
score: 0
Accepted
time: 64ms
memory: 12780kb
input:
35 14
output:
19615141
result:
ok 1 number(s): "19615141"
Test #107:
score: 0
Accepted
time: 205ms
memory: 27380kb
input:
35 15
output:
746309694
result:
ok 1 number(s): "746309694"
Test #108:
score: 0
Accepted
time: 209ms
memory: 27516kb
input:
35 16
output:
746309694
result:
ok 1 number(s): "746309694"
Test #109:
score: 0
Accepted
time: 122ms
memory: 19604kb
input:
36 14
output:
393489643
result:
ok 1 number(s): "393489643"
Test #110:
score: 0
Accepted
time: 126ms
memory: 19704kb
input:
36 15
output:
393489643
result:
ok 1 number(s): "393489643"
Test #111:
score: 0
Accepted
time: 397ms
memory: 43008kb
input:
36 16
output:
441641679
result:
ok 1 number(s): "441641679"
Test #112:
score: 0
Accepted
time: 50ms
memory: 11860kb
input:
37 14
output:
46923435
result:
ok 1 number(s): "46923435"
Test #113:
score: 0
Accepted
time: 258ms
memory: 33720kb
input:
37 15
output:
886630375
result:
ok 1 number(s): "886630375"
Test #114:
score: 0
Accepted
time: 260ms
memory: 33720kb
input:
37 16
output:
886630375
result:
ok 1 number(s): "886630375"
Test #115:
score: 0
Accepted
time: 128ms
memory: 18360kb
input:
38 14
output:
449547036
result:
ok 1 number(s): "449547036"
Test #116:
score: 0
Accepted
time: 127ms
memory: 18372kb
input:
38 15
output:
449547036
result:
ok 1 number(s): "449547036"
Test #117:
score: 0
Accepted
time: 500ms
memory: 44732kb
input:
38 16
output:
812627363
result:
ok 1 number(s): "812627363"
Test #118:
score: 0
Accepted
time: 93ms
memory: 13292kb
input:
39 14
output:
719463683
result:
ok 1 number(s): "719463683"
Test #119:
score: 0
Accepted
time: 253ms
memory: 26028kb
input:
39 15
output:
741109614
result:
ok 1 number(s): "741109614"
Test #120:
score: 0
Accepted
time: 256ms
memory: 25956kb
input:
39 16
output:
741109614
result:
ok 1 number(s): "741109614"
Test #121:
score: 0
Accepted
time: 175ms
memory: 20672kb
input:
40 14
output:
578267772
result:
ok 1 number(s): "578267772"
Test #122:
score: 0
Accepted
time: 191ms
memory: 20708kb
input:
40 15
output:
578267772
result:
ok 1 number(s): "578267772"
Test #123:
score: 0
Accepted
time: 460ms
memory: 41356kb
input:
40 16
output:
87606680
result:
ok 1 number(s): "87606680"
Test #124:
score: 0
Accepted
time: 79ms
memory: 12564kb
input:
41 14
output:
236787740
result:
ok 1 number(s): "236787740"
Test #125:
score: 0
Accepted
time: 353ms
memory: 33484kb
input:
41 15
output:
38008293
result:
ok 1 number(s): "38008293"
Test #126:
score: 0
Accepted
time: 343ms
memory: 33720kb
input:
41 16
output:
38008293
result:
ok 1 number(s): "38008293"
Test #127:
score: 0
Accepted
time: 174ms
memory: 19384kb
input:
42 14
output:
733637961
result:
ok 1 number(s): "733637961"
Test #128:
score: 0
Accepted
time: 169ms
memory: 19156kb
input:
42 15
output:
733637961
result:
ok 1 number(s): "733637961"
Test #129:
score: 0
Accepted
time: 538ms
memory: 46336kb
input:
42 16
output:
434859171
result:
ok 1 number(s): "434859171"
Test #130:
score: 0
Accepted
time: 87ms
memory: 12040kb
input:
43 14
output:
47849093
result:
ok 1 number(s): "47849093"
Test #131:
score: 0
Accepted
time: 290ms
memory: 27068kb
input:
43 15
output:
193064473
result:
ok 1 number(s): "193064473"
Test #132:
score: 0
Accepted
time: 289ms
memory: 27072kb
input:
43 16
output:
193064473
result:
ok 1 number(s): "193064473"
Test #133:
score: 0
Accepted
time: 173ms
memory: 18388kb
input:
44 14
output:
686919557
result:
ok 1 number(s): "686919557"
Test #134:
score: 0
Accepted
time: 163ms
memory: 18396kb
input:
44 15
output:
686919557
result:
ok 1 number(s): "686919557"
Test #135:
score: 0
Accepted
time: 511ms
memory: 42400kb
input:
44 16
output:
566574323
result:
ok 1 number(s): "566574323"
Test #136:
score: 0
Accepted
time: 95ms
memory: 12200kb
input:
45 14
output:
260321674
result:
ok 1 number(s): "260321674"
Test #137:
score: 0
Accepted
time: 279ms
memory: 26236kb
input:
45 15
output:
506139919
result:
ok 1 number(s): "506139919"
Test #138:
score: 0
Accepted
time: 260ms
memory: 26264kb
input:
45 16
output:
506139919
result:
ok 1 number(s): "506139919"
Test #139:
score: 0
Accepted
time: 181ms
memory: 19148kb
input:
46 14
output:
511432655
result:
ok 1 number(s): "511432655"
Test #140:
score: 0
Accepted
time: 180ms
memory: 19176kb
input:
46 15
output:
511432655
result:
ok 1 number(s): "511432655"
Test #141:
score: 0
Accepted
time: 488ms
memory: 41856kb
input:
46 16
output:
481315001
result:
ok 1 number(s): "481315001"
Test #142:
score: 0
Accepted
time: 104ms
memory: 13044kb
input:
47 14
output:
384592237
result:
ok 1 number(s): "384592237"
Test #143:
score: 0
Accepted
time: 304ms
memory: 27916kb
input:
47 15
output:
567984582
result:
ok 1 number(s): "567984582"
Test #144:
score: 0
Accepted
time: 305ms
memory: 27984kb
input:
47 16
output:
567984582
result:
ok 1 number(s): "567984582"
Test #145:
score: 0
Accepted
time: 204ms
memory: 20192kb
input:
48 14
output:
892965619
result:
ok 1 number(s): "892965619"
Test #146:
score: 0
Accepted
time: 215ms
memory: 20236kb
input:
48 15
output:
892965619
result:
ok 1 number(s): "892965619"
Test #147:
score: 0
Accepted
time: 523ms
memory: 44124kb
input:
48 16
output:
212857460
result:
ok 1 number(s): "212857460"
Test #148:
score: 0
Accepted
time: 92ms
memory: 11996kb
input:
49 14
output:
556984122
result:
ok 1 number(s): "556984122"
Test #149:
score: 0
Accepted
time: 357ms
memory: 33548kb
input:
49 15
output:
742291499
result:
ok 1 number(s): "742291499"
Test #150:
score: 0
Accepted
time: 367ms
memory: 33584kb
input:
49 16
output:
742291499
result:
ok 1 number(s): "742291499"
Test #151:
score: 0
Accepted
time: 1ms
memory: 4096kb
input:
50 0
output:
28839309
result:
ok 1 number(s): "28839309"
Test #152:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
50 1
output:
28839309
result:
ok 1 number(s): "28839309"
Test #153:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
50 2
output:
978420101
result:
ok 1 number(s): "978420101"
Test #154:
score: 0
Accepted
time: 0ms
memory: 4100kb
input:
50 3
output:
978420101
result:
ok 1 number(s): "978420101"
Test #155:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
50 4
output:
874479757
result:
ok 1 number(s): "874479757"
Test #156:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
50 5
output:
874479757
result:
ok 1 number(s): "874479757"
Test #157:
score: 0
Accepted
time: 1ms
memory: 3964kb
input:
50 6
output:
552575330
result:
ok 1 number(s): "552575330"
Test #158:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
50 7
output:
552575330
result:
ok 1 number(s): "552575330"
Test #159:
score: 0
Accepted
time: 0ms
memory: 4436kb
input:
50 8
output:
987131197
result:
ok 1 number(s): "987131197"
Test #160:
score: 0
Accepted
time: 3ms
memory: 4468kb
input:
50 9
output:
987131197
result:
ok 1 number(s): "987131197"
Test #161:
score: 0
Accepted
time: 11ms
memory: 5084kb
input:
50 10
output:
167332917
result:
ok 1 number(s): "167332917"
Test #162:
score: 0
Accepted
time: 11ms
memory: 5084kb
input:
50 11
output:
167332917
result:
ok 1 number(s): "167332917"
Test #163:
score: 0
Accepted
time: 46ms
memory: 8888kb
input:
50 12
output:
8338708
result:
ok 1 number(s): "8338708"
Test #164:
score: 0
Accepted
time: 50ms
memory: 8884kb
input:
50 13
output:
8338708
result:
ok 1 number(s): "8338708"
Test #165:
score: 0
Accepted
time: 177ms
memory: 18776kb
input:
50 14
output:
350736024
result:
ok 1 number(s): "350736024"
Test #166:
score: 0
Accepted
time: 178ms
memory: 18592kb
input:
50 15
output:
350736024
result:
ok 1 number(s): "350736024"
Test #167:
score: 0
Accepted
time: 587ms
memory: 45736kb
input:
50 16
output:
547343798
result:
ok 1 number(s): "547343798"
Test #168:
score: 0
Accepted
time: 1ms
memory: 3792kb
input:
99 0
output:
288066947
result:
ok 1 number(s): "288066947"
Test #169:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
99 1
output:
407223503
result:
ok 1 number(s): "407223503"
Test #170:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
99 2
output:
407223503
result:
ok 1 number(s): "407223503"
Test #171:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
99 3
output:
180967522
result:
ok 1 number(s): "180967522"
Test #172:
score: 0
Accepted
time: 1ms
memory: 4104kb
input:
99 4
output:
180967522
result:
ok 1 number(s): "180967522"
Test #173:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
99 5
output:
115126923
result:
ok 1 number(s): "115126923"
Test #174:
score: 0
Accepted
time: 1ms
memory: 3912kb
input:
99 6
output:
115126923
result:
ok 1 number(s): "115126923"
Test #175:
score: 0
Accepted
time: 3ms
memory: 3988kb
input:
99 7
output:
756367923
result:
ok 1 number(s): "756367923"
Test #176:
score: 0
Accepted
time: 3ms
memory: 3924kb
input:
99 8
output:
756367923
result:
ok 1 number(s): "756367923"
Test #177:
score: 0
Accepted
time: 11ms
memory: 4800kb
input:
99 9
output:
348304157
result:
ok 1 number(s): "348304157"
Test #178:
score: 0
Accepted
time: 11ms
memory: 4544kb
input:
99 10
output:
348304157
result:
ok 1 number(s): "348304157"
Test #179:
score: 0
Accepted
time: 40ms
memory: 6120kb
input:
99 11
output:
919024542
result:
ok 1 number(s): "919024542"
Test #180:
score: 0
Accepted
time: 41ms
memory: 6100kb
input:
99 12
output:
919024542
result:
ok 1 number(s): "919024542"
Test #181:
score: 0
Accepted
time: 152ms
memory: 12988kb
input:
99 13
output:
618568674
result:
ok 1 number(s): "618568674"
Test #182:
score: 0
Accepted
time: 157ms
memory: 13060kb
input:
99 14
output:
618568674
result:
ok 1 number(s): "618568674"
Test #183:
score: 0
Accepted
time: 408ms
memory: 26572kb
input:
99 15
output:
161030851
result:
ok 1 number(s): "161030851"
Test #184:
score: 0
Accepted
time: 388ms
memory: 26660kb
input:
99 16
output:
161030851
result:
ok 1 number(s): "161030851"
Test #185:
score: 0
Accepted
time: 0ms
memory: 4092kb
input:
100 0
output:
681164487
result:
ok 1 number(s): "681164487"
Test #186:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
100 1
output:
681164487
result:
ok 1 number(s): "681164487"
Test #187:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
100 2
output:
656785158
result:
ok 1 number(s): "656785158"
Test #188:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
100 3
output:
656785158
result:
ok 1 number(s): "656785158"
Test #189:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
100 4
output:
645848758
result:
ok 1 number(s): "645848758"
Test #190:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
100 5
output:
645848758
result:
ok 1 number(s): "645848758"
Test #191:
score: 0
Accepted
time: 2ms
memory: 3888kb
input:
100 6
output:
63066030
result:
ok 1 number(s): "63066030"
Test #192:
score: 0
Accepted
time: 2ms
memory: 4200kb
input:
100 7
output:
63066030
result:
ok 1 number(s): "63066030"
Test #193:
score: 0
Accepted
time: 3ms
memory: 4192kb
input:
100 8
output:
15459138
result:
ok 1 number(s): "15459138"
Test #194:
score: 0
Accepted
time: 6ms
memory: 4184kb
input:
100 9
output:
15459138
result:
ok 1 number(s): "15459138"
Test #195:
score: 0
Accepted
time: 18ms
memory: 5064kb
input:
100 10
output:
552094543
result:
ok 1 number(s): "552094543"
Test #196:
score: 0
Accepted
time: 14ms
memory: 5340kb
input:
100 11
output:
552094543
result:
ok 1 number(s): "552094543"
Test #197:
score: 0
Accepted
time: 64ms
memory: 8076kb
input:
100 12
output:
436446274
result:
ok 1 number(s): "436446274"
Test #198:
score: 0
Accepted
time: 73ms
memory: 8068kb
input:
100 13
output:
436446274
result:
ok 1 number(s): "436446274"
Test #199:
score: 0
Accepted
time: 265ms
memory: 20376kb
input:
100 14
output:
721859177
result:
ok 1 number(s): "721859177"
Test #200:
score: 0
Accepted
time: 280ms
memory: 20240kb
input:
100 15
output:
721859177
result:
ok 1 number(s): "721859177"
Test #201:
score: 0
Accepted
time: 0ms
memory: 4108kb
input:
1 14
output:
35
result:
ok 1 number(s): "35"
Test #202:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
1 0
output:
35
result:
ok 1 number(s): "35"
Test #203:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
2 0
output:
1190
result:
ok 1 number(s): "1190"
Test #204:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
3 0
output:
42875
result:
ok 1 number(s): "42875"
Test #205:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
4 0
output:
1499400
result:
ok 1 number(s): "1499400"
Test #206:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
1 1
output:
35
result:
ok 1 number(s): "35"
Test #207:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
2 1
output:
1190
result:
ok 1 number(s): "1190"
Test #208:
score: 0
Accepted
time: 0ms
memory: 4108kb
input:
3 1
output:
40460
result:
ok 1 number(s): "40460"
Test #209:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
4 1
output:
1499400
result:
ok 1 number(s): "1499400"
Test #210:
score: 0
Accepted
time: 0ms
memory: 4096kb
input:
5 1
output:
52437350
result:
ok 1 number(s): "52437350"
Test #211:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
2 2
output:
1190
result:
ok 1 number(s): "1190"
Test #212:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
3 2
output:
40460
result:
ok 1 number(s): "40460"
Test #213:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
4 2
output:
1374450
result:
ok 1 number(s): "1374450"
Test #214:
score: 0
Accepted
time: 0ms
memory: 4068kb
input:
5 2
output:
52437350
result:
ok 1 number(s): "52437350"
Test #215:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
6 2
output:
835562307
result:
ok 1 number(s): "835562307"
Test #216:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
3 3
output:
40460
result:
ok 1 number(s): "40460"
Test #217:
score: 0
Accepted
time: 0ms
memory: 4100kb
input:
4 3
output:
1374450
result:
ok 1 number(s): "1374450"
Test #218:
score: 0
Accepted
time: 0ms
memory: 4116kb
input:
5 3
output:
46692030
result:
ok 1 number(s): "46692030"
Test #219:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
6 3
output:
835562307
result:
ok 1 number(s): "835562307"
Test #220:
score: 0
Accepted
time: 0ms
memory: 4120kb
input:
7 3
output:
243160728
result:
ok 1 number(s): "243160728"
Test #221:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
4 4
output:
1374450
result:
ok 1 number(s): "1374450"
Test #222:
score: 0
Accepted
time: 0ms
memory: 4116kb
input:
5 4
output:
46692030
result:
ok 1 number(s): "46692030"
Test #223:
score: 0
Accepted
time: 0ms
memory: 4128kb
input:
6 4
output:
587910217
result:
ok 1 number(s): "587910217"
Test #224:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
7 4
output:
243160728
result:
ok 1 number(s): "243160728"
Test #225:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
8 4
output:
685973492
result:
ok 1 number(s): "685973492"
Test #226:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
5 5
output:
46692030
result:
ok 1 number(s): "46692030"
Test #227:
score: 0
Accepted
time: 0ms
memory: 4120kb
input:
6 5
output:
587910217
result:
ok 1 number(s): "587910217"
Test #228:
score: 0
Accepted
time: 1ms
memory: 4076kb
input:
7 5
output:
975651911
result:
ok 1 number(s): "975651911"
Test #229:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
8 5
output:
685973492
result:
ok 1 number(s): "685973492"
Test #230:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
9 5
output:
759563643
result:
ok 1 number(s): "759563643"
Test #231:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
6 6
output:
587910217
result:
ok 1 number(s): "587910217"
Test #232:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
7 6
output:
975651911
result:
ok 1 number(s): "975651911"
Test #233:
score: 0
Accepted
time: 1ms
memory: 3880kb
input:
8 6
output:
640435461
result:
ok 1 number(s): "640435461"
Test #234:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
9 6
output:
759563643
result:
ok 1 number(s): "759563643"
Test #235:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
10 6
output:
254435821
result:
ok 1 number(s): "254435821"
Test #236:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
7 7
output:
975651911
result:
ok 1 number(s): "975651911"
Test #237:
score: 0
Accepted
time: 1ms
memory: 3916kb
input:
8 7
output:
640435461
result:
ok 1 number(s): "640435461"
Test #238:
score: 0
Accepted
time: 1ms
memory: 4000kb
input:
9 7
output:
835601883
result:
ok 1 number(s): "835601883"
Test #239:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
10 7
output:
254435821
result:
ok 1 number(s): "254435821"
Test #240:
score: 0
Accepted
time: 0ms
memory: 3932kb
input:
11 7
output:
132182305
result:
ok 1 number(s): "132182305"
Test #241:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
8 8
output:
640435461
result:
ok 1 number(s): "640435461"
Test #242:
score: 0
Accepted
time: 1ms
memory: 4348kb
input:
9 8
output:
835601883
result:
ok 1 number(s): "835601883"
Test #243:
score: 0
Accepted
time: 0ms
memory: 4380kb
input:
10 8
output:
817470300
result:
ok 1 number(s): "817470300"
Test #244:
score: 0
Accepted
time: 1ms
memory: 3976kb
input:
11 8
output:
132182305
result:
ok 1 number(s): "132182305"
Test #245:
score: 0
Accepted
time: 2ms
memory: 4140kb
input:
12 8
output:
266655880
result:
ok 1 number(s): "266655880"
Test #246:
score: 0
Accepted
time: 1ms
memory: 4000kb
input:
9 9
output:
835601883
result:
ok 1 number(s): "835601883"
Test #247:
score: 0
Accepted
time: 2ms
memory: 4404kb
input:
10 9
output:
817470300
result:
ok 1 number(s): "817470300"
Test #248:
score: 0
Accepted
time: 5ms
memory: 5136kb
input:
11 9
output:
53700186
result:
ok 1 number(s): "53700186"
Test #249:
score: 0
Accepted
time: 0ms
memory: 4136kb
input:
12 9
output:
266655880
result:
ok 1 number(s): "266655880"
Test #250:
score: 0
Accepted
time: 3ms
memory: 4616kb
input:
13 9
output:
287356847
result:
ok 1 number(s): "287356847"
Test #251:
score: 0
Accepted
time: 2ms
memory: 4468kb
input:
10 10
output:
817470300
result:
ok 1 number(s): "817470300"
Test #252:
score: 0
Accepted
time: 0ms
memory: 5132kb
input:
11 10
output:
53700186
result:
ok 1 number(s): "53700186"
Test #253:
score: 0
Accepted
time: 9ms
memory: 7544kb
input:
12 10
output:
98056471
result:
ok 1 number(s): "98056471"
Test #254:
score: 0
Accepted
time: 3ms
memory: 4600kb
input:
13 10
output:
287356847
result:
ok 1 number(s): "287356847"
Test #255:
score: 0
Accepted
time: 8ms
memory: 5696kb
input:
14 10
output:
766627505
result:
ok 1 number(s): "766627505"
Test #256:
score: 0
Accepted
time: 2ms
memory: 5128kb
input:
11 11
output:
53700186
result:
ok 1 number(s): "53700186"
Test #257:
score: 0
Accepted
time: 14ms
memory: 7328kb
input:
12 11
output:
98056471
result:
ok 1 number(s): "98056471"
Test #258:
score: 0
Accepted
time: 41ms
memory: 13588kb
input:
13 11
output:
859256927
result:
ok 1 number(s): "859256927"
Test #259:
score: 0
Accepted
time: 9ms
memory: 5724kb
input:
14 11
output:
766627505
result:
ok 1 number(s): "766627505"
Test #260:
score: 0
Accepted
time: 22ms
memory: 8308kb
input:
15 11
output:
38776983
result:
ok 1 number(s): "38776983"
Test #261:
score: 0
Accepted
time: 11ms
memory: 7508kb
input:
12 12
output:
98056471
result:
ok 1 number(s): "98056471"
Test #262:
score: 0
Accepted
time: 39ms
memory: 13564kb
input:
13 12
output:
859256927
result:
ok 1 number(s): "859256927"
Test #263:
score: 0
Accepted
time: 136ms
memory: 33616kb
input:
14 12
output:
241086631
result:
ok 1 number(s): "241086631"
Test #264:
score: 0
Accepted
time: 21ms
memory: 8336kb
input:
15 12
output:
38776983
result:
ok 1 number(s): "38776983"
Test #265:
score: 0
Accepted
time: 50ms
memory: 14556kb
input:
16 12
output:
762853130
result:
ok 1 number(s): "762853130"
Test #266:
score: 0
Accepted
time: 39ms
memory: 13600kb
input:
13 13
output:
859256927
result:
ok 1 number(s): "859256927"
Test #267:
score: 0
Accepted
time: 137ms
memory: 33552kb
input:
14 13
output:
241086631
result:
ok 1 number(s): "241086631"
Test #268:
score: 0
Accepted
time: 446ms
memory: 75984kb
input:
15 13
output:
518906901
result:
ok 1 number(s): "518906901"
Test #269:
score: 0
Accepted
time: 53ms
memory: 14556kb
input:
16 13
output:
762853130
result:
ok 1 number(s): "762853130"
Test #270:
score: 0
Accepted
time: 150ms
memory: 33552kb
input:
17 13
output:
283163356
result:
ok 1 number(s): "283163356"