对我来说比较困难的一题了,尝试着自己写了一下,调不出来遂放弃.
Codeforces Round #775 (Div. 1, based on Moscow Open Olympiad in Informatics)
https://codeforces.com/contest/1648/problem/C
C.Tyler and Strings
题意:给你字符串
s
,
t
s,t
s,t,你可以对
s
s
s任意排序,问你有多少种方案使得
s
s
s重排后字典序会比
t
t
t小.
思路:枚举每次在哪里断掉.比如说在
i
i
i的位置,令
s
j
<
t
j
s_j
C. Tyler and Strings(组合数学,树状数组维护前缀和)(Codeforces Round #775 (Div. 1, based on Moscow Open Olympiad i)
关注
打赏
立即登录/注册
微信扫码登录
