結果

問題 No.312 置換処理
ユーザー taktak
提出日時 2018-04-21 18:48:19
言語 F#
(F# 4.0)
結果
AC  
実行時間 377 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 13,183 ms
コンパイル使用メモリ 185,396 KB
実行使用メモリ 35,344 KB
最終ジャッジ日時 2024-04-27 10:55:00
合計ジャッジ時間 28,248 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 298 ms
34,664 KB
testcase_01 AC 353 ms
35,092 KB
testcase_02 AC 377 ms
35,072 KB
testcase_03 AC 377 ms
35,068 KB
testcase_04 AC 292 ms
34,672 KB
testcase_05 AC 297 ms
34,668 KB
testcase_06 AC 300 ms
35,096 KB
testcase_07 AC 324 ms
34,584 KB
testcase_08 AC 294 ms
35,040 KB
testcase_09 AC 303 ms
34,792 KB
testcase_10 AC 297 ms
34,780 KB
testcase_11 AC 304 ms
35,092 KB
testcase_12 AC 295 ms
34,116 KB
testcase_13 AC 294 ms
35,048 KB
testcase_14 AC 294 ms
33,996 KB
testcase_15 AC 293 ms
34,504 KB
testcase_16 AC 303 ms
34,796 KB
testcase_17 AC 298 ms
34,800 KB
testcase_18 AC 293 ms
34,800 KB
testcase_19 AC 298 ms
34,392 KB
testcase_20 AC 296 ms
34,932 KB
testcase_21 AC 294 ms
34,356 KB
testcase_22 AC 295 ms
34,796 KB
testcase_23 AC 299 ms
34,780 KB
testcase_24 AC 294 ms
34,376 KB
testcase_25 AC 295 ms
34,112 KB
testcase_26 AC 294 ms
34,364 KB
testcase_27 AC 294 ms
35,048 KB
testcase_28 AC 298 ms
34,788 KB
testcase_29 AC 296 ms
33,988 KB
testcase_30 AC 305 ms
35,344 KB
testcase_31 AC 298 ms
35,036 KB
testcase_32 AC 306 ms
34,968 KB
testcase_33 AC 328 ms
34,288 KB
testcase_34 AC 320 ms
34,960 KB
testcase_35 AC 301 ms
35,100 KB
testcase_36 AC 296 ms
33,908 KB
testcase_37 AC 296 ms
34,280 KB
testcase_38 AC 299 ms
34,676 KB
testcase_39 AC 315 ms
34,796 KB
testcase_40 AC 305 ms
34,668 KB
testcase_41 AC 299 ms
34,660 KB
testcase_42 AC 295 ms
34,064 KB
testcase_43 AC 311 ms
34,800 KB
testcase_44 AC 294 ms
34,664 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (523 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 minDivsor n =
    seq{3L..n}
    |> Seq.takeWhile(fun x -> x*x<=n)
    |> 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 when(n<>4L)-> n/2L
        | 0L when(n=4L) -> 4L
        | _  -> n
|> printfn "%i"
0