题目大意:有n块巧克力,每块巧克力有一个大小.巧克力可以切成若干份.现在要你切成大小相等的m块,且尽可能大.求这个大小. 解题思路:我们二分巧克力切成的大小,然后计算能切成多少块,判断即可.由于最大的巧克力大小为10000,所以时间复杂度为$O(n\log {10000})$. C++ Code: #include<cstdio> using namespace std; int n,m,a[5005]; bool ok(int x){ int cnt=0; for(int i=1;i<…
好吧学长说是板子...学了之后才发现就是板子qwq 题意:求$ C_n^{w_1}*C_{n-w_1}^{w_2}*C_{n-w_1-w_2}^{w_3}*...\space mod \space P$ 当然,如果$\Sigma w_i >n$,则无解. (不会扩展卢卡斯?) #include<cstdio> #include<iostream> #define ll long long #define R register ll using namespace std; i…