您当前的位置: 首页 > 

*DDL_GzmBlog

暂无认证

  • 2浏览

    0关注

    605博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

西南民族大学第十二届程序设计竞赛

*DDL_GzmBlog 发布时间:2021-03-14 21:13:04 ,浏览量:2

*传送门

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            
关注
打赏
1657615554
查看更多评论
0.0440s