XMU 2023.1.14 题解汇总

A、 CF1779A原题
B、https://www.cnblogs.com/wondering-world/p/17038860.html
C、https://www.luogu.com.cn/problem/solution/P4305
D、快速幂模板

点击查看代码
#include <bits/stdc++.h>
using namespace std;
#define N 100010
#define ll long long
const ll mod = 1e9 + 7; 

ll qpow(ll a, ll b){
    ll sum = 1;
    while(b){
        if(b & 1) sum = (sum * a) % mod;
        a = (a * a) % mod;
        b >>= 1; 
    }
    return sum; 
}

ll a, b, c; 

int main(){
    cin >> a >> b >> c; 
    cout << qpow(a, b) * qpow(b, c) % mod << endl; 
    return 0; 
}

E、https://www.luogu.com.cn/problem/solution/P8932 (分类讨论即可)
F、https://www.luogu.com.cn/problem/solution/P1470
G、https://www.cnblogs.com/wondering-world/p/16746324.html (求最近公共祖先即可。倍增也能实现。)
H、出题人不见了

posted @ 2023-01-14 22:17  雪之下,树之旁  阅读(65)  评论(0)    收藏  举报