結果

問題 No.167 N^M mod 10
ユーザー HaarHaar
提出日時 2016-03-04 12:38:02
言語 Haskell
(9.8.2)
結果
RE  
実行時間 -
コード長 272 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 162,460 KB
実行使用メモリ 10,472 KB
最終ジャッジ日時 2023-10-24 19:45:45
合計ジャッジ時間 3,431 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 13 ms
10,188 KB
testcase_03 AC 12 ms
10,188 KB
testcase_04 RE -
testcase_05 AC 2 ms
5,236 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 2 ms
5,232 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 2 ms
5,232 KB
testcase_12 AC 3 ms
5,232 KB
testcase_13 RE -
testcase_14 AC 2 ms
5,100 KB
testcase_15 RE -
testcase_16 AC 2 ms
5,232 KB
testcase_17 RE -
testcase_18 AC 2 ms
5,236 KB
testcase_19 AC 2 ms
5,240 KB
testcase_20 AC 2 ms
5,312 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 13 ms
10,188 KB
testcase_24 AC 12 ms
10,188 KB
testcase_25 AC 12 ms
10,188 KB
testcase_26 AC 4 ms
6,784 KB
testcase_27 RE -
testcase_28 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

d = [[0],[1],[2,4,8,6],[3,9,7,1],[4,6],[5],[6],[7,9,3,1],[8,4,2,6],[9,1]]

main=do
    [n,m]<-getContents>>=return.map(read::String->Integer).lines
    let dd = d!!(fromIntegral(n`mod`10))
    print$if m==0 then 1 else dd!!(fromIntegral(m`mod`(fromIntegral(length dd))-1))
0