結果

問題 No.167 N^M mod 10
ユーザー nobigomunobigomu
提出日時 2018-05-31 17:36:37
言語 F#
(F# 4.0)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 279 bytes
コンパイル時間 13,562 ms
コンパイル使用メモリ 190,580 KB
実行使用メモリ 31,100 KB
最終ジャッジ日時 2023-10-22 00:22:18
合計ジャッジ時間 17,222 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
30,732 KB
testcase_01 AC 64 ms
31,012 KB
testcase_02 AC 64 ms
31,036 KB
testcase_03 AC 64 ms
31,036 KB
testcase_04 AC 65 ms
31,100 KB
testcase_05 AC 64 ms
31,012 KB
testcase_06 AC 64 ms
31,004 KB
testcase_07 AC 64 ms
31,004 KB
testcase_08 AC 63 ms
30,940 KB
testcase_09 AC 65 ms
31,004 KB
testcase_10 AC 65 ms
31,004 KB
testcase_11 AC 64 ms
31,004 KB
testcase_12 AC 64 ms
31,004 KB
testcase_13 AC 64 ms
30,940 KB
testcase_14 AC 63 ms
30,724 KB
testcase_15 AC 64 ms
31,004 KB
testcase_16 AC 66 ms
31,004 KB
testcase_17 AC 65 ms
31,004 KB
testcase_18 AC 66 ms
31,004 KB
testcase_19 AC 64 ms
31,012 KB
testcase_20 AC 64 ms
31,012 KB
testcase_21 AC 64 ms
31,012 KB
testcase_22 AC 64 ms
31,100 KB
testcase_23 AC 64 ms
31,100 KB
testcase_24 AC 65 ms
31,100 KB
testcase_25 AC 65 ms
31,100 KB
testcase_26 AC 62 ms
30,784 KB
testcase_27 AC 64 ms
31,100 KB
testcase_28 AC 64 ms
30,832 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (923 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

let f n = fun (s:string) -> if s.Length=1 then s.[0..] else s.[s.Length-n..]
match ((stdin.ReadLine >> f 1)(),(stdin.ReadLine >> f 2)()) with
    | (_,"0") -> 1
    | ("0",_) -> 0
    | (n,m) -> (pown (int n) ((int >> fun n -> if n%4=0 then 4 else n%4) m))%10
|> stdout.WriteLine
0