結果

問題 No.167 N^M mod 10
ユーザー orca37
提出日時 2018-02-16 23:22:13
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 177 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 53,244 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 06:08:34
合計ジャッジ時間 1,332 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
  int N,M;
  cin >> N >>M;
  N%=10;
  M%=4;
  int ans=N;
  int i;
  for(i=1;i<M;i++){
    ans=ans*N%10;
}
  cout << ans;
}

0