UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#48210#10. 小x的城池mogician10025591ms171408kbC++9.0kb2019-03-14 19:35:132019-03-14 19:35:16

answer


详细

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3264kb

input:

7 5
0 A
32 B
10 B
27 B
25 A
30 B
10 A
UPDATE 1 1
UPDATE 6 22
UPDATE 1 50
UPDATE 6 62
UPDATE 5 67

output:

2
1
0
2
1

result:

ok 5 number(s): "2 1 0 2 1"

Test #2:

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

input:

10 20
38 A
0 B
2 A
20 A
2 B
31 A
0 B
68 A
53 A
74 B
UPDATE 7 63
UPDATE 7 0
UPDATE 7 66
UPDATE 7 7
UP...

output:

6
6
6
6
6
4
5
4
6
4
1
4
1
6
6
4
6
6
6
4

result:

ok 20 numbers

Test #3:

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

input:

100 100
38 A
0 B
2 A
20 A
2 B
31 A
0 B
68 A
53 A
74 B
37 A
62 A
59 A
70 A
71 A
4 A
44 A
2 B
63 A
22 ...

output:

67
67
67
67
67
67
67
67
67
63
63
66
66
66
70
70
70
70
65
64
65
54
45
69
70
69
69
46
67
67
67
67
67
6...

result:

ok 100 numbers

Test #4:

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

input:

1000 500
38 A
49 A
67 A
60 A
62 A
74 A
31 A
6 A
18 A
23 A
45 A
25 A
37 A
62 A
59 A
70 A
71 A
4 A
44 ...

output:

541
629
540
750
742
701
701
737
737
745
737
701
730
701
764
764
723
463
556
635
627
755
755
452
530
...

result:

ok 500 numbers

Test #5:

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

input:

10 30
38 A
49 A
72 B
2 B
74 B
65 A
74 B
0 B
54 A
2 B
REVERSE 7 9
REVERSE 1 5
REVERSE 4 7
REVERSE 6 7...

output:

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

result:

ok 30 numbers

Test #6:

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

input:

200 400
38 A
49 A
67 A
60 A
62 A
74 A
31 A
6 A
18 A
23 A
45 A
25 A
37 A
62 A
59 A
70 A
71 A
4 A
44 A...

output:

143
100
52
74
68
74
57
33
42
42
39
27
26
45
45
45
22
26
46
43
47
39
32
22
29
22
23
19
26
26
28
28
19...

result:

ok 400 numbers

Test #7:

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

input:

1000 1000
30 A
59 A
17 A
15 A
65 A
3 A
9 A
60 A
31 A
56 A
16 A
63 A
47 A
47 A
45 A
43 A
28 A
11 A
42...

output:

178
312
311
85
85
242
131
194
128
128
134
134
97
90
90
104
64
104
104
136
113
44
117
109
27
27
27
27...

result:

ok 1000 numbers

Test #8:

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

input:

400 400
4 A
16 A
72 A
53 A
73 B
34 A
72 A
31 A
37 A
9 A
7 A
30 A
53 A
15 A
57 A
21 A
69 A
74 A
38 A
...

output:

186
68
129
129
72
67
75
144
97
11
4
4
12
13
17
36
32
13
17
38
15
15
39
39
15
9
17
31
16
16
31
31
24
...

result:

ok 400 numbers

Test #9:

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

input:

7 4
0 A
32 B
10 B
27 B
25 A
30 B
10 A
REVERSE 2 5
UPDATE 5 30
REVERSE 5 7
UPDATE 2 0

output:

2
2
3
1

result:

ok 4 number(s): "2 2 3 1"

Test #10:

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

input:

1000 1000
65 B
28 A
3 B
48 B
19 B
35 B
19 B
12 B
1 B
29 B
18 A
5 B
38 B
16 B
23 B
19 B
22 B
2 B
31 A...

output:

133
133
121
121
121
115
115
119
115
115
113
104
106
107
109
108
103
103
103
94
94
90
90
90
90
90
90
...

result:

ok 1000 numbers

Test #11:

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

input:

1000 1000
74 A
53 A
32 A
2 B
52 A
19 B
10 B
13 B
15 B
30 B
35 B
15 B
10 B
65 A
64 A
33 A
24 B
32 B
1...

output:

331
319
296
295
286
269
275
252
252
266
265
242
243
232
232
232
227
228
211
222
208
208
209
220
207
...

result:

ok 1000 numbers

Test #12:

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

input:

