QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#460849#5037. 回文Crying20 1613ms24340kbC++143.5kb2024-07-02 11:31:232024-07-02 11:31:24

Judging History

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

  • [2024-07-02 11:31:24]
  • 评测
  • 测评结果:20
  • 用时:1613ms
  • 内存:24340kb
  • [2024-07-02 11:31:23]
  • 提交

answer

#include<bits/stdc++.h>
#define lc(x) (x<<1)
#define rc(x) (lc(x)|1)
#define mid ((l+r)>>1)
using namespace std;
typedef long long ll; typedef unsigned long long ull;
const int MAXN = 2e5+10,base = 13331;
char s[MAXN];
int n,q,lst;

ull pw[MAXN];

namespace T1{
    ull h[MAXN],rh[MAXN];
    void solve(){
        while(q--){
            int o; cin>>o;
            if(o==1){
                int x; char c; cin>>x>>c; x ^= lst;
                s[x] = c;
            }else{
                int l,r; cin>>l>>r; l ^= lst,r ^= lst;
                for(int i=1;i<=n;i++)h[i] = h[i-1] * base + (s[i]-'a'+1);
                for(int i=n;i>=1;i--)rh[i] = rh[i+1] * base + (s[i]-'a'+1);
                lst = 0; 
                for(int j=l;j<=r;j++){
                    ull H = h[r] - h[j-1] * pw[r-j+1];
                    ull rH = rh[j] - rh[r+1] * pw[r-j+1];
                    if(H==rH)lst++;
                }
                cout<<lst<<"\n";
            }
        }
    }
}

int o[MAXN],x[MAXN],l[MAXN],r[MAXN]; char c[MAXN];

namespace T3{
    struct Seg{
        ull h[MAXN<<2],rh[MAXN<<2];
        void pu(int x,int l,int r){
            h[x] = h[lc(x)] * pw[r-mid] + h[rc(x)];
            rh[x] = rh[rc(x)] * pw[mid-l+1] + rh[lc(x)];
        }
        void build(int x,int l,int r){
            if(l==r){
                h[x] = rh[x] = s[l] - 'a' + 1;
                return;
            }
            build(lc(x),l,mid); build(rc(x),mid+1,r);
            pu(x,l,r);
        }
        void mdf(int x,int l,int r,int pos,char c){
            if(l==r){
                h[x] = rh[x] = c-'a'+1;
                return;
            }
            (pos<=mid) ? mdf(lc(x),l,mid,pos,c) : mdf(rc(x),mid+1,r,pos,c);
            pu(x,l,r);
        }
        void qA(int x,int l,int r,int ql,int qr,ull& v){
            if(ql>qr)return;
            if(ql<=l && qr>=r){
                v = v*pw[r-l+1]+h[x];
                return;
            }
            if(ql<=mid)qA(lc(x),l,mid,ql,qr,v);
            if(qr>mid)qA(rc(x),mid+1,r,ql,qr,v);
        }
        void qB(int x,int l,int r,int ql,int qr,ull& v){
            if(ql>qr)return;
            if(ql<=l && qr>=r){
                v = v*pw[r-l+1]+rh[x];
                return;
            }
            if(qr>mid)qB(rc(x),mid+1,r,ql,qr,v);    
            if(ql<=mid)qB(lc(x),l,mid,ql,qr,v);
        }
    }seg;

    void solve(){
        seg.build(1,1,n);
        for(int i=1;i<=q;i++){
            if(o[i] == 1){
                x[i] ^= lst;
                seg.mdf(1,1,n,x[i],c[i]);
            }else{
                l[i] ^= lst,r[i] ^= lst;
                lst = 0;
                for(int j=r[i];j>=l[i] && j>=r[i]-60;j--){
                    ull H = 0,rH = 0;
                    seg.qA(1,1,n,j,r[i],H); seg.qB(1,1,n,j,r[i],rH);
                    if(H == rH)lst++;
                }
                cout<<lst<<"\n";
            }
        }
    }
}

