QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#388448#8576. Symphony in c++ majorBUET_POTATOES#AC ✓525ms199324kbC++203.6kb2024-04-13 15:45:262024-04-13 15:45:27

Judging History

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

  • [2024-04-13 15:45:27]
  • 评测
  • 测评结果:AC
  • 用时:525ms
  • 内存:199324kb
  • [2024-04-13 15:45:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9, K = 4, N = 5e5 + 5;
void conv(string &s){
    for(auto &x : s){
        if(x == 'd')x = 's';
        else if(x == 'm')x = 't';
        else if(x == 'f')x = 'l';
    }
}
char cng(char c){
    if(c == 's')return 1;
    if(c == 't')return 2;
    if(c == 'l')return 3;
    if(c == 'r')return 4;
    if(c == 'o')return 4+1;
    if(c == 'i')return 4+2;
    if(c == 'a')return 4+3;
    if(c == 'e')return 4+4;
    return 0;
}
namespace ST{
    struct node{
        int val[K + 1][K + 1];
        void init(){
            for(int i = 0; i <= K; ++i){
                for(int j = 0; j <= K; ++j)
                    val[i][j] = -INF;
            }
            val[0][0] = 0;
        }
        void init(char c){
            c = cng(c);
            init();
            if(c == 0)return;
            if(c > K)
                val[c - K][0] = 0;
            else
                val[0][c] = 0;
        }
        node(){
            init();
        }
        node(char c){
            init(c);
        }
    };

    node comb(const node &a, const node &b){
        node ret;
        for(int i = 0; i <= K; ++i){
            for(int j = 0; j <= K; ++j){
                ret.val[i][j] = max(ret.val[i][j], a.val[i][0] + b.val[0][j]);
                ret.val[i][j] = max(ret.val[i][j], a.val[i][j]);
                ret.val[i][j] = max(ret.val[i][j], b.val[i][j]);
                for(int k = 1; k <= K; ++k){
                    ret.val[i][j] = max(ret.val[i][j], a.val[i][k] + b.val[k][j] + 2);
                }
            }
        }
        return ret;
    }
    node st[N << 2];
    void init(int u, int l, int r, const string &s){
        if(l == r){
            st[u].init(s[l]);
            return;
        }
        int mid = l + r >> 1;
        init(u << 1, l, mid, s);
        init(u << 1 | 1, mid + 1, r, s);
        st[u] = comb(st[u << 1], st[u << 1 | 1]);
//        cout << "NODE: " << u << ' ' << l << ' ' << r << endl;
//        for(int i = 0; i <= K; ++i){
//            for(int j = 0; j <= K; ++j)
//                if(st[u].val[i][j] >= 0)cout << i << ' ' << j << ' ' << st[u].val[i][j] << endl;
//        }
    }
    void update(int u, int l, int r, int L, int R, int &k, string &s){
        if(L > r || R < l)return;
        if(l == r){
            st[u].init(s[k++]);
            return;
        }
        int mid = l + r >> 1;
        update(u << 1, l, mid, L, R, k, s);
        update(u << 1 | 1, mid + 1, r, L, R, k, s);
        st[u] = comb(st[u << 1], st[u << 1 | 1]);
    }
    node query(int u, int l, int r, int L, int R){
        if(L > r || R < l)return node();
        if(L <= l && R >= r){
            return st[u];
        }
        int mid = l + r >> 1;
        return comb(query(u << 1, l, mid, L, R), query(u << 1 | 1, mid + 1, r, L, R));
    }
}

void testcase(int cs){
    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    conv(s);
//    cout << sizeof(ST::st) << endl;

    ST::init(1, 0, n - 1, s);
    while(q--){
        char c;
        cin >> c;
        int l, r;
        cin >> l >> r;
        --l, --r;
        if(c == '?'){
            auto ans = ST::query(1, 0, n - 1, l, r);

            cout << r - l + 1 - ans.val[0][0] << "\n";
        }else{
            cin >> s;
            conv(s);
            int k = 0;
            ST::update(1, 0, n - 1, l, r, k, s);
        }
    }
}
/*
4 3
eldo
? 1 2
? 3 4
? 1 4
*/
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int T = 1;
//    cin >> T;
    for(int cs = 1; cs <= T; ++cs){
        testcase(cs);
    }
}


詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 198896kb

input:

8 10
eldorado
? 1 3
? 1 8
# 6 7 it
? 1 8
# 3 3 t
? 1 8
# 1 8 streamer
? 1 8
# 1 8 symphony
? 1 8

output:

3
4
6
6
6
6

result:

ok 6 numbers

Test #2:

score: 0
Accepted
time: 525ms
memory: 199060kb

input:

500000 300000
rfsraltzititrofomloldlaefikdemaddaafmimiioiuaueiaedifacmxamttiiitaaltiiireexeafsaaraedosotlaioootaiosizlifiioadhnxiofsasaflleaiisstaotdlliulilxatrpdaraaraaoiaeoooiumwuumarlifesroloistedoaaieolisaoatamsredorrfiifaaidfeassfioaiasmstomasallsftsrfaiiirteomaeiirefldmlaoaofrxlaeuilioirafotoa...

output:

122151
133262
96922
55212
91547
148150
73505
4097
300798
54037
56741
265921
127608
170707
79236
209443
84732
83219
184042
77169
94062
172946
202750
97798
92449
67243
171524
145772
53856
165837
104913
179165
35068
55893
17287
74510
319355
244761
118810
162815
175172
136079
43107
237581
112894
48610
1...

result:

ok 259513 numbers

Test #3:

score: 0
Accepted
time: 525ms
memory: 199120kb

input:

500000 300000
lotlidiecoletemimaaoaieraollaootuletelsaoasaooouafffomoiiadlaaoialmiaohrteruirstasoiroeoiadeaitimliimlaoiuaeslfosyfisiiimooottmfamirdoliaalmmeimmiodaouafyomaadoioroafeeuerommodsdleiofatiumuaososoeeldemimoeealoifioaooieiolloiqltfeacsmstjliliteddvdtiooeltaaddorieeatdriseotiooaooffmaldtti...

output:

47592
52818
241877
176764
27498
150113
14836
51092
9558
225258
201572
264107
109170
71964
84756
115631
110279
135193
106534
133703
185514
74911
95984
4681
69107
147124
166099
99175
108179
28042
208879
175112
16110
59221
84912
152966
78464
112642
31867
10884
116218
225278
141566
269148
65227
17079
18...

result:

ok 252049 numbers

Test #4:

score: 0
Accepted
time: 510ms
memory: 199248kb

input:

500000 300000
iaeoeoieoeaioaeeoeeooeeiiaiiodaeikaaaaoiiaioieioaiaoiaiaoaafaeoeeeaeiieieaaoaaaooeoaiooiaeaiieooiooeiioeieaoeaieieaeieeiaaaieiooeoaiaeeeooiaaeoeaioaaeeoeaeoaieeeeoiaiaaoeoeaoaeaoaaaieaieaaiaaieoioiiioaiiioooiaaeaoioeiaeiieioeeaiiaoeoaeoaeeaeaooiaeoeeeaeeieeeoaieeioeeeieboeiooieooeaiaai...

output:

155664
273837
139845
16745
209259
88451
160434
169710
329924
215057
243772
4084
207120
80591
7576
371931
44628
68519
237892
115478
13174
263235
81210
25739
190523
95252
265302
287547
272144
65242
68551
417351
256956
67992
134544
58333
37243
335458
229829
258731
259804
111703
163824
818
334444
154340...

result:

ok 259639 numbers

Test #5:

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

input:

500000 300000
mfldmtsdrrrdsmdsmssmddtsfstsfssrlmlrmslorsdtfffmlffflrftddfrttrtelftdtrsrstsrmddseftlmrrtfmlfmmrfdrsmmmtstmfdtmddlmlrldsfdmfstrfifrmtmsmtllrfstmdlttldfllfsmtdrlfrrfffdrmtsforddrtssldmsmslffftssrdlcdmrdrrlmlfrlmrffddmrddrsmdtrltmdrmdltmsssltttdsfdsdtrmmdrtmrstorrffmrftfssmsdmllltrrsflrf...

output:

170615
247842
73399
454147
266865
54003
27279
65510
174723
184626
159949
23029
203052
169738
278963
82792
346300
15256
9231
33253
39362
189106
58738
24996
20987
158695
116975
45334
178698
213764
214955
31665
21659
24427
125495
59410
275000
63449
113696
57040
388491
419930
333741
370485
149329
163203...

