結果

問題 No.167 N^M mod 10
ユーザー nobigomu
提出日時 2018-05-31 17:36:37
言語 F#
(F# 4.0)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 279 bytes
コンパイル時間 12,696 ms
コンパイル使用メモリ 185,984 KB
実行使用メモリ 29,568 KB
最終ジャッジ日時 2024-09-22 01:46:45
合計ジャッジ時間 15,145 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (675 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.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