*传送门
B.求快速幂的和快速幂模板
LL qmi(int a, int b, int p)
{
LL res = 1 % p;
while (b)
{
if (b & 1) res = res * a % p;
a = a * (LL)a % p;
b >>= 1;
}
return res;
///快速幂就是将x ^ n 的n次方换成了2^t1+2^t2+…+2^tk
}
#include
using namespace std;
const int mod = 1e9 + 7;
typedef long long ll;
ll qpow(ll x, ll y){
ll res = 1;
while(y){
if(y & 1) res = (res * x) % mod;
y >>= 1;
x = (x * x) % mod;
}
return res;
}
ll n, m;
int main(){
cin >> n >> m;
ll ans = 0;
for(ll i = n; i > a[i].b >> a[i].c;
sum += a[i].s;
}
sort(a + 1, a + 1 + n, cmp);
int p = 0;
for(int i = 1; i = r){
tmp = r - sum;
p += a[i].b * tmp;
break;
}
p += tmp * a[i].b;
sum += tmp;
}
cout d;
for(int i=1; ia[i].x>>a[i].y;
int ans=0;
for(int i=1;i
关注
打赏