result:

ok 259629 numbers

Test #6:

score: 0
Accepted
time: 502ms
memory: 199052kb

input:

500000 300000
czpyuxvyjqnxxgvjkgcucuqhwovqgubbkwvwwnvgcybzzuqbgxvzxqvqbnkzguwcncnyzxxkunchbnubbvbqyxzwbwvgunbbvgppkbzgjwyhqhlhpxqvbwxywhbxnkyxuhvhgckuvkyyqkghhkqgzjpnpuwqwpbxkbjqcycyqvgukpjqcwbbucwwbuzqywqwbzpufxcwqyqpgnqycbhqwxpyhjjpbyuhkugunywzpxwjvxjnpkyqyukycuhbqcbvvgjbcxqpzbhwpxvpgkzvkbcxywqzuc...

output:

252806
247101
133249
312511
114341
73663
40589
19639
408077
146060
263530
16361
112488
256479
43210
14991
39252
125475
173653
413028
52929
298538
119913
49669
170516
178708
96160
69247
191681
442952
185294
368877
36983
97493
303846
160379
368975
160873
237029
166745
270367
43050
63804
130632
215542
...

result:

ok 259840 numbers

Test #7:

score: 0
Accepted
time: 510ms
memory: 199320kb

input:

500000 300000
amsdoiofrraaioimifstsiyiimreorktolsiiiduofiatidlldliaoifmfdaeaesopeuriilaoafooefulietmoadrafoidsmalrlaeiftfmoaddrsflsntmisiaitmiftdearlsifsdmfmfomiriaoilidoaeftieoaietlomftqeioleoaoieemddltiifwaroaosidoomoismslaamrmemesftomiaomofdkaisitariidmsiielatmdaaigdrmomiagomyitoaafodsralotoorefa...

output:

223011
244099
31549
75130
154921
44925
209959
101993
282634
127723
99737
50446
81230
116844
78698
97497
110433
80488
165468
22675
262802
157063
219488
127253
147503
59704
53826
293093
288620
61987
45835
155711
23954
242875
247121
234463
49947
255051
119167
284400
306083
256546
155392
242605
4545
211...

result:

ok 299993 numbers

Test #8:

score: 0
Accepted
time: 509ms
memory: 199076kb

input:

500000 300000
sframtdrsmoosriamldrfmommrilliarsimrratmaersltllitseadkdasoeirreiaaoaiesesaooaoaoddsooioioalftseadifaeotmfddaarassldotaoftldsdrsoitaoaioapilfarsrftivtsrhxlirmlytrdswmiismrfctmaormiooolilafdlforraaisftttellmasiloimrserotianslotmooevfiaoafdaraotisoirodomaerrmftaidaaafatoaaomimfoiaoloeaal...

output:

277612
157353
76818
252490
143568
48930
33261
264593
13910
29655
244387
33023
251154
39474
140414
77265
204309
130191
165359
176962
25055
142229
291636
211276
33126
114028
129436
212380
65758
179755
124526
93940
163685
50456
246610
198842
17334
131827
246450
44098
192458
109098
182124
20026
217819
6...

result:

ok 299999 numbers

Test #9:

score: 0
Accepted
time: 518ms
memory: 199052kb

input:

500000 300000
lidrfmeollmalmateadqdrrsaiiatrtkfatizloiltadstioliodatmolitddhtdomeptmsdutfdmomidddiaoidffuduosamitpahtdtoatufetreusifaaooeoeimmosqotrlwoshifgmipmiidmolelolrtofsaoesosldiqottttiiliaemduaasroaoasoulrmoreoaoisortrtaemsfofdwemdmedomuoiailriefaaaafodattaiioirojmeoddllarafmmoooeoofamrtlamme...

output:

212627
202392
40965
224537
105052
120592
81309
15317
105849
63739
8050
291407
45986
30855
309763
24189
159753
260330
127439
103266
6917
110772
1159
38820
185923
242493
38951
285915
284575
161444
18645
309458
69738
29644
18295
223147
237826
26737
5043
113381
206203
99711
138427
251950
96951
183255
22...

