結果
問題 |
No.312 置換処理
|
ユーザー |
![]() |
提出日時 | 2018-04-21 18:51:13 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 449 ms / 2,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 7,237 ms |
コンパイル使用メモリ | 189,076 KB |
実行使用メモリ | 35,216 KB |
最終ジャッジ日時 | 2024-11-15 12:20:21 |
合計ジャッジ時間 | 24,861 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (252 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 = function | 3L -> Some(3L) | 4L -> Some(4L) | 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 -> n/2L | _ -> n |> printfn "%i"