int main(){
    //freopen("sauce.in","r",stdin);
    //freopen("sauce.out","w",stdout);

    ios::sync_with_stdio(false); cin.tie(0);
    cin>>(s+1); n = strlen(s+1);  
    pw[0] = 1; for(int i=1;i<=n;i++)pw[i] = pw[i-1]*base;
    cin>>q;
    if(max(n,q) <= 5000){
        T1::solve();
        exit(0);
    }
    int flag = 1;
    for(int i=1;i<=q;i++){
        cin>>o[i];
        if(o[i] == 1){
            flag = 0; 
            cin>>x[i]>>c[i];
        }else cin>>l[i]>>r[i];
    }
    if(!flag){
        T3::solve();
        exit(0);
    }

    return 0;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 34ms
memory: 5632kb

input:

aabbbabbbaaaaaaabbabbbaaaabaaaabbaabbaabbaaababbbabbbbabbbbaaaabbbabbbbbaaabbbabbaaaaabbbbbaaababbabbaaaaabaabbbbaaababaaabbaabbabbbabbbbaaaaabbbbbbbabbbaabbbabbabbbababbabbbbaaaaabbaababbbbaabbaaaaaabaaabbbaaababbbbaabaaaaababababbbbbbaaaabbbbaaababaaabbaabbbbbaaaabbaaaabaaaaaababbababaaaabaaababaa...

output:

2
3
5
3
3
3
2
3
4
2
4
2
4
2
3
3
3
2
2
2
2
2
2
3
4
2
2
3
2
2
4
3
3
2
3
3
4
3
3
4
4
2
3
4
2
2
4
2
4
3
2
2
2
3
3
3
4
4
3
3
2
3
3
2
3
3
4
2
2
4
2
3
2
3
3
2
3
2
2
3
2
2
3
6
2
2
3
7
4
3
2
2
2
2
3
4
4
4
4
2
2
3
2
4
2
2
2
3
3
2
2
2
2
3
3
4
3
2
3
3
2
2
4
5
4
2
2
5
3
3
3
3
2
4
2
3
2
3
3
3
2
4
4
5
2
2
3
5
3
3
...

result:

ok 2509 tokens

Test #2:

score: 0
Accepted
time: 34ms
memory: 5788kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

188
1078
673
914
360
4255
2205
3628
77
3608
230
494
128
848
801
1335
4079
3059
636
2882
3524
45
1174
506
3570
4172
1289
595
3829
1532
179
1274
2574
1098
2817
226
2580
887
989
1829
3656
181
2056
3315
786
117
2519
2742
3787
1080
3138
686
1605
239
1533
2658
2096
753
3400
219
1815
117
1645
52
1671
121
2...

result:

ok 2519 tokens

Test #3:

score: 0
Accepted
time: 63ms
memory: 5712kb

input:

bbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbbbbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbbbbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbbbbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbba...

output:

12
8
12
24
30
18
11
8
32
18
10
32
26
11
11
15
18
6
18
19
13
21
10
13
20
16
10
10
10
9
16
11
32
14
24
20
29
15
10
17
10
8
8
22
31
9
9
18
25
10
14
16
22
24
15
15
11
13
33
7
13
21
7
19
12
12
17
7
23
15
2
10
16
15
9
14
6
18
10
8
18
20
21
5
11
18
3
17
13
17
8
11
17
7
6
7
11
10
9
20
9
28
19
10
14
11
24
8
...

result:

ok 5000 tokens

Test #4:

score: 0
Accepted
time: 67ms
memory: 5744kb

input:

mkmamkmlmkmamkmnmkmamkmlmkmamkmamkmamkmlmkmamkmnmkmamkmlmkmamkmumkmamkmlmkmamkmnmkmamkmlmkmamkmamkmamkmlmkmamkmnmkmamkmlmkmamkmkmkmamkmlmkmamkmnmkmamkmlmkmamkmamkmamkmlmkmamkmnmkmamkmlmkmamkmumkmamkmlmkmamkmnmkmamkmlmkmamkmamkmamkmlmkmamkmnmkmamkmlmkmamkmpmkmamkmlmkmamkmnmkmamkmlmkmamkmamkmamkmlmkma...

output:

5
8
5
6
5
6
7
7
5
8
5
5
6
5
9
6
5
6
7
8
5
5
8
6
4
5
8
5
8
4
6
4
5
6
5
1
5
7
4
5
7
3
5
8
9
6
4
5
5
4
7
7
5
7
8
7
6
5
7
1
5
5
6
6
6
6
7
6
6
4
5
5
6
3
8
7
5
6
6
7
4
4
7
7
6
6
7
8
6
7
7
4
7
6
8
3
5
7
3
6
7
6
4
7
6
4
5
6
6
4
6
7
4
5
5
5
4
4
5
6
3
4
4
5
4
7
5
4
9
6
5
5
3
4
5
8
4
5
5
6
4
6
6
6
4
9
7
4
6
6
...

result:

ok 5000 tokens

Test #5:

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

input:

babababababababababababababababababababababababababababababababbbabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababbbabababababababababababababababababababababababababababababababbbabababababababababababababababababababababa...

output:

58
13
6
23
52
35
39
46
17
43
37
33
31
8
51
12
9
52
57
14
28
17
31
21
59
50
55
50
18
10
54
7
44
11
10
3
12
19
9
8
5
7
22
4
38
15
10
14
26
11
21
18
33
12
3
8
23
34
41
18
7
18
26
7
12
29
34
6
4
15
16
20
15
8
50
23
7
51
18
4
11
7
20
14
33
19
12
9
10
6
8
21
28
22
21
18
12
18
4
15
17
13
8
16
7
14
10
4
5
3...

result:

ok 2443 tokens

Test #6:

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

input:

aaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaaaaaaaaaabaabaaaaaaaa...

output:

43
25
18
13
12
27
16
18
22
24
13
20
34
18
5
27
26
27
8
10
6
9
9
14
22
15
34
25
19
24
19
18
13
7
21
14
2
33
7
46
16
18
19
12
25
8
7
14
22
2
2
12
19
3
20
15
18
10
8
8
8
12
5
12
18
22
7
15
16
36
21
11
11
14
8
13
12
2
5
40
14
15
2
5
11
4
12
16
11
9
9
6
6
18
16
11
15
18
13
15
8
24
19
9
5
15
18
8
13
5
31
...

result:

ok 2498 tokens

Test #7:

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

input:

baabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabcaaaaaaaacbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabba...

output:

67
7
4
13
81
3
8
92
28
86
94
92
71
23
73
26
24
13
71
88
98
42
70
45
82
63
5
80
57
49
48
77
88
5
98
96
65
52
11
24
52
51
76
90
9
10
58
43
36
48
82
73
10
14
90
54
74
12
32
36
71
46
8
46
20
38
22
68
54
73
66
32
95
63
52
7
40
97
27
13
42
59
41
14
9
44
53
52
92
30
36
27
86
90
59
95
12
36
42
16
24
58
23
5...

result:

ok 5000 tokens

Test #8:

score: 0
Accepted
time: 28ms
memory: 5736kb

input:

caaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaaccabccbaccaaccaaccaaccaaccaaccaac...

output:

10
10
11
11
11
10
10
10
8
10
11
11
9
9
10
10
10
11
10
11
9
10
10
11
11
11
10
11
11
11
11
11
11
11
11
10
10
10
10
11
11
11
10
11
10
10
10
11
10
10
10
10
10
11
11
11
11
10
11
11
11
10
11
11
11
10
10
7
11
11
10
11
10
10
11
10
11
10
10
7
11
11
10
10
11
11
10
10
2
11
11
11
5
11
11
11
11
11
10
10
10
11
11...

result:

ok 1667 tokens

Test #9:

score: 0
Accepted
time: 28ms
memory: 5804kb

input:

cabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbbaccbaccabccabbbbbb...

output:

38
38
38
37
38
38
38
9
37
38
8
38
37
38
38
38
38
38
38
37
27
38
38
38
38
38
38
30
38
38
38
38
38
38
38
38
24
38
38
38
38
38
38
38
38
38
37
38
5
38
32
25
38
38
38
38
38
38
38
38
38
38
38
37
38
37
38
31
38
38
38
38
38
38
12
38
38
37
38
38
38
38
37
38
38
38
23
38
38
38
38
24
38
38
38
38
38
35
38
38
38
...

result:

ok 1667 tokens

Test #10:

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

input:

baaabbbaaabbbbaaababbababbabbbbaaaababaababbbbababababbbaabbbaababaaaababbbaaabaaababbababaaabbabbbaaabbabbbabaabaaaababbbbabbbbbaabbabbaaaabaaabababbbaababbbaaaaaababbabaaabaaaabbbabbbaababbbbbbbbaabbbaabbabaabababbaabaabaabbbbbaaababbbbabbbababababaabbababaabbabbbbbbaaaaaaabaabbabbabaabbbbbaaaaaba...

output:

3
3
2
3

result:

ok 4 tokens

Test #11:

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

input:

abbaaabaabbbaabbabbbbbbaabbbbabbaabababaabbabbabaaabbabbbaaaabbabbaabbbabbbabbababaaaabbabbaabababbbaaababaababbabbaaabbbaabaaaaaabbbabbababaabbbbbabbbaaaaaaabbaaaabaaababbababaabaaabbbaaabbaabbabbabbbababbabbbbbbbbaabbabbbabbbbbbbababaabbbaabaabaabaaabababbaabbbbaaabbbbabbaabbbabbbababaababbabbabba...

output:

3
4
2
2
4
2
2
4
3
5
2
2
3
4
3
2
3
4
6
2
2
2
2
2
5
3
4
3
3
2
2
2
2
5
2
3
2
3
2
3
2
3
2
4
2
2
3
2
2
3
5
2
2
7
3
2
3
2
3
3
2
2
3
4
3
2
4
2
2
2
3
3
3
3
3
2
3
3
3
5
2
4
2
3
3
3
3
3
3
2
4
4
3
4
2
2
3
3
6
2
5
4
2
2
4
2
5
3
3
2
5
4
3
3
3
3
4
3
2
3
2
4
2
3
6
3
3
2
3
3
2
3
3
5
2
3
4
3
5
3
3
3
3
4
2
3
3
2
3
2
...

result:

ok 4997 tokens

Test #12:

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

input:

lxxhwqorbxrdzedxlvymggyicczuafgyovixrzmptqfmjyjfpamcsehmfazbvfwdgeftgbtyurnnykwjhzfqqsyiyzkpwlmspjsxdkjtpgzbrvwwcjqejmuillhgtbhwtwmvhacfphrcgwoaihjzkuccmwuidivmpjcezbjywhbqtdgrhlrskcwmecflzpjbuutlocivcfvbcdvlnfchtvvcpoubnjwfwvzvpyvhkvxdmleyvucrondntpaonjybzarkgjnkuuvipkqgvwzzzopwyfnmodnmdziueescfttr...

output:

1
1
1
1
1
2
1
1
1
1
1
1
2
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
2
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
2
2
1
2
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 2493 tokens

Test #13:

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

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

849
1135
1444
1346
1445
536
3077
2631
1447
672
2214
2149
2090
4054
846
559
22
92
4224
161
2280
572
2347
2599
778
4093
750
3647
2142
642
474
1395
776
645
46
4141
2272
771
1564
207
4284
2896
3097
2829
306
1383
394
1776
1284
3933
102
510
1101
3639
1336
1292
2803
1159
601
1464
2585
673
281
1340
272
3310...

result:

ok 2478 tokens

Test #14:

score: 0
Accepted
time: 77ms
memory: 5796kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
5000
...

result:

ok 4999 tokens

Subtask #2:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 26ms
memory: 12940kb

input:

aabababbabbbbbbabbababaaaabababbabbbbbbabbababaaaabababbabbbbbbabbababaaaabababbabbbbbbabbababaabbbaaabbaabbbbaabbaaabbbaabababbabbbbbbabbababaaaabababbabbbbbbabbababaaaabababbabbbbbbabbababaaaabababbabbbbbbabbababaabbaaabaaaaaabaaabbaabababbabbbbbbabbababaaaabababbabbbbbbabbababaaaabababbabbbbbbabb...

output:


result:

wrong answer Unexpected EOF in the participants output

Subtask #3:

score: 10
Accepted

Test #21:

score: 10
Accepted
time: 47ms
memory: 20312kb

input:

abbaaaabbabaaaaaabaabbaabbababbaaabbabbbabaabaabaaaaabaabbbbabbabbabbbababbbababababbbbabaabbaaababbbbbababbbbaabbbaaabaababababaabbbbbbaababaabbaaabaabbaaababbabbabbbbaaaaabaaabbbabbbbbbabbbabbabaabbbbbbbaaaabbaaaababbbaaaaaaababaabbbbaaabaaabbaabbbbbbababbaabbaaabbabbbbbabaababbaabaaaabbbbabababba...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
8
8
8
8
...

result:

ok 198 tokens

Test #22:

score: 0
Accepted
time: 1456ms
memory: 24276kb

input:

abbaababbabababbbbabababbbaaaabababbbbaabaabbbbabbbabbaabababbbabaaabbabbaabbbbbbaaababaababbbaabbbbaabbbaaaaaabaabbaabbaaaabaaabbaabbbaabbbababbbabbaaababaabaaabaabbabababaaaabaabbbbaaabbbbbbabbbbababbaabaabbbbabbaaabbaabaabbaabaabaaaaaabbaaabbbbbabbbbbaaabbabbabbaababaaabbabbaaaaaabbababbbaabbaabb...

output:

2
6
2
2
3
2
2
3
4
3
4
3
2
8
2
3
2
4
4
4
3
2
4
3
4
4
2
3
3
3
3
2
13
4
2
5
5
3
3
2
2
4
2
3
3
4
3
2
2
3
3
2
2
6
3
4
3
3
2
2
2
3
2
3
3
4
3
2
2
3
2
4
3
5
5
3
3
2
2
3
3
2
3
4
5
2
2
3
2
5
3
2
5
3
5
3
3
2
5
3
3
4
4
2
2
3
4
2
2
2
2
3
3
2
2
5
3
2
3
3
4
2
6
3
2
13
2
2
2
3
2
2
4
2
3
2
3
3
4
4
5
4
3
2
12
2
2
3
2...

result:

ok 199806 tokens

Test #23:

score: 0
Accepted
time: 895ms
memory: 22364kb

input:

bbabbbaaaaabbbbabaabbaabbaabbbaabbabaaabaaabbbbabbbabaabbbbbbbabbbaabbbabbabaabababaaababaabaaabaabbbabbbbbabbbbbbbbbbbaaabaaaaabaaaaababbaaaaabbabaaabbabaabababaabbbabbbbaabaabbaaabaabbaabbbbbababbabaabbbbaaabaaaababbabbaaaabbabaabbabbbbbababbabbbaaabababbababbbaabbbbabbbbaaabbabbaaabbaaababbabaaab...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

ok 199800 tokens

Test #24:

score: 0
Accepted
time: 1613ms
memory: 24216kb

input:

bababaaaaabbabbbbababbbbbbababbbbbaaaabbabbbbabaaababbababbaaabbabababbabbaabbabbbaababbbabaaaabbabbababbabbbabababbabbaabbbaabaabaabbbaabbabbabbababbabbaaabbbabababababaababaababbbaaababbbaababbbbabaaabaaabbababaaabbbbbaabababbbbbaabaaaaababaaabaababbaaababbbbabbbbbaababbababbbbabaabbabbbabaaaabbbb...

output:

3
2
2
2
4
2
2
4
2
3
2
4
4
2
3
2
2
2
3
3
3
3
3
2
4
5
4
2
3
2
3
2
3
2
2
3
3
3
3
3
3
3
2
3
2
3
3
3
2
4
3
3
2
2
3
5
2
3
3
3
3
2
4
4
3
2
2
2
7
3
3
2
4
2
5
5
4
3
2
4
2
2
2
2
3
4
2
6
5
3
2
4
3
3
3
3
5
3
4
2
2
2
2
2
3
2
3
3
4
5
3
2
2
2
2
3
5
2
4
2
3
2
5
3
2
3
2
3
3
2
3
2
2
2
3
2
2
2
3
3
4
2
4
4
3
5
5
3
4
2
...

result:

ok 199800 tokens

Test #25:

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

input:

aaabaaababbbabaaaababbbaabaaaabababaaabbaaaabbbbbabbaabbbbbbabbabbbaabaaaabbbabbbbbbbbaabbaaaaaabbabbaabbaaaaaabaaaabbbbbbaabbaabaaabbbaaaaaaabbbabaaaaabbbabbbaaabaaaabababaaaaaaabaaabaababbbbabbbabbbaabbbbaaaabbbbaababaababaaabbaabbbaabbabaabaaabbabaaababbaaaaabaaaabbbbabaaabbbaaaaabababbabaabbabab...

output:

3
2
3
3
2
2
3
3
2
4
2
4
3
4
3
2
3
2
2
4
2
2
2
3
2
3
2
2
2
3
4
4
3
2
2
6
2
4
3
4
4
3
2
2
5
2
2
3
4
3
3
3
7
4
3
4
3
2
4
4
4
4
3
3
3
2
2
2
3
3
2
3
6
2
2
3
3
2
2
2
2
2
2
3
2
3
2
5
4
3
3
3
2
3
3
4
2
2
4
4
2
3
3
2
6
3
2
3
4
3
2
3
3
2
3
2
2
3
4
3
4
3
2
3
3
2
2
2
3
5
2
3
3
3
2
2
2
4
2
2
4
3
2
2
3
3
3
2
2
2
...

result:

ok 211 tokens

Test #26:

score: 0
Accepted
time: 1467ms
memory: 20208kb

input:

ababaaabaabbbaabbaabaaaabaaabaabbababbababaabbaabbbbaaabaabaabaaaabaababbbaabbabbaaabaabbaabababbbababbabaaaabbabbbbbbaabababbbbababbaaabaaababbbbaabbaaaabbbbaaabbbabbabbaabbbbababbaabaabbabbababbabbaababbbaaaaababbaabbbbabaabbbabbbbbaaababbaaabbbbaaababbaababaaabaaabaababbabaabaabbbbaaaaabbababaaab...

output:

3
2
2
3
3
5
3
4
3
3
2
3
4
2
3
4
3
3
3
2
3
4
2
4
2
3
2
2
2
3
3
4
3
2
3
3
4
4
3
2
3
3
3
2
3
2
3
3
5
2
2
2
4
3
3
2
2
2
5
4
3
7
2
3
2
5
3
2
3
3
3
3
3
2
2
4
3
3
2
2
2
2
3
2
7
3
2
3
3
2
2
3
2
2
3
3
4
3
4
3
4
3
2
2
3
3
3
4
3
5
5
2
2
3
4
5
3
3
5
3
2
2
3
2
8
3
5
5
3
3
2
3
4
2
2
4
2
2
2
2
2
4
4
3
4
3
3
2
3
2
...

result:

ok 199782 tokens

Subtask #4:

score: 0
Time Limit Exceeded

Test #27:

score: 10
Accepted
time: 358ms
memory: 24220kb

input:

babbaaabbbbbbbabbbababaabbbbbababababbaabaabbbbbbabbbbbbbbbbababbbbabbaabbbaabaabbabbbaabbabbbabbababaababbbabbbbaabbabbabbaaaabbbaaabbbbaabbaaaaaaabbbabbbaaabaababaaabaaaabaaaababaaaaababaaaabaabbaaaabbbabbaabaabbbabbbbbaaabaababbbaaaaabbbbaaabbbbaabbabbbbabbbabbaaaaabaabaaaabbbabbbbbaabbbbabbbbaab...

output:

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

result:

ok 100490 tokens

Test #28:

score: -10
Time Limit Exceeded

input:

lqdvhpozemuhtibmunxftkdjjdktfxnumbithumezophvdqllqdvhpozemuhtibmunxftkdjjdktfxnumbithumezophvdqlfibyjjybiflqdvhpozemuhtibmunxftkdjjdktfxnumbithumezophvdqllqdvhpozemuhtibmunxftkdjjdktfxnumbithumezophvdqlewwelqdvhpozemuhtibmunxftkdjjdktfxnumbithumezophvdqllqdvhpozemuhtibmunxftkdjjdktfxnumbithumezophvd...

output:


result:


Subtask #5:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #35:

score: 0
Wrong Answer
time: 10ms
memory: 22364kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

61
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

wrong answer 1st words differ - expected: '199105', found: '61'

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%