結果
| 問題 |
No.167 N^M mod 10
|
| コンテスト | |
| ユーザー |
kkslucy1
|
| 提出日時 | 2018-03-14 04:40:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 260 bytes |
| コンパイル時間 | 1,223 ms |
| コンパイル使用メモリ | 160,340 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-24 22:43:30 |
| 合計ジャッジ時間 | 2,046 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
string n, m;
cin >> n >> m;
int n2 = n[n.size() - 1] - '0';
int m2 = m[0] - '0';
if(m.size()>1){
m2 += (m[m.size() - 2] - '0') * 10;
}
cout << (int)pow(n2, m2%4+4) % 10 << endl;
return 0;
}
kkslucy1