結果
| 問題 |
No.167 N^M mod 10
|
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2016-03-30 22:14:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 291 bytes |
| コンパイル時間 | 416 ms |
| コンパイル使用メモリ | 54,364 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-10-02 08:17:33 |
| 合計ジャッジ時間 | 2,814 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | AC * 1 TLE * 1 -- * 25 |
ソースコード
#include <iostream>
using namespace std;
#define ll long long
#define ull unsigned ll
int powmod(ull x,ull y){
unsigned long long ans = 1;
while(y--){
ans *= x;
ans %= 10;
}
return ans;
}
int main(){
ull n,m;
cin >> n >> m;
cout << powmod(n,m) << endl;
}
ldsyb