結果
| 問題 | No.167 N^M mod 10 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-25 19:02:33 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 930 ms |
| コンパイル使用メモリ | 175,148 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-27 20:06:12 |
| 合計ジャッジ時間 | 1,981 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
if (b == "0") {
cout << 1 << endl;
return 0;
}
int x = a[a.length() -1] - '0';
int y = b[b.length() -1] - '0';
int s = 1;
for(int i=0;i<y;i++){
s *= x;
s %= 10;
}
cout << s << endl;
}