Submission #6764482


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int main()
{
	scanf("%lld%lld%lld",&n,&m,&p);
    int ans=1;
    for(;p;p>>=1,n=n*n%m)
    {
    if(p&1)ans=ans*n%m;
    } 
    printf("%d\n",ans);
    return 0;
}

Submission Info

Submission Time
Task B - n^p mod m
User luogu_bot4
Language C++ (GCC 5.4.1)
Score 0
Code Size 220 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:24: error: ‘n’ was not declared in this scope
  scanf("%lld%lld%lld",&n,&m,&p);
                        ^
./Main.cpp:5:27: error: ‘m’ was not declared in this scope
  scanf("%lld%lld%lld",&n,&m,&p);
                           ^
./Main.cpp:5:30: error: ‘p’ was not declared in this scope
  scanf("%lld%lld%lld",&n,&m,&p);
                              ^