1000 1000
43 A
42 A
44 A
56 A
63 A
43 B
22 A
65 A
31 B
8 B
45 A
52 A
32 B
2 B
18 A
6 B
14 A
39 A
0 B...

output:

336
328
328
276
281
280
273
273
273
259
258
258
258
270
271
260
259
254
254
254
254
256
256
259
247
...

result:

ok 1000 numbers

Test #13:

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

input:

1000 1000
11 B
13 B
23 B
21 B
59 A
29 B
67 A
22 A
1 A
68 A
7 A
65 A
72 A
4 A
42 A
71 A
30 B
41 B
0 B...

output:

449
449
423
372
340
313
299
300
283
283
305
304
265
242
237
240
234
235
230
222
220
220
219
214
218
...

result:

ok 1000 numbers

Test #14:

score: 0
Accepted
time: 5ms
memory: 3844kb

input:

1000 1000
36 A
12 A
72 A
68 A
25 A
18 A
27 A
52 A
20 A
66 A
15 A
14 A
13 A
29 B
38 A
30 B
24 A
17 A
...

output:

516
515
514
474
474
474
475
438
411
412
424
404
368
362
377
400
365
352
354
354
354
345
345
344
311
...

result:

ok 1000 numbers

Test #15:

score: 0
Accepted
time: 5ms
memory: 3852kb

input:

1000 1000
10 A
50 A
14 A
72 A
6 A
26 A
24 A
29 A
65 A
65 A
67 A
17 B
0 A
16 A
60 A
64 A
66 A
29 A
27...

output:

499
422
446
430
350
408
314
287
278
267
268
283
276
276
275
251
251
257
198
192
196
220
176
200
200
...

result:

ok 1000 numbers

Subtask #2:

score: 35
Accepted

Test #16:

score: 35
Accepted
time: 83ms
memory: 21496kb

input:

10000 10000
38 A
49 A
67 A
60 A
62 A
74 A
31 A
6 A
18 A
23 A
45 A
25 A
37 A
62 A
59 A
70 A
71 A
4 A
...

output:

8481
6987
5555
4171
3408
2277
3351
3046
2441
1321
1328
2040
1303
932
1371
1087
1094
1548
1548
925
15...

result:

ok 10000 numbers

Test #17:

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

input:

30000 30000
38 A
49 A
67 A
60 A
62 A
74 A
31 A
6 A
18 A
23 A
45 A
25 A
37 A
62 A
59 A
70 A
71 A
4 A
...

output:

26871
24611
15656
11163
15669
13968
12964
11293
11339
10586
10586
9096
10933
9996
8370
6666
4011
399...

result:

ok 30000 numbers

Test #18:

score: 0
Accepted
time: 934ms
memory: 165648kb

input:

100000 100000
38 A
49 A
67 A
60 A
62 A
74 A
31 A
6 A
18 A
23 A
45 A
25 A
37 A
62 A
59 A
70 A
71 A
4 ...

output:

95217
86813
82800
79403
85571
80346
77269
78115
72592
77667
74516
73511
70808
72044
72684
72684
7271...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 975ms
memory: 165648kb

input:

100000 100000
69 A
24 A
24 A
31 A
25 A
57 A
28 A
43 A
15 A
65 A
45 A
9 A
58 A
20 A
61 A
38 A
68 A
39...

output:

85409
91145
91145
87566
77777
78281
78281
75231
76104
75973
73410
73519
73457
70945
70780
68025
6795...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 927ms
memory: 165656kb

input:

100000 100000
6 A
32 A
30 A
46 A
36 A
41 A
61 A
61 A
32 A
72 A
74 A
60 A
39 A
3 A
4 A
15 A
12 A
41 A...

output:

80582
84214
78557
76782
76653
69364
71611
70822
67509
67753
62043
68747
67218
60747
60747
61124
6112...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 1035ms
memory: 171396kb

input:

100000 100000
13 B
15 B
17 B
11 B
56 B
5 B
2 B
3 B
17 B
19 B
46 B
9 B
17 B
19 B
12 B
2 B
18 A
5 B
54...

output:

19329
19232
19032
18844
18846
18862
18815
18763
18716
18617
18489
18371
18474
18357
18345
18120
1809...

result:

ok 100000 numbers

Test #22:

score: 0
Accepted
time: 1101ms
memory: 171408kb

input:

100000 100000
2 B
48 A
21 B
70 A
8 B
1 A
8 B
38 B
56 A
1 B
62 B
60 A
11 B
16 A
11 A
34 A
21 B
3 B
58...

