結果
問題 |
No.167 N^M mod 10
|
ユーザー |
![]() |
提出日時 | 2017-01-25 02:40:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 586 bytes |
コンパイル時間 | 777 ms |
コンパイル使用メモリ | 77,128 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 08:08:12 |
合計ジャッジ時間 | 1,698 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 13 |
ソースコード
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define pb push_back #define all(a) (a).begin(), (a).end() #define mp make_pair using namespace std; typedef long long int lli; lli MOD = 1000000007; int main() { string n, m; cin >> n >> m; int a = n[n.size() - 1] - '0'; int b = m[m.size() - 1] - '0'; int ans = 1; rep(i, b) { ans *= a; } cout << ans % 10 << endl; }