結果

問題 No.312 置換処理
ユーザー 826814741_6826814741_6
提出日時 2019-01-10 01:44:27
言語 F#
(F# 4.0)
結果
AC  
実行時間 354 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 11,550 ms
コンパイル使用メモリ 184,944 KB
実行使用メモリ 35,056 KB
最終ジャッジ日時 2024-04-27 10:59:58
合計ジャッジ時間 28,688 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 348 ms
34,672 KB
testcase_01 AC 345 ms
34,656 KB
testcase_02 AC 351 ms
34,924 KB
testcase_03 AC 350 ms
34,236 KB
testcase_04 AC 340 ms
34,632 KB
testcase_05 AC 348 ms
34,128 KB
testcase_06 AC 345 ms
34,116 KB
testcase_07 AC 345 ms
34,804 KB
testcase_08 AC 346 ms
34,664 KB
testcase_09 AC 339 ms
34,368 KB
testcase_10 AC 343 ms
34,376 KB
testcase_11 AC 345 ms
34,164 KB
testcase_12 AC 342 ms
34,284 KB
testcase_13 AC 347 ms
34,516 KB
testcase_14 AC 341 ms
34,664 KB
testcase_15 AC 343 ms
34,916 KB
testcase_16 AC 339 ms
34,372 KB
testcase_17 AC 346 ms
34,792 KB
testcase_18 AC 343 ms
34,528 KB
testcase_19 AC 348 ms
34,932 KB
testcase_20 AC 354 ms
34,500 KB
testcase_21 AC 348 ms
35,040 KB
testcase_22 AC 336 ms
34,636 KB
testcase_23 AC 336 ms
34,376 KB
testcase_24 AC 336 ms
34,764 KB
testcase_25 AC 336 ms
34,500 KB
testcase_26 AC 335 ms
34,760 KB
testcase_27 AC 333 ms
34,504 KB
testcase_28 AC 334 ms
34,632 KB
testcase_29 AC 337 ms
34,756 KB
testcase_30 AC 338 ms
34,364 KB
testcase_31 AC 345 ms
34,160 KB
testcase_32 AC 337 ms
34,368 KB
testcase_33 AC 342 ms
34,112 KB
testcase_34 AC 344 ms
34,364 KB
testcase_35 AC 350 ms
35,056 KB
testcase_36 AC 341 ms
34,600 KB
testcase_37 AC 342 ms
34,764 KB
testcase_38 AC 337 ms
34,496 KB
testcase_39 AC 342 ms
34,364 KB
testcase_40 AC 340 ms
34,608 KB
testcase_41 AC 336 ms
34,628 KB
testcase_42 AC 339 ms
34,112 KB
testcase_43 AC 340 ms
34,884 KB
testcase_44 AC 336 ms
34,636 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (279 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 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