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