快速幂即为快速求出一个数的幂,这样可以避免TLE(超时)的错误。
传送门:快速幂模板
前置知识:
1) 又 2) 代码:
#include <bits/stdc.h>
using namespace std;
int quickPower(int a, int b) {int…
容斥原理: 容斥的复杂度为O(2^m),所以可以通过,对于实现,一共2^n-1种,我们可以用二进制来实现
下面是AC代码:
#include<bits/stdc.h>
using namespace std;
typedef long long LL;
cons…