結果

問題 No.312 置換処理
ユーザー 826814741_6826814741_6
提出日時 2019-01-10 01:44:27
言語 F#
(F# 4.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 5,390 ms
コンパイル使用メモリ 157,852 KB
実行使用メモリ 24,992 KB
最終ジャッジ日時 2023-08-09 16:14:11
合計ジャッジ時間 11,052 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
22,864 KB
testcase_01 AC 86 ms
22,780 KB
testcase_02 AC 94 ms
22,764 KB
testcase_03 AC 94 ms
22,840 KB
testcase_04 AC 83 ms
22,796 KB
testcase_05 AC 95 ms
24,840 KB
testcase_06 AC 88 ms
22,892 KB
testcase_07 AC 95 ms
24,856 KB
testcase_08 AC 94 ms
22,844 KB
testcase_09 AC 89 ms
22,808 KB
testcase_10 AC 89 ms
24,772 KB
testcase_11 AC 92 ms
22,868 KB
testcase_12 AC 90 ms
22,736 KB
testcase_13 AC 94 ms
22,876 KB
testcase_14 AC 91 ms
22,864 KB
testcase_15 AC 88 ms
24,816 KB
testcase_16 AC 86 ms
22,944 KB
testcase_17 AC 92 ms
22,868 KB
testcase_18 AC 87 ms
22,904 KB
testcase_19 AC 91 ms
24,844 KB
testcase_20 AC 92 ms
22,840 KB
testcase_21 AC 95 ms
20,760 KB
testcase_22 AC 83 ms
22,960 KB
testcase_23 AC 86 ms
22,752 KB
testcase_24 AC 77 ms
20,700 KB
testcase_25 AC 78 ms
20,848 KB
testcase_26 AC 84 ms
24,992 KB
testcase_27 AC 81 ms
22,944 KB
testcase_28 AC 81 ms
20,760 KB
testcase_29 AC 81 ms
22,872 KB
testcase_30 AC 83 ms
22,840 KB
testcase_31 AC 83 ms
22,744 KB
testcase_32 AC 84 ms
22,788 KB
testcase_33 AC 86 ms
24,816 KB
testcase_34 AC 87 ms
22,812 KB
testcase_35 AC 88 ms
22,868 KB
testcase_36 AC 81 ms
20,812 KB
testcase_37 AC 79 ms
24,908 KB
testcase_38 AC 84 ms
22,952 KB
testcase_39 AC 87 ms
22,828 KB
testcase_40 AC 84 ms
24,900 KB
testcase_41 AC 83 ms
20,696 KB
testcase_42 AC 85 ms
22,744 KB
testcase_43 AC 84 ms
22,748 KB
testcase_44 AC 84 ms
20,768 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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