@stringdp100005
RT。
这是啥?
这不是赛时讨论吗?
我没At的号。。。
我们不提供代码好吧
@2345安全卫士 ?但是提供思路也算呀
他洛谷入门赛也搞了个讨论帖,其实就是水贴
只讨论一些不到
求 T2 题面翻译
问题陈述
高桥收集了检票口的使用记录,但不小心删除了一些进出站的记录。他正在尝试恢复这些被删除的记录。
给定一个由字符 i 和 o 组成的字符串 ( S )。我们需要在 ( S ) 的任意位置插入零个或多个字符,使得最终字符串满足以下条件:
- 字符串的长度为偶数。
- 每个奇数位(第 1、3、5、… 位)的字符是
i。 - 每个偶数位(第 2、4、6、… 位)的字符是
o。
求需要插入的最少字符数。可以证明,在问题的约束下,通过插入适当数量的字符,( S ) 一定能满足条件。
约束条件
- ( S ) 是一个长度为 1 到 100 的字符串,仅由字符
i和o组成。
输入
输入通过标准输入给出,格式如下:
S
输出
输出需要插入的最少字符数。
样例输入 1
ioi
样例输出 1
1
解释:
我们可以在第 3 个字符后插入 o,形成 ioio,满足条件。如果不插入字符或插入少于 1 个字符,则无法满足条件。
样例输入 2
iioo
样例输出 2
2
解释:
我们可以在第 1 个字符后插入 o,并在第 3 个字符后插入 i,形成 ioioio,满足条件。如果不插入字符或插入少于 2 个字符,则无法满足条件。
样例输入 3
io
样例输出 3
0
解释:
( S ) 已经满足条件,因此不需要插入任何字符。
完了被 ABC B 卡住了
C 题翻译求一下
我让 ds 帮我翻译一下,结果他一上来就说思路怎么办
你就直接说翻译中文
ds?
Problem Statement
This problem is a simplified version of Problem F.
You are given an integer sequence of length : .
N
A=(A
1
,A
2
,…,A
N
)
When splitting at one position into two non-empty (contiguous) subarrays, find the maximum possible sum of the counts of distinct integers in those subarrays.
A
More formally, find the maximum sum of the following two values for an integer such that : the count of distinct integers in , and the count of distinct integers in .
i
1≤i≤N−1
(A
1
,A
2
,…,A
i
)
(A
i+1
,A
i+2
,…,A
N
)
Constraints
2≤N≤3×10
5
1≤A
i
≤N (
1≤i≤N)
All input values are integers.
Input
The input is given from Standard Input in the following format:
N
A
1
A
2
…
A
N
Output
Print the answer.
Sample Input 1
Copy
5
3 1 4 1 5
Sample Output 1
Copy
5
For , contains distinct integer, and contains distinct integers, for a total of .
i=1
(3)
1
(1,4,1,5)
3
4
For , contains distinct integers, and contains distinct integers, for a total of .
i=2
(3,1)
2
(4,1,5)
3
5
For , contains distinct integers, and contains distinct integers, for a total of .
i=3
(3,1,4)
3
(1,5)
2
5
For , contains distinct integers, and contains distinct integer, for a total of .
i=4
(3,1,4,1)
3
(5)
1
4
Therefore, the maximum sum is for .
5
i=2,3
Sample Input 2
Copy
10
2 5 6 5 2 1 7 9 7 2
Sample Output 2
Copy
8
将题面翻译为中文
不要用深度思考
@stringdp100005 他不是告诉你题目大意了吗?