output:

47624
47567
46669
46381
46169
45576
45192
45172
45052
45025
44838
44492
44292
44030
44288
44485
4431...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 1178ms
memory: 171400kb

input:

100000 100000
73 A
19 A
54 A
5 A
37 A
27 A
7 B
59 A
51 A
50 A
21 A
40 A
72 A
15 B
17 A
17 B
2 A
31 A...

output:

76490
75158
74845
72844
70625
70188
69672
69295
69061
69134
67984
68413
68178
67145
66918
67220
6599...

result:

ok 100000 numbers

Test #24:

score: 0
Accepted
time: 1238ms
memory: 171400kb

input:

100000 100000
3 A
17 A
29 A
12 B
25 A
60 A
13 B
48 A
25 A
55 A
5 A
37 A
10 A
40 A
5 A
6 B
18 A
22 A
...

output:

82673
82309
80275
79043
77716
77349
76413
76723
76438
74445
73826
73039
72680
71605
70903
70157
7159...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 1233ms
memory: 171400kb

input:

100000 100000
61 A
48 A
48 A
30 A
0 A
61 A
7 A
48 A
47 A
45 A
11 A
9 A
32 A
52 A
57 A
55 A
55 A
4 A
...

output:

80546
77664
72526
70703
68660
67127
68968
68215
68153
66370
65677
63565
63647
63128
62387
63172
6117...

result:

ok 100000 numbers

Subtask #3:

score: 35
Accepted

Test #26:

score: 35
Accepted
time: 116ms
memory: 41576kb

input:

30000 30000
38 A
49 A
67 A
60 A
62 A
74 A
31 A
6 A
18 A
23 A
45 A
25 A
37 A
62 A
59 A
70 A
71 A
4 A
...

output:

23611
23608
23608
23608
23343
23343
23343
23343
23343
23343
23608
23608
23608
23608
23608
23608
2172...

result:

ok 30000 numbers

Test #27:

score: 0
Accepted
time: 780ms
memory: 162496kb

input:

100000 100000
3 B
15 B
39 B
8 B
5 B
13 B
2 B
4 B
20 B
5 B
21 B
21 B
10 B
22 B
18 B
2 B
29 B
11 B
14 ...

output:

19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
19551
1955...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 749ms
memory: 162500kb

input:

100000 100000
11 B
58 A
39 B
14 B
67 A
28 A
28 A
47 A
8 B
48 A
10 B
21 B
5 B
27 A
27 A
8 B
53 A
18 A...

output:

48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
48587
4858...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 717ms
memory: 162500kb

input:

100000 100000
2 A
68 A
58 A
25 B
10 A
10 B
67 A
46 A
16 B
70 A
59 A
21 A
69 A
38 A
54 A
6 A
13 A
11 ...

output:

78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
78093
7809...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 712ms
memory: 162496kb

input:

100000 100000
28 A
11 A
38 A
53 A
9 A
29 B
74 A
32 A
18 A
16 A
8 A
15 A
39 B
58 A
30 A
67 A
42 A
44 ...

output:

87028
87028
87028
87028
87028
87028
87027
87027
87027
87027
87027
87027
87027
87027
87027
87027
8702...

result:

ok 100000 numbers

Test #31:

score: 0
Accepted
time: 658ms
memory: 162500kb

input:

100000 100000
19 A
66 A
67 A
65 A
0 A
61 A
61 A
71 A
58 A
58 A
65 A
29 A
9 B
49 A
2 A
53 A
51 A
53 A...

output:

88564
88564
88564
88564
88564
88564
88564
88564
88563
88563
88562
88563
88564
88564
88564
88564
8856...

result:

ok 100000 numbers

Subtask #4:

score: 20
Accepted

Test #32:

score: 20
Accepted
time: 13ms
memory: 5508kb

input:

2000 2000
74 B
40 A
14 A
25 A
45 A
26 A
28 A
14 A
45 A
68 A
5 A
4 A
73 A
35 A
41 A
32 A
26 A
66 A
10...

output:

1754
1189
1189
1148
1050
1209
1124
675
673
663
739
807
727
598
700
496
611
295
297
297
258
506
398
4...

result:

ok 2000 numbers

Test #33:

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

input:

100000 100000
70 A
32 A
10 A
33 A
10 A
54 A
13 A
42 A
24 A
19 A
42 A
38 A
8 A
68 A
19 A
12 A
7 A
15 ...

output:

95382
87258
82798
80660
79874
78045
73746
75252
75252
75252
75252
73245
73245
73239
73239
73239
7338...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 912ms
memory: 165648kb

