結果

問題 No.312 置換処理
ユーザー taktak
提出日時 2018-04-21 18:42:46
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 3,794 ms
コンパイル使用メモリ 152,504 KB
実行使用メモリ 25,088 KB
最終ジャッジ日時 2023-09-09 12:21:57
合計ジャッジ時間 9,010 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
24,996 KB
testcase_01 AC 98 ms
22,908 KB
testcase_02 AC 105 ms
24,904 KB
testcase_03 AC 106 ms
24,924 KB
testcase_04 AC 83 ms
25,064 KB
testcase_05 AC 82 ms
24,964 KB
testcase_06 AC 83 ms
22,892 KB
testcase_07 AC 88 ms
24,964 KB
testcase_08 AC 83 ms
23,040 KB
testcase_09 AC 83 ms
24,896 KB
testcase_10 AC 82 ms
22,952 KB
testcase_11 AC 85 ms
24,920 KB
testcase_12 AC 82 ms
22,852 KB
testcase_13 AC 82 ms
24,952 KB
testcase_14 AC 82 ms
22,808 KB
testcase_15 AC 82 ms
23,120 KB
testcase_16 AC 82 ms
25,088 KB
testcase_17 AC 82 ms
22,928 KB
testcase_18 AC 82 ms
20,876 KB
testcase_19 AC 83 ms
24,980 KB
testcase_20 AC 82 ms
24,988 KB
testcase_21 AC 81 ms
22,904 KB
testcase_22 AC 82 ms
21,048 KB
testcase_23 WA -
testcase_24 AC 85 ms
23,132 KB
testcase_25 AC 82 ms
24,912 KB
testcase_26 AC 83 ms
25,004 KB
testcase_27 AC 83 ms
22,968 KB
testcase_28 AC 82 ms
22,936 KB
testcase_29 AC 82 ms
22,928 KB
testcase_30 AC 85 ms
22,916 KB
testcase_31 AC 82 ms
23,124 KB
testcase_32 AC 85 ms
22,912 KB
testcase_33 AC 89 ms
20,924 KB
testcase_34 AC 90 ms
23,080 KB
testcase_35 AC 82 ms
22,912 KB
testcase_36 AC 82 ms
23,044 KB
testcase_37 AC 83 ms
22,960 KB
testcase_38 AC 84 ms
23,140 KB
testcase_39 AC 83 ms
22,908 KB
testcase_40 AC 83 ms
23,036 KB
testcase_41 AC 83 ms
24,956 KB
testcase_42 AC 82 ms
23,016 KB
testcase_43 AC 83 ms
24,916 KB
testcase_44 AC 82 ms
23,040 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let minDivsor n =
    seq{3L..n|>float|>sqrt|>int64}
    |> Seq.where(fun x -> n%x=0L)
    |> Seq.tryHead

let n = stdin.ReadLine() |> int64

n
|> minDivsor
|> function
    | Some(x) -> x
    | None    ->
        match n%2L with
        | 0L -> n/2L
        | _  -> n
|> printfn "%i"
0