結果

問題 No.414 衝動
ユーザー kuuso1kuuso1
提出日時 2016-08-26 22:29:30
言語 F#
(.NET 7)
結果
AC  
実行時間 198 ms / 1,000 ms
コード長 478 bytes
コンパイル時間 5,135 ms
コンパイル使用メモリ 168,476 KB
実行使用メモリ 57,732 KB
最終ジャッジ日時 2023-08-09 13:20:28
合計ジャッジ時間 8,178 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 169 ms
53,636 KB
testcase_01 AC 83 ms
22,996 KB
testcase_02 AC 82 ms
23,000 KB
testcase_03 AC 196 ms
53,612 KB
testcase_04 AC 182 ms
55,584 KB
testcase_05 AC 195 ms
55,644 KB
testcase_06 AC 198 ms
57,732 KB
testcase_07 AC 86 ms
25,068 KB
testcase_08 AC 144 ms
41,140 KB
testcase_09 AC 195 ms
57,632 KB
testcase_10 AC 84 ms
24,960 KB
testcase_11 AC 84 ms
25,008 KB
testcase_12 AC 85 ms
23,068 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let ri () = stdin.ReadLine() |> int
let ria () = stdin.ReadLine().Split() |> Array.map int

type Sol() =
    member this.Solve() = 
        
        let M = stdin.ReadLine() |> int64
        let sqrtM = M |> double |> sqrt |> int
        let res = [2..sqrtM] |> List.tryFind (fun p -> M % (int64 p) = 0L )
        let n = res |> ( function | Some p -> (int64 p) | None -> M ) 
        printfn "%d %d" (M/n) n
        
        ()
let mySol = new Sol()
mySol.Solve()
0