結果

問題 No.167 N^M mod 10
ユーザー wing3196
提出日時 2015-03-19 23:31:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 352 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 66,440 KB
実行使用メモリ 10,268 KB
最終ジャッジ日時 2024-06-28 23:20:06
合計ジャッジ時間 2,863 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 2
other AC * 1 TLE * 1 -- * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
   21 |         printf("%d\n",ans);
      |                 ~^    ~~~
      |                  |    |
      |                  int  long long int
      |                 %lld

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<cstring>
#include<climits>
#include<functional>
#include<map>
#include<set>
using namespace std;
#define int long long

signed main(){
	int N,M;
	cin>>N>>M;
	int ans = 1;
	for(int i=0;i<M;i++){
		ans *= N; ans %= 10;
	}
	printf("%d\n",ans);
	return 0;
}
0