結果

問題 No.167 N^M mod 10
ユーザー agatan
提出日時 2015-04-26 11:27:13
言語 D
(dmd 2.109.1)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 879 ms
コンパイル使用メモリ 99,456 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 02:36:17
合計ジャッジ時間 1,810 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 22 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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


void main()
{
    char n = readln.strip[$];
    string m = readln.strip[$-2 .. $];
    int N = n.to!int;
    int M = m.to!int;

    if (M == 0) writeln(1);
    else {
        writeln(N ^^ ((M - 1) % 4 + 1) % 10);
    }
}
0