結果
問題 |
No.167 N^M mod 10
|
ユーザー |
![]() |
提出日時 | 2015-03-20 00:57:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 529 bytes |
コンパイル時間 | 604 ms |
コンパイル使用メモリ | 81,124 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 23:39:15 |
合計ジャッジ時間 | 1,333 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 25 WA * 2 |
ソースコード
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<string> #include<cstring> #include<climits> #include<functional> #include<map> #include<set> #include<queue> #include<cmath> using namespace std; signed main(){ string N,M; cin>>N>>M; reverse(N.begin(),N.end()); reverse(M.begin(),M.end()); vector<int> latte; if(M.size()==1){ M.resize(2); M[1] = '0'; } int calc = 1, cnt = (M[1]-'0')*10+(M[0]-'0')+4; for(int i=0;i<cnt;i++) calc = calc*(N[0]-'0')%10; printf("%d\n",calc); return 0; }