result:

ok 299944 numbers

Test #10:

score: 0
Accepted
time: 475ms
memory: 199124kb

input:

500000 300000
erdfmdisfrzffroemadsaottfeafdlauoermooavdoodeeiiteoaioiiralliemrslzoolmltlrfkaogianmmmrnmiiaofffototidldasddizoetefiliouisiuuidadftilolosorrlmlimtosarrladsimferaedfamlsdfsaifiselaaflroioarsaflddoonraaadimooimeduxsrlolleroofoofmoiryeloodliadarmsalolmdsoafsyylaamiertiddmaoafosidisrlmduia...

output:

15259
113288
220815
156954
15618
135903
73729
226050
39490
83872
82620
86957
112601
237050
146383
24396
75918
144053
43114
22165
75762
63909
272997
147524
217444
246685
263575
38186
141439
20563
84462
149039
42269
293780
209140
101970
82278
180171
82978
70885
15375
778
42561
255474
61255
3176
64952
...

result:

ok 200000 numbers

Test #11:

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

input:

500000 300000
mflloooseefaerivbotdidflomeisustcfdtpiloftsefriielodriorsrfnrmillafifaaalarlsuioieeasimotattoaeailstftoraileolfotpmdiataeolllertatdrieaieogwmeiolaemmaoeffmmsaatjoaiosodmiorrrieatdweoslteitslrjfsuefitfiohloddirmoalobsijlditdsaieasdaimodxaaollrlrtoeeorolaaufemetiaiooatsjrssldlltaoifrorrf...

output:

99460
218290
231216
180988
30522
126828
110853
38646
74849
80785
74248
88213
85124
201026
302285
41464
59126
113774
190335
130258
81671
45547
227442
619
91975
134533
78487
156408
56126
222735
210419
166366
51590
98393
132917
155557
246994
181489
45646
6303
28675
173945
57398
180910
18358
79758
21519...

result:

ok 300000 numbers

Test #12:

score: 0
Accepted
time: 36ms
memory: 198960kb

input:

1111 34567
tstfaoolatsrooauaiaralairoaltzossigaieliaatooifureiildiessasdlsuiodatqtosdxioididesotarlotrilmsrmimoitfoaaurrmlseooiiimamrylldtidifoirsnofoffiaitalwetmriolfpudildafoaottoosfaatiieuaforregimiflmuaaeaffajifiafotiremoalsdnoraafdmmobfitfojztiaaedeaseldamoomdiedmeaiipsaoedadameltdamartfolmitoa...

output:

40
415
149
290
247
101
692
79
327
188
10
338
542
445
28
139
776
107
121
556
265
562
404
97
547
152
237
43
48
298
451
122
207
251
206
121
330
227
239
222
49
182
330
13
69
207
287
75
229
128
334
171
123
448
441
230
370
61
98
90
672
126
105
269
212
492
175
90
84
101
497
163
69
683
74
424
99
720
767
66
...

result:

ok 33778 numbers

Test #13:

score: 0
Accepted
time: 36ms
memory: 198964kb

input:

1 300000
a
? 1 1
? 1 1
# 1 1 f
# 1 1 m
# 1 1 d
# 1 1 i
? 1 1
? 1 1
? 1 1
# 1 1 o
? 1 1
# 1 1 h
# 1 1 k
? 1 1
? 1 1
# 1 1 m
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
# 1 1 t
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
# 1 1 o
# 1 1 o
? 1 1
? 1 1
# 1 1 q
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
? 1 1
# 1 1 e
? 1 1
? 1 1...

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 200000 numbers

Test #14:

score: 0
Accepted
time: 502ms
memory: 199064kb

input:

500000 300000
rdiofommsddakrssmoariffilsiriojaefsarmoiitaiimfreoefimaoahdeoyimmmdstsoaiamltddsdfeoftmsfonifdisimioiidslsfftmumteafruawttdafaeaftstiaofiommrellaaedmlmtmtteadotealafudridlfommofaudoffaaloioaeematsaeooatrsouriloouarsaoolioolfiltltaomatefsftmatdodiroaosllpairoiedutsoiromoadoaailddsediise...

output:

