結果
問題 | No.638 Sum of "not power of 2" |
ユーザー | tak |
提出日時 | 2018-04-23 16:12:11 |
言語 | F# (F# 4.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 510 bytes |
コンパイル時間 | 4,355 ms |
コンパイル使用メモリ | 157,332 KB |
実行使用メモリ | 524,500 KB |
最終ジャッジ日時 | 2023-09-09 21:35:57 |
合計ジャッジ時間 | 8,331 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 86 ms
34,240 KB |
testcase_01 | AC | 86 ms
23,000 KB |
testcase_02 | AC | 86 ms
23,044 KB |
testcase_03 | AC | 86 ms
21,072 KB |
testcase_04 | AC | 94 ms
23,268 KB |
testcase_05 | AC | 87 ms
23,036 KB |
testcase_06 | AC | 93 ms
23,120 KB |
testcase_07 | AC | 93 ms
23,160 KB |
testcase_08 | MLE | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
let isEnable N = let powOf2Set = let powOf2Seq = Seq.unfold (fun x -> if x>100000000L then None else Some(x,x*2L)) 1L powOf2Seq |> Set.ofSeq let lis = [1L .. N-1L] lis |> List.tryFind(fun x -> let y = N-x not (powOf2Set.Contains x) && not (powOf2Set.Contains y)) let N = stdin.ReadLine() |> int64 N |> isEnable |> function | None -> sprintf "-1" | Some(x) -> sprintf "%i %i" x (N-x) |> printfn "%s"