結果

問題 No.167 N^M mod 10
ユーザー wing3196
提出日時 2015-03-19 23:30:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 66,264 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-28 23:18:40
合計ジャッジ時間 1,394 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<cstring>
#include<climits>
#include<functional>
#include<map>
#include<set>
using namespace std;

int main(){
	int N,M;
	cin>>N>>M;
	int ans = 1;
	for(int i=0;i<M;i++){
		ans *= N; ans %= 10;
	}
	printf("%d\n",ans);
	return 0;
}
0