結果

問題 No.167 N^M mod 10
コンテスト
ユーザー nobigomu
提出日時 2018-05-31 17:36:37
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 279 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,180 ms
コンパイル使用メモリ 214,880 KB
実行使用メモリ 31,744 KB
最終ジャッジ日時 2026-04-10 07:09:47
合計ジャッジ時間 9,742 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (229 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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