8 条题解

  • -1
    @ 2024-11-19 20:21:06
    #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
    标签
    递交数
    3135
    已通过
    480
    上传者