AtCoder Typical Contest 002

Submission #10093972

Source codeソースコード

using namespace std;
#define ll long long
#define re register
inline ll read()
{
	char c=getchar();int f=1,s=0;
	while(!isdigit(c)){f=-1;c=getchar();}
	while(isdigit(c)){s=s*10+c-48;c=getchar();}
	return s;
}
const double pi=acos(-1.0);
signed main()
{
	ll n,m,p,ans=1;
	cin>>n>>m>>p;
	for(;p;p>>=1,n*n%m)
	{
		if(p&1) ans=ans*n%m;
	}
	cout<<ans<<endl;
    return 0;
}

Submission

Task問題 B - n^p mod m
User nameユーザ名 luogu_bot1
Created time投稿日時
Language言語 C++ (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 389 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘long long int read()’:
./Main.cpp:6:17: error: ‘getchar’ was not declared in this scope
char c=getchar();int f=1,s=0;
^
./Main.cpp:7:18: error: ‘isdigit’ was not declared in this scope
while(!isdigit(c)){f=-1;c=getchar();}
^
./Main.cpp:8:17: error: ‘isdigit’ was not declared in this scope
while(isdigit(c)){s=s*10+c-48;c=getchar();}
^
./Main.cpp: At global scope:
./Main.cpp:11:26: error: ‘acos’ was not declared in this scope
const double pi=acos(-1.0);
^
./Main.cpp: In function ‘int main()’:
./Main.cpp:15:2: error: ‘cin’ was not declared in this scope
cin>>n>>m>>p;
^
./Main.cpp:20:2: error: ‘cout’ was not declared in this scope
cout<<ans<<endl;
^
./Main.cpp:20:13: error: ‘endl’ was not declared in this scope
cout<<ans<<endl;
^

Test case