結果
問題 |
No.167 N^M mod 10
|
ユーザー |
|
提出日時 | 2017-02-06 17:22:44 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 435 bytes |
コンパイル時間 | 1,509 ms |
コンパイル使用メモリ | 139,684 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 06:55:16 |
合計ジャッジ時間 | 2,560 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 WA * 8 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; const tbl = [[0,0,0,0], [1,1,1,1], [6,2,4,8], [1,3,9,7], [6,4,6,4], [5,5,5,5], [6,6,6,6], [1,7,9,3], [6,8,4,2], [1,9,1,9]]; void main() { auto n = readln.chomp; auto m = readln.chomp; if (m == "0") { writeln(1); } else { auto n2 = n.tail(1).to!string.to!int; auto m2 = n.tail(2).to!string.to!int % 4; writeln(tbl[n2][m2]); } }