当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
给你一个序列s,你把这个序列的所有不同排列按字典序排列后,求s的排名mod m
序列的长度n<300 000,m n个数,代表序列s
排名mod m
4 1000 2 1 10 2
5
All the permutations smaller (with respect to lexicographic order) than the one given are: (1,2,2,10), (1,2,10,2), (1,10,2,2) and (2,1,2,10). 2<=m<=10^9,1<=Si<=300000
| bzoj_id | 1129 |
| import_source_sha256 | 18db3c038abd0c6648d708e2ee54003cb30efa5eee4831c942e5eeab11507c3a |
| bzoj_checker_pending | False |
| 时间上限 | 内存上限 |
| 10000 MS | 162 MB |