結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2018-04-21 18:48:19 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 441 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 16,498 ms |
コンパイル使用メモリ | 188,932 KB |
実行使用メモリ | 35,328 KB |
最終ジャッジ日時 | 2024-11-15 12:19:35 |
合計ジャッジ時間 | 33,936 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (347 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/
ソースコード
let minDivsor n =seq{3L..n}|> Seq.takeWhile(fun x -> x*x<=n)|> Seq.where(fun x -> n%x=0L)|> Seq.tryHeadlet n = stdin.ReadLine() |> int64n|> minDivsor|> function| Some(x) -> x| None ->match n%2L with| 0L when(n<>4L)-> n/2L| 0L when(n=4L) -> 4L| _ -> n|> printfn "%i"