結果

問題 No.167 N^M mod 10
ユーザー agatan
提出日時 2015-04-26 11:14:02
言語 D
(dmd 2.109.1)
結果
TLE  
実行時間 -
コード長 261 bytes
コンパイル時間 804 ms
コンパイル使用メモリ 96,256 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-12 02:35:38
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 2
other AC * 1 TLE * 1 -- * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.array, std.stdio, std.string, std.algorithm, std.conv;


void main()
{
    long N = readln.strip.to!long;
    long M = readln.strip.to!long;
    int tmp = N % 10;
    foreach (i; 1..M) {
        tmp *= N;
        tmp %= 10;
    }
    writeln(tmp);
}
0