input:

100000 100000
74 A
23 A
44 A
26 A
42 A
8 A
13 A
75 A
31 A
54 A
49 A
20 A
58 A
75 A
74 A
8 A
52 A
41 ...

output:

82702
79392
81020
75671
73145
71920
66862
71550
67411
66472
68638
65862
68028
65720
65287
67449
6744...

result:

ok 100000 numbers

Test #35:

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

input:

100000 100000
4 A
24 A
72 A
26 A
6 A
73 A
58 A
72 A
60 A
57 A
15 A
2 A
68 A
16 A
14 A
4 A
60 A
34 A
...

output:

91277
82779
74427
74427
69223
74406
74406
72349
68690
68690
67420
67166
67420
67420
67197
67369
6740...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 657ms
memory: 164964kb

input:

100000 100000
14 A
67 A
56 A
24 A
51 A
15 A
25 A
16 A
42 A
28 A
9 A
54 A
69 A
53 A
25 A
14 A
4 A
7 A...

output:

98512
98512
98512
98512
98512
81015
93431
93431
93431
93431
93431
93431
86622
86622
86611
93180
9318...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 883ms
memory: 165648kb

input:

100000 100000
19 A
30 A
34 A
22 A
29 A
73 A
72 A
28 A
49 A
2 A
67 A
20 A
46 A
12 A
66 A
42 A
13 A
64...

output:

96175
94989
94989
86100
86100
88874
88874
85575
85575
84785
84785
76916
76916
72618
72618
71423
7142...

result:

ok 100000 numbers

Test #38:

score: 0
Accepted
time: 880ms
memory: 165648kb

input:

100000 100000
59 A
70 A
54 A
3 A
42 A
68 A
73 A
74 A
61 A
50 A
18 A
55 A
46 A
70 A
8 A
18 A
25 A
12 ...

output:

97319
92424
92424
86004
86004
80879
80879
80108
80108
84558
84558
77302
77302
78455
78455
82399
8239...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 1208ms
memory: 170828kb

input:

100000 100000
18 B
13 A
31 A
64 A
5 B
6 B
4 B
14 B
13 B
6 B
27 B
72 A
7 B
53 A
14 B
11 B
17 B
16 B
1...

output:

19785
19785
19785
19785
19720
19720
19720
19610
19610
19610
19610
19610
19610
19460
19460
19460
1930...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 1224ms
memory: 171216kb

input:

100000 100000
1 B
22 B
24 A
1 A
12 A
19 B
9 A
74 A
39 A
51 B
49 A
6 B
26 B
16 B
14 B
33 A
9 B
25 B
1...

output:

38833
38833
38754
38507
37949
38146
37783
37783
37783
37304
37304
37315
37078
36800
36872
36872
3681...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 1299ms
memory: 170820kb

input:

100000 100000
64 A
39 A
41 A
8 B
41 B
57 A
28 B
6 B
34 A
11 B
15 B
36 A
13 B
5 B
64 A
75 A
29 B
68 A...

output:

48478
47254
47095
46712
46712
46712
46744
46336
46336
46057
46057
46057
46057
46057
45524
45524
4552...

result:

ok 100000 numbers

Test #42:

score: 0
Accepted
time: 1225ms
memory: 171216kb

input:

100000 100000
53 A
8 A
40 A
5 A
24 A
10 A
51 A
43 A
9 A
39 A
17 B
17 B
69 A
25 B
34 A
70 A
30 A
11 B...

output:

56490
55677
55202
55202
55202
54497
54497
54497
53984
53313
53870
53728
53108
53108
53011
52331
5233...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 1331ms
memory: 170824kb

input:

100000 100000
11 A
30 A
60 A
3 B
17 A
50 A
61 A
32 A
12 A
28 A
23 A
13 A
19 A
64 A
14 A
61 A
54 A
24...

output:

76053
76053
75238
75238
75238
73675
73738
73738
73738
72921
70850
70850
70850
70850
70850
70849
7084...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 1332ms
memory: 171220kb

input:

100000 100000
75 A
63 A
71 A
36 A
62 A
42 A
10 A
37 A
55 A
60 A
74 A
11 A
13 A
59 A
43 A
16 A
13 A
4...

output:

81961
83497
83497
83497
83497
82395
81180
77063
75208
74163
72510
71833
71594
70438
69644
70336
7033...

result:

ok 100000 numbers

Extra Test:

score: 0
Extra Test Passed