107445
56695
9508
436678
167563
57050
45340
336836
49756
46022
208532
342287
201758
147717
340761
147084
72089
138991
144987
282751
117034
32815
12074
43871
313224
96260
193586
40864
36782
384372
234195
46566
59268
111126
246182
133291
192469
60292
356101
121971
183236
165437
165429
275547
121850
28...

result:

ok 240866 numbers

Test #15:

score: 0
Accepted
time: 492ms
memory: 199100kb

input:

500000 300000
jsedovfebimtdftrrtuedfogoeitedafieleooarrmmlllioroiaalsmomeakmtetaiaolmoeamaassoulorfdiaoasimuataoafeaiirairmssztrfsdealoamsirocdfvdrlirttdaalaioafssodlasoofririmifomsososlatiaaadsilaolflaaadrosnfloiimgeismaaotaefidodtodriweuddqiaaiiiedoosotaosarasmeeddassfoisifjieauofoitieslfallldrdba...

output:

330282
168449
13569
338375
325937
50402
104854
32708
202237
396258
60067
300525
41449
52434
233908
50973
195732
165034
18127
39012
50887
205160
221001
244939
263621
241413
296881
54180
74555
317038
73556
203505
141393
17774
339668
140510
15386
134493
328432
97274
113704
7889
205383
52404
21590
35329...

result:

ok 240899 numbers

Test #16:

score: 0
Accepted
time: 481ms
memory: 199320kb

input:

500000 300000
laladomidofatiresomidofalamilafasomidolamidodosododofalatisosorefamitifalalaremimimimifaresotifaretifalareredomidolamimimirereredododofarerelamifamimisomilatilatidoreladoremitilatidotiremidodomlareltilasotifasomidorerefafadotilamilamirelatitiretifamiremiredomitidotisodomidodofarerelaso...

output:

3389
1454
1121
1818
4888
3291
7497
253
1247
112
1548
6499
2144
2052
2637
4753
2079
4395
4465
861
316
3436
3120
3755
5465
6243
1792
2187
3941
2588
6866
1437
3139
1221
2590
2415
285
931
5442
4917
977
7499
3351
3235
2496
7498
7498
3013
4631
5080
1251
3844
1832
575
2644
138
7498
4181
4462
935
4214
3149
...

result:

ok 279358 numbers

Test #17:

score: 0
Accepted
time: 470ms
memory: 199104kb

input:

500000 300000
fasofasotisomisodofasofalaladotisoreretisoreretirerefaretifafamimimitifarelaresodosofalafarefaretisotidofamimidomimifadoreretititimidolaretisofalarerefasoladotisosolafasodomisotirefamititifareresomilalamifamitilaresodotimilafafafalafalamimitiladolafaredofalamiredosodotilalafamidotilala...

output:

2
1
1
1
1
0
0
0
1
0
1
1
1
1
2
0
1
1
0
1
2
0
2
1
1
2
2
1
1
2
1
0
1
0
1
1
2
1
1
1
2
1
1
0
2
1
2
0
2
1
0
2
1
1
2
1
1
1
2
1
1
1
0
1
1
1
0
0
0
1
1
1
1
1
1
1
0
1
0
1
2
0
1
1
1
2
0
0
2
2
1
0
2
1
1
0
0
2
0
1
1
1
1
1
2
0
1
1
1
1
1
0
1
1
1
1
0
1
0
0
0
1
0
0
0
2
2
1
1
1
1
1
0
0
0
4
2
1
4
4
3
2
0
1
2
2
4
4
4
2
...

result:

ok 279255 numbers

Test #18:

score: 0
Accepted
time: 515ms
memory: 199320kb

input:

500000 300000
toffqmtaalridseeosdsomfissetamrimfariudtaotartiasaresyootrositdeodtoieflodlmtaifoefrvoaeriofmvhlusiaetrdpraudfiaoxltatomoifaaiimltdoaidsutoidafmsdiermdsseaaolmioivoleiuftifafamsomiaereomtmmdaloeomaiaaeoaaileoileoauiamoaaoaiosloadoodvaaaeatmzoimoemooousfzmdfaioadoomafafemtaartotwqrfrooi...

output:

