結果

問題 No.312 置換処理
ユーザー 826814741_6
提出日時 2019-01-10 01:44:27
言語 F#
(F# 4.0)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 9,479 ms
コンパイル使用メモリ 190,888 KB
実行使用メモリ 35,020 KB
最終ジャッジ日時 2024-11-15 12:25:35
合計ジャッジ時間 26,566 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 45
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (279 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 m n =
    let f0 i r = if n%i=0L then i else r
    let rec f1 i r = if i>2L then f1 (i-1L) (f0 i r) else r
    let f2 i = if i<>4L && n%2L=0L then i/2L else i
    match (f1 m 0L) with
    | 0L -> f2 n
    | i -> i

let g = float >> sqrt >> floor >> int64

let h n = f (g n) n

stdin.ReadLine() |> int64 |> h |> printfn "%d"
0