結果
問題 |
No.167 N^M mod 10
|
ユーザー |
|
提出日時 | 2020-04-05 23:02:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 349 bytes |
コンパイル時間 | 1,713 ms |
コンパイル使用メモリ | 167,396 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 14:14:11 |
合計ジャッジ時間 | 2,250 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define llong long long int main() { string n, m; cin >> n >> m; int nval = stoi(n[n.length()-1] + ""s); int mval = stoi(m[m.length()-1] + ""s); int result = 1; rep(i, mval) result *= nval; cout << result % 10 << endl; }