QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#422195 | #4986. 普勒亚 | wtc# | 100 ✓ | 147ms | 60564kb | C++14 | 1.8kb | 2024-05-26 22:18:33 | 2024-05-26 22:18:33 |
Judging History
answer
#include<bits/stdc++.h>
#define fo(i,l,r) for(int i=(l);i<=(r);++i)
#define fd(i,l,r) for(int i=(l);i>=(r);--i)
#define fu(i,l,r) for(int i=(l);i<(r);++i)
#define ll long long
using namespace std;
const int N=100007;
int n,a[N],g[N];
char s[N];
int tot,to[N<<1],head[N<<1],nx[N<<1];
void add(int x,int y){nx[y]=head[x];head[x]=y;}
namespace tree{
struct node{
int ls,rs,s,mn;
}t[N<<5];
int rt[N<<1],cnt;
void upd(int l,int r,int &o,int x)
{
if(!o) o=++cnt;
t[o].mn=a[x],t[o].s=1;
if(l==r) return;
int mid=l+r>>1;
if(x<=mid) upd(l,mid,t[o].ls,x);
else upd(mid+1,r,t[o].rs,x);
}
int calc(int o,int mn)
{
if(!o) return 0;
if(!t[o].ls&&!t[o].rs) return mn<t[o].mn;
if(mn<t[t[o].ls].mn) return t[o].s-t[t[o].ls].s+calc(t[o].ls,mn);
return calc(t[o].rs,mn);
}
int merge(int x,int y)
{
if(!x||!y) return x+y;
t[x].ls=merge(t[x].ls,t[y].ls);
t[x].rs=merge(t[x].rs,t[y].rs);
t[x].s=t[t[x].ls].s+calc(t[x].rs,t[t[x].ls].mn);
t[x].mn=max(t[x].mn,t[y].mn);
return x;
}
}
using tree::rt;
using tree::upd;
using tree::merge;
int cnt=1,lt=1;
struct node{
int len,f,c[26];
}t[N<<1];
void ins(int c)
{
int p=lt,u=lt=++cnt;t[u].len=t[p].len+1;
upd(1,n,rt[u],t[u].len);
for(;p&&!t[p].c[c];p=t[p].f) t[p].c[c]=u;
if(!p){t[u].f=1;return;}
int q=t[p].c[c];
if(t[q].len==t[p].len+1){t[u].f=q;return;}
int v=++cnt;t[v]=t[q];
t[v].len=t[p].len+1;t[u].f=t[q].f=v;
for(;p&&t[p].c[c]==q;p=t[p].f) t[p].c[c]=v;
}
void dfs(int x)
{
for(int i=head[x];i;i=nx[i])
dfs(i),rt[x]=merge(rt[x],rt[i]);
if(x>1)
{
int w=tree::t[rt[x]].s;
g[t[x].len]+=w;g[t[t[x].f].len]-=w;
}
}
int main()
{
scanf("%s",s+1);n=strlen(s+1);
fo(i,1,n) scanf("%d",&a[i]);
fo(i,1,n) ins(s[i]-'a');
fo(i,2,cnt) add(t[i].f,i);
dfs(1);
fd(i,n,1) g[i]+=g[i+1];
fo(i,1,n) printf("%d ",g[i]);
}
詳細信息
Subtask #1:
score: 20
Accepted
Test #1:
score: 20
Accepted
time: 1ms
memory: 10076kb
input:
acbbaabcbbaabaabbbbaaabcbabcaccabbaaaccbabacccbabbbcbcabbbabbacacbabccbacbaaabbaccacbbcbccbcacbaccac 68 23 71 12 36 58 63 45 66 70 89 13 58 3 77 67 9 29 31 78 85 77 58 25 33 16 16 75 30 21 88 10 11 85 70 13 39 40 94 7 80 69 36 78 94 90 95 69 25 38 80 57 80 83 61 70 2 35 57 52 14 57 55 48 67 4 15 69 ...
output:
11 31 53 68 85 93 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
result:
ok 100 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
pyypypypllyypllpyylpyppppylplylyyyllyplllyplyyppyllyplllylyyyyppppplllpyppypyllyyyypllpplpyyppppplyl 6489 12699 24452 25390 7084 9393 15186 18132 18638 23884 30910 25366 22450 25060 17009 15823 25943 4038 9105 3159 3394 8634 987 3917 26155 2531 10738 23443 14071 8934 14326 13465 30694 31823 22105 23...
output:
15 29 50 70 86 89 92 92 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
result:
ok 100 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
sivypusnsmldqevumxpgzsgvnvqiqnqarsteljbjoueplofavfeplsezjanzrzmyesmonwoxprqyifaxyflsgcingmonlpfamgho 824 8633 25470 16839 2516 24546 3657 32721 18866 4758 32384 30834 23868 21480 27132 15853 12867 11445 32560 10678 19952 6351 26812 8642 3325 5723 12096 17152 13348 17528 28014 5416 25816 21794 2660 1...
output:
46 94 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
result:
ok 100 numbers
Test #4:
score: 0
Accepted
time: 1ms
memory: 9924kb
input:
dikckgegjllikcefjkffkkdkehkgljijlgddclelihfilhkchcgjjedlkdicljjedeggkedcdejfeeccecihhkllccikiddjkhdf 8532 4283 22131 21749 2077 18828 32692 3150 15868 13422 14546 5611 7047 24814 18227 1382 31354 17447 1174 25172 17835 22757 3751 27010 17728 2826 5328 29566 31519 29232 14419 9305 9126 8079 12950 186...
output:
30 84 96 96 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
result:
ok 100 numbers
Subtask #2:
score: 20
Accepted
Dependency #1:
100%
Accepted
Test #5:
score: 20
Accepted
time: 5ms
memory: 9860kb
input:
gznnqpxkzmcgjxdgrbxtzvxvyjbxppmwgmsjoaarfhxkliuvethzkeqpvylstflsxebyobyzchpexvqdtdefzkfzxrxixhjbszfmrhhebvrjgqxruxjtifjyzvsoynsradgqeguhqbvqdfngmudhkwijwidmyjcxuwpadduiirjwtkydgfwdkkyrbsafnlwkgiojepgfqtjuunwggkaiihoecvlzeedpuzbulgufcpndklbyzbtavfizvntumsvfbzxseselpxcskarxgbactejwvgqvxkweaaocfqdgqfda...
output:
158 1802 4673 4989 4996 4995 4994 4993 4992 4991 4990 4989 4988 4987 4986 4985 4984 4983 4982 4981 4980 4979 4978 4977 4976 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 4...
result:
ok 5000 numbers
Test #6:
score: 0
Accepted
time: 2ms
memory: 8992kb
input:
caacccbcccaaacbbbaccbaccacbaccbaabccacbaaacbcbbabbccaacbbbabbaacbbbaacabbaabcccbcaaacbabcbcccacbcbaccbcbacbacbcababacabbbabababccbbcacbcbaaacabcbcabbccacbabcbcbaabaabbcccaacbcbaabcacaaccbcaaccababababbacbbccccaccaccbacbbcbbbbaaccbabbaaaacabbbbbaaaaaaacaabbacbbbcbcbcccaaaabbbbcbcabcabcabcacaacbbbbabc...
output:
27 78 190 420 916 1825 3179 4207 4693 4877 4947 4971 4981 4985 4986 4985 4984 4983 4982 4981 4980 4979 4978 4977 4976 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 4940 49...
result:
ok 5000 numbers
Test #7:
score: 0
Accepted
time: 5ms
memory: 11052kb
input:
ccaccbbcaabaaaaabaaccbaaaacbcacabaaaabbcbcabbbbcabcacbaacbbbbcabbcccccabcaaacbabcaccaaccbccbbccacaccbaaaaaaabcacbaabbabacabaccccacaacbaabbacccbaababbbcbbccbabbcacacbaabcccbbbcaabacccbbbbabaccbcbbacabaabbbcccabccccacacacbbacacbbcbbcbababcbcacacacbbbacabcaaccccccbbccccacbbaabababbcaacbccccaccbabcccccc...
output:
5000 4999 4998 4997 4996 4995 4994 4993 4992 4991 4990 4989 4988 4987 4986 4985 4984 4983 4982 4981 4980 4979 4978 4977 4976 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 ...
result:
ok 5000 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 12188kb
input:
wxwwwxwwxwxxwwxwxxxwwwwwwxwxxwxwwwwxxxwxwxxwwxwxwwwwwxxwxxxwxxwxwxxwxwwwwwwwwxxxxxwxxwwwwxwxxxwwxwwwxwwwxxwxxwwwwwxwwxxxxxxxwxwwxxxwwxwwwwxwwxxwxxwxwxwwxxwwxxxxxwwwwwwwxxxwxwwwwwwwwxwwxxwxwwxxwxxwxxxxxwwxwwxwwwxwwxxwwxwwwwwxxxxxxxwwxxxxwwwwxxxwxwxwwxwxxxwxwwwxwxwwxwwxwwxwxwwwxwxxxxwxwxwwxxwxwxxwwxxx...
output:
2 4 8 16 32 64 128 256 512 1017 1899 2931 3786 4364 4676 4833 4901 4937 4952 4960 4966 4969 4972 4973 4974 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 4940 4939 4938 493...
result:
ok 5000 numbers
Subtask #3:
score: 20
Accepted
Test #9:
score: 20
Accepted
time: 91ms
memory: 52580kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
14 18 17 16 16 15 15 15 14 15 14 14 15 14 15 14 13 14 15 14 14 14 13 16 15 15 14 13 14 15 14 13 14 14 14 14 13 13 12 17 17 16 15 14 14 13 16 15 16 15 16 15 17 16 15 14 14 13 13 12 14 15 14 15 15 14 13 14 14 13 15 14 13 13 13 12 11 12 13 12 14 13 13 13 12 14 14 13 13 14 13 12 12 11 13 12 13 12 11 13 ...
result:
ok 100000 numbers
Test #10:
score: 0
Accepted
time: 71ms
memory: 52660kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
50001 50000 50000 49999 49999 49998 49998 49997 49997 49996 49996 49995 49995 49994 49994 49993 49993 49992 49992 49991 49991 49990 49990 49989 49989 49988 49988 49987 49987 49986 49986 49985 49985 49984 49984 49983 49983 49982 49982 49981 49981 49980 49980 49979 49979 49978 49978 49977 49977 49976 ...
result:
ok 100000 numbers
Test #11:
score: 0
Accepted
time: 74ms
memory: 53864kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
100000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951...
result:
ok 100000 numbers
Test #12:
score: 0
Accepted
time: 65ms
memory: 52624kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 100000 numbers
Subtask #4:
score: 40
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #13:
score: 40
Accepted
time: 127ms
memory: 60564kb
input:
yzyzyzyzyzzzyzzzzzyyzzyzzyyyzzzyyzzyyyyzyyzyzyzzzyyzyyyzzyyzzzzzzyyzzzzzzzyyzyyyzzyzyzzzzzyyzyzzzyyzzyzzyzzzzyzzzyyzzyzyzzyzyzzyyzzyzyyyzzyzzyyzyzyyzzyzzzyyzyzzzzzzyzzyzzzzyyyyzzyzzzyzyzyyzzzzyzzyzyyyyyzyzyzzyyyyyyzyzyyzyyyyzzzyyzyzzyyyyyzyyyyyyzyzyzyyyzzyzzzyzzzyzzzzyyzzzzyyyzyyyyyyyyyyzzyzyyzyyzyy...
output:
22 42 79 152 265 489 885 1605 2933 5260 9182 15530 25276 39335 56420 72569 84464 91679 95766 97928 98991 99514 99770 99897 99937 99957 99966 99968 99969 99970 99969 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 99950 99949 99948 999...
result:
ok 100000 numbers
Test #14:
score: 0
Accepted
time: 126ms
memory: 55292kb
input:
ecbadcadbabaeeeaabcaceacadaeadbadbdedbbcebebcedaadbcaceaaccaddbaadcaeecebcbeceeeebadeabccadbebebeedecbdcedeceaeecacdeacebecaadacaacbacacbcaddccdbdeabaeaacbccedabaeddbadabcecdccccecebacccaeeeccedcdadeaedecaddddcddbcabbaaacdddeecdbaaeebedadbaeeabdbbaecadaacdababdadebecaaccecebbdceaaecceeedacbaeabeeeeb...
output:
64 263 966 3570 12782 38217 75237 93930 98742 99740 99943 99978 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 99950 99...
result:
ok 100000 numbers
Test #15:
score: 0
Accepted
time: 115ms
memory: 58440kb
input:
abbabbbbaabaabaababbabababaabbbabaaabbbabbbaaaaaabaabbbbaaababaaabbbaabbababaabbaaaaabaaabbbbabababbaabbbbaabaaabbaabbabababaaabbaaaaaaaaabaaaababbabaaaabaaabaaabbaaaaabbabbaaaaaababaaabaabbbbabaaaabaaabbbbbbbaabaabbabbabbaabbbaabbbbbbabbaaaabbbbbaababaabbabbaaaaabaaaababaaaabbbabbababbaabbaabbbaabb...
output:
18 45 83 150 283 502 960 1738 3085 5328 9101 15418 25297 39274 56273 72537 84367 91742 95771 97896 98954 99479 99736 99862 99924 99952 99960 99963 99966 99967 99967 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 99950 99949 99948 999...
result:
ok 100000 numbers
Test #16:
score: 0
Accepted
time: 138ms
memory: 58104kb
input:
aabbababbababbababbaaabbbaaaaaaaababaabbabbbababbbbbbabbbaaabbababbbaabaaababbabbabbbaaabababbbabbbabbaaaaababbbaabbaaababaabaabbaaaababaababaaabbbabbbaaaabbbbaaabbbbabaabbababbabaabbbbabbaabbabbbabbabbabbaaaaabbbbabaaabaabaaaaabbbabaaabbaaaabbbaabbbaabbbaabbbbbabaaaabbabbbaaaabbaaaaaaababbbaaaaaabb...
output:
100000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951...
result:
ok 100000 numbers
Test #17:
score: 0
Accepted
time: 147ms
memory: 58244kb
input:
ssrrrrrrsrssssrssrrsssrrsssrrrssrsrrrsrsrsrssrrsrrsrssrrssrsrrssrrrrsssrrssrrsssrsssrsrrrsrrssrrrrrsrrrsrrrrsrsssrrrrrrrrrssssrrsrrrrrsrrrssrsrsrrrrrrrsssssrsssrsrssrsrrssrrrrssrssrsssrrrrrrssrrrrssrrssssrsrrrrrssrsrssrrsrsrrssrsssrrrsrsrsrrrssrrrsssrrrrrssssssssrsrrrrrssrsssrsrrssrrrsrrssrsrrsrrrrr...
output:
75071 87530 93797 96873 98466 99251 99639 99844 99913 99953 99971 99980 99984 99986 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 ...
result:
ok 100000 numbers
Test #18:
score: 0
Accepted
time: 119ms
memory: 54708kb
input:
adadddddcabcddabbcdcadbcabdaadbcaacabdddadcabbdabbdcdddddadbadadddcadbcddddccbdbbdbaccadacdddadcbbadbdacdcaaabaaacbbbaaacacadcdcdaaaddabbbaabdbacacbbbddbccddbaaacbacdddabadacdbaacdbcbdcbbcacbaacbdccccaaaaccdbbbdabbcbadacadabaacabacdcaabcdcbbbcdcdbadcdccbddcdbdbbcabdacaadabddbdbdcabbccbddbbcbbbbbbdda...
output:
54 155 528 1683 5312 15576 39369 73196 92355 98443 99766 99956 99981 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 99950 999...
result:
ok 100000 numbers
Test #19:
score: 0
Accepted
time: 83ms
memory: 54224kb
input:
acadbdddcbabcbaadbdbdccadcbcaaadabbadbddddccabdcbaabdddbdbacbdbcbcbadcdddaaddcdadbbcbcbbbdadddacaabcbbacbbabbdcaddccadcbcbbdaabdcaabadbddcbcababdcbacdbdbcadbbabcccdcacadcdacddcadaabcdaadaacccbdbadbdaaccdbacbbcccbcdcbbdbbdacbabbacacddbadbcbbbdabbdbabdabadadcdbabaabadcadcacaabdcbacadacacbbbdacbdccdccc...
output:
4 16 64 256 1024 4096 16360 52678 85089 96919 99567 99915 99968 99986 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 99950 99949 99...
result:
ok 100000 numbers
Test #20:
score: 0
Accepted
time: 121ms
memory: 56280kb
input:
pplylylppyppplylylllylppyplplppylppyyylplyplplylppplyplypplyyppllyypllpyllyylyyplyypyyyppyylyyyypyyplyyyppppyypypplllypyyyyplylpplpppylplyplllylplyplllplyplpplllypyyplyypplypyyyplyyllypylyypyyyylylyyyypplylplplllpppyllyylylppppplylplllplpyllypyllyppyppypllplpylypllplllpypplyyylppyyypyyppllyyylplyyyl...
output:
41 101 250 659 1617 3922 9587 21466 43180 69505 87421 95439 98419 99456 99809 99926 99974 99982 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99951 99950 99949 ...
result:
ok 100000 numbers