14 条题解

  • 2
    @ 2025-5-11 9:42:17
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        long long a,b,p,res=1;
        scanf("%ld%ld%ld",&a,&b,&p);
        while(b!=0){
            if(b&1){
                res=res*a%p;
            }
            a=a*a%p;
            b>>=1;
        }
        printf("%ld\n",res%p);
        return 0;
    }
    
    

    信息

    ID
    2
    时间
    1000ms
    内存
    128MiB
    难度
    8
    标签
    递交数
    3239
    已通过
    496
    上传者