結果

問題 No.167 N^M mod 10
ユーザー wing3196
提出日時 2015-03-20 00:46:07
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 619 ms
コンパイル使用メモリ 80,260 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-28 23:36:35
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

signed main(){
	string N,M;
	cin>>N>>M;
	reverse(N.begin(),N.end());
	reverse(M.begin(),M.end());
	vector<int> latte;
	int calc = 1, cnt = (M[1]-'0')*10+(M[0]-'0')+4;
	for(int i=0;i<cnt;i++) calc = calc*(N[0]-'0')%10; 
	printf("%d\n",calc);
	return 0;
}
0