結果

問題 No.167 N^M mod 10
ユーザー SeiyaT
提出日時 2021-09-10 17:56:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 359 bytes
コンパイル時間 1,521 ms
コンパイル使用メモリ 172,600 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-11 16:57:28
合計ジャッジ時間 2,756 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll=long long;
ll mod=1000000007;
ll INF=1LL<<60;

int main() {
	string N,M;
	cin >> N >> M;
	vector<vector<int>> A={{0,0,0,0},{1,1,1,1},{6,2,4,8},{1,3,9,7},{6,4,6,4},{5,5,5,5},{6,6,6,6},{1,7,9,3},{6,8,4,2},{1,9,1,9}};
	int B=N.back()-'0';
	int C=stoi(M.substr(M.size()-2,2))%4;
	cout << A[B][C] << endl;
}
0