50265
249907
163436
35665
32182
125412
70410
180463
218497
307638
59680
139099
38809
58628
51525
212099
191059
57636
169366
189774
289029
241934
2542
164485
231054
200643
131945
61048
17783
44344
3550
106392
45754
17739
165037
114385
286743
198970
19631
31360
137660
220094
45434
2235
265659
35406
93...

result:

ok 299659 numbers

Test #19:

score: 0
Accepted
time: 511ms
memory: 199140kb

input:

500000 300000
foatiflyrroieesofektoftialirfautttliuiareoimirfiitaipematordofemirmadiriadforirtseoeeaetifrraaieoimdodaofitammoeofsiosleaoolqdrasarxdoiairilflmaomqrorroeatotiomlvduomsiarismoiiirroafcaeummgolmaatdulaeaddeoaaiolidaalrijloiaasafsartomifidzoeriiroifdadiaileofossdtitaaimoaidatopdorfmsesaos...

output:

217970
95973
296783
60569
36651
211367
151055
192059
307891
19485
26927
66091
1215
96877
91016
102186
123972
214828
101478
56922
100045
228321
131041
98247
176614
31216
97675
53159
99698
233116
82387
151956
117010
21225
90315
6806
242501
127916
1359
90652
56798
7520
15474
3004
31416
222305
155349
21...

result:

ok 295560 numbers

Test #20:

score: 0
Accepted
time: 515ms
memory: 199124kb

input:

500000 300000
rtwldlrmjrmhedeesdoaditimoifaedooiteirfiiloaireuaottiiimlaoifdoatimoidiieaefmtaiadartasiiyoielldaaedoaaaoaeeiioifodhumosoeuoarloofuilfataafoiaoamfrodmslefiroadaaerfomorsloiafeianrdouhwosunrelooiddfrdoealailoliuliosomaoraiadafdoolraleslsirdhoeldaiousalfimiioedaeuotraloiotdssfaasolreoios...

output:

243572
13005
111931
12857
184787
73243
47721
201161
290056
49440
84147
80816
35579
84056
249519
188744
9712
156987
98535
112603
38000
295461
14465
102795
126939
123271
70805
184935
5460
64593
140560
323734
37755
49689
48096
145255
133926
87859
311047
203024
125978
131880
207021
65357
246126
124424
1...

result:

ok 297954 numbers

Test #21:

score: 0
Accepted
time: 502ms
memory: 199124kb

input:

500000 300000
mzeoioaoasoetliteiezasfomafdpmasadsaeaimtildiefzfapmdooearoaaaelrtlilsblrmeaoaotyaloamietderoaaasoimtosiriduotedoootelassssyiolefiioiusofsicrtsdadatroarffsiloslfaedildloioiedrujtiiloatoamommdriiimsaroliaolfrtrtiasfsdtidimlfdroeioiosiaudaardrolaoorlmeiesdrosrtitfoilioaaanlaoiidadrlidmio...

output:

120759
277797
27702
271170
55527
322243
323178
226326
289472
7001
169628
193048
144912
98537
38434
89506
33706
10424
175366
167538
340437
235829
380294
64479
150998
129216
85266
387531
336736
213188
205642
370177
339035
63216
304718
34139
153626
82026
210428
111707
67518
41150
164063
56946
267996
17...

result:

ok 240912 numbers

Test #22:

score: 0
Accepted
time: 276ms
memory: 198920kb

input:

9977 300000
muvfaooooosfasttoroeoieedriddomsfofgtratsmermrloaomrorfmrdftmmiristftclidtiifyofautsloeaafileridomeltefteameoifafioitifoiiioqalooidilauooasmmsmiefoerarlfcostraloalotiixlorisofttioomcsofiilrolfaddfiitiadidmmroeiroieaofftfaifowdmladtuaioooitolaodmtmoifdfodrfslraouiofltsooomiomiftsfriiiosia...

output:

910
4559
3662
815
1083
4636
265
2320
243
834
1428
718
464
1961
2607
2817
1886
1493
370
255
2049
1007
1086
1256
86
698
6255
3096
3264
324
62
773
576
1769
3902
128
703
1204
2340
807
4021
2492
649
2532
2778
2446
1071
2090
349
2782
1422
5003
3242
2034
4291
1089
98
64
3853
1043
406
6962
3824
1854
2860
19...

result:

ok 299980 numbers

Extra Test:

score: 0
Extra Test Passed