摘要: 首先来说说限制排列 例子: 相邻禁位排列问题:在整数1,2,3,...,n的无重全排列中,要求,求全体排列数 分析:利用容斥不难得到 旋转木马问题:8个小孩围坐在旋转木马上,问有多少种变换座位的方法,使得每个小孩前面坐的都不是原来的小孩? 分析:其实做法跟上面的方法一样,只是注意这里是换排列,那么总 阅读全文
posted @ 2017-12-04 11:48 vectors07 阅读(1335) 评论(0) 推荐(1) 编辑
摘要: 题目描述: LeetCode 483. Smallest Good Base For an integer n, we call k>=2 a good base of n, if all digits of n base k are 1. Now given a string representi 阅读全文
posted @ 2017-12-03 16:18 vectors07 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2017-12-03 13:32 vectors07 阅读(118) 评论(0) 推荐(0) 编辑
摘要: https://www.zybuluo.com/hanbingtao/note/448086 阅读全文
posted @ 2017-11-26 02:01 vectors07 阅读(199) 评论(0) 推荐